Secure Data Access with SQL Server 2005 Doug Rees Associate Technologist, CM Group
Agenda Introduction Secure by Default Password Policy and Authentication User-Schema Separation and Object-Name Resolution Granular Permissions Execution Context CLR Integration Encryption
Introduction – Why Worry? Data is your most valuable asset Attacks can come from both external and internal sources Insecure access of your data can lead to disaster for your business: Tampering with data Information disclosure SQL Server 2005 introduces several new features to help keep your data secure
Secure By Default Installation defaults to secure state if no setup options are changed Choose components for installation (none by default) Select user account details for services Windows authentication is default authentication mode Access to many resources must be explicitly enabled or granted before being used SQL Server Surface Area Configuration utility Permissions
Password Policy And Authentication SQL Server 2005 can inherit Windows Server 2003 Password Policy Policy can be enabled or disabled on a per login basis Logins can be enabled and disabled for temporary removal Login protocol uses secure channel for SQL accounts Uses SQL Server generated certificate if necessary No SSL certificate loading is required
Password Policy and Login Management
User-Schema Separation Objects are associated with a schema not a user Allows removal of user without changing object names in database or client applications Users can be assigned a default schema HR Employee (Server.AdventureWorks.HR.Employee) dbo Audit (Server.AdventureWorks.dbo.Audit) Category (Server.AdventureWorks.Marketing.Category) Marketing
Object-Name Resolution HR Category Marketing SELECT * FROM Marketing.Category Dave (Default schema = Marketing) Jane (Default schema = HR) Audit dbo SELECT * FROM Category SELECT * FROM Audit SELECT * FROM Category
Permissions Can be applied to three scopes Can have one of three states Catalog security blocks access to system tables allowing access only using views Granular Permissions Server Schema Database GRANT DENY REVOKE
User Schemas and Permissions
Execution Context EXECUTE AS changes execution context CALLER : based on the caller's context (default) 'USER' : a specific user account SELF : account that created/modified the module OWNER : current owner of the module Restricted to current database context by default Establish a trust relationship to extend impersonation to other databases
How EXECUTE AS Works Audit (Owner: dbo) Audit (Owner: dbo) Jane (No permissions) Jane (No permissions) GetAuditLog (Owner: Dave) GetAuditLog (Owner: Dave) GetAuditLog Jane (EXECUTE permission) Jane (EXECUTE permission) Dave (SELECT permission) Dave (SELECT permission) CREATE PROC GetAuditLog AS SELECT * FROM dbo.Audit CREATE PROC GetAuditLog AS SELECT * FROM dbo.Audit CREATE PROC GetAuditLog WITH EXECUTE AS 'Dave' AS SELECT * FROM dbo.Audit CREATE PROC GetAuditLog WITH EXECUTE AS 'Dave' AS SELECT * FROM dbo.Audit Audit
EXECUTE AS and Trust Relationships
SQL Server 2005 integrates managed assemblies inside the database engine Three security options: SAFE: Default setting EXTERNAL_ACCESS: access to external resources etc. UNSAFE: unrestricted internal and external access!!! CLR Integration EXTERNAL_ACCESS SAFE UNSAFE File Unmanaged Code
CLR Integration
Encryption Built in support for encryption and decryption Allows secure storage of data within the database Keys can be secured within or external to SQL Server Supports:SymmetricAsymmetric Encryption by paraphrase Certificates Service master key Database master key Symmetric key Asymmetric key Certificate
Encryption
Summary SQL Server 2005 is secure by default Password policies can be enforced Schemas allow user-object separation Permissions allow strong control over objects EXECUTE AS changes execution context Use.NET assemblies with care In-built encryption protects your data
Additional Resources SQL Server 2005 Security Microsoft SQL Server 2005 Upgrade Advisor 1FBF81-AB07-4CCB-A18B-DA38F6BCF484&displaylang=en 1FBF81-AB07-4CCB-A18B-DA38F6BCF484&displaylang=en SQL Nuggets SQL Server 2005 Webcasts Introduction to Security in SQL Server 2005 Securing Your Data with SQL Server 2005 Encryption Encryption and Key Management Using SQL Server 2005 Efficiently Using the SQL Server Execution Context in Applications
© 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.