protecting your data using encryption in sql server

28
Security Talk: Protecting Your Data Using Encryption in SQL Server Il-Sung Lee Senior Program Manager Microsoft Corporation [email protected]

Upload: others

Post on 12-Sep-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Protecting Your Data Using Encryption in SQL Server

Security Talk: Protecting Your Data Using Encryption in SQL Server

Il-Sung Lee

Senior Program Manager

Microsoft Corporation

[email protected]

Page 2: Protecting Your Data Using Encryption in SQL Server

What We Will Cover

• Cell-Level Encryption

• Transparent Data Encryption

• Extensible Key Management (EKM)

• Channel Encryption

Page 3: Protecting Your Data Using Encryption in SQL Server

Data Encryption

• Why consider encryption?

– Additional layer of security

– Required by some regulatory compliance laws

• In Microsoft® SQL Server® 2000

– Channel Encryption only

• Since Microsoft® SQL Server® 2005

– Built-in support for data encryption

– Support for key management

• Encryption additions in Microsoft® SQL Server® 2008

– Transparent Data Encryption

– Extensible Key Management

Page 4: Protecting Your Data Using Encryption in SQL Server

Cell-Level Encryption

Page 5: Protecting Your Data Using Encryption in SQL Server

Cell-Level Encryption

• Encryption/Decryption built-ins

• Symmetric and asymmetric keys, certificates– Creation data definition language (DDL)

– Symmetric keys and private keys stored encrypted

• Keys secured by:– User passwords

– Automatically (SQL Server key management)

– Choice of algorithms • DES, TRIPLE_DES, RC2, RC4, RC4_128, AES

(128, 192, or 256)

Page 6: Protecting Your Data Using Encryption in SQL Server

Key HierarchyOperating System Level

Data Protection API (DPAPI)

Certificates

Asymmetric

Keys

SQL Server 2005

Instance LevelService Master Key

DPAPI encrypts

Service Master Key

SQL Server 2005

Database LevelDatabase Master Key

Service Master Key encrypts

Database Master Key

Password

Password

Symmetric

Keys

PasswordPassword

Password

Value

Page 7: Protecting Your Data Using Encryption in SQL Server

Clinic Encryption

demonstration

Page 8: Protecting Your Data Using Encryption in SQL Server

Don’t Forget Module Signing

• Need ALTER ANY LOGIN server permission

to ALTER LOGIN

• Need to GRANT ALTER ANY LOGIN TO

Alice? – No!

ALTER LOGIN Bob ENABLE

Alice

(non-privileged login)

Page 9: Protecting Your Data Using Encryption in SQL Server

• Alice has permission to call SP

• SP run under Alice’s context but with

elevated privilege

• SP protected against tampering

SP_ENABLE_LOGIN

ALTER LOGIN Bob ENABLE

Cert_login

ALTER ANY LOGIN

Alice

(non-privileged login)

Don’t Forget Module Signing

Page 10: Protecting Your Data Using Encryption in SQL Server

Best Practices

• Make signing modules a habit

• Do not encrypt all of your data

• Use symmetric encryption

• Plan carefully

– Key management is very important

– Understand changes to existing code needed

– Consider key size and algorithm on CPU

Page 11: Protecting Your Data Using Encryption in SQL Server

Transparent Data

Encryption

Page 12: Protecting Your Data Using Encryption in SQL Server

Transparent Data Encryption (TDE)

• Encryption/decryption at database level

• Database encryption key (DEK) is encrypted with:– Service Master Key

– Key residing in a Hardware Security Module (HSM)

• DEK must be decrypted to attach database files or restore a backup

SQL Server 2008

•DEK

Client Application

Encrypted data page

Page 13: Protecting Your Data Using Encryption in SQL Server

TDE – Key Hierarchy

Database Master Key

encrypts Certificate in Master

Database

SQL Server 2008

User Database

Database Encryption Key

DPAPI encrypts

Service Master Key

Service Master Key encrypts

Database Master Key

Password

Operating System Level

Data Protection API (DPAPI)

SQL Server 2008

Instance LevelService Master Key

SQL Server 2008

Master DatabaseDatabase Master Key

SQL Server 2008

Master Database

Certificate

Certificate encrypts Database

Encryption Key

Page 14: Protecting Your Data Using Encryption in SQL Server

Reasons to Use TDE

• Protects data at rest

– Data files, log files, backup

• Entire database is protected

• No application changes!

– No restrictions with indexes or data types (except

Filestream)

• Performance cost is small

• Storage space size unchanged

Page 15: Protecting Your Data Using Encryption in SQL Server

TDE Considerations

• Compatible with Database Compression

• Not recommended with Backup Compression

• Database Mirroring– Copy certificate from primary to mirror

• Log files are not retroactively encrypted– Encryption begins at next virtual log file (VLF)

boundary

• Tempdb is encrypted when 1 db in instance uses TDE

• Enterprise only

Page 16: Protecting Your Data Using Encryption in SQL Server

Enabling Transparent Data Encryption

demonstration

Page 17: Protecting Your Data Using Encryption in SQL Server

Extensible Key

Management

Page 18: Protecting Your Data Using Encryption in SQL Server

Extensible Key Management

SQL EKM Provider DLL

SQL EKM Key

(HSM key proxy)

Data

SQL Server

• Key storage,

management, and

encryption done by HSM

module

• EKM key appears same as

normal key to app

• SQL EKM Provider

dynamic-link library (DLL)

provided by HSM vendor

HSM

Page 19: Protecting Your Data Using Encryption in SQL Server

Advantages of Using EKM

• Security

– Data and keys are physically separated

– Centralized key management for enterprise

– Separation of duties between database owner

and data owner

• Performance

– Pluggable hardware encryption boards

Page 20: Protecting Your Data Using Encryption in SQL Server

Cryptographic Providers and Keys

• EKM providers are server objects

• EKM keys are very similar to native keys

– Managed using the same TSQL

– Visible in the same catalogs

– Data encryption with standard built-ins

– Used to encrypt SQL native keys

Page 21: Protecting Your Data Using Encryption in SQL Server

EKM Key Hierarchy in SQL Server 2008

HSM

Data Data

Native

Symmetric keyTDE DEK key

EKM Symmetric key EKM Asymmetric key•SQL

Server

Symmetric key Asymmetric key

Page 22: Protecting Your Data Using Encryption in SQL Server

EKM Vendor Support

•And others coming soon…

Page 23: Protecting Your Data Using Encryption in SQL Server

Channel Encryption

Page 24: Protecting Your Data Using Encryption in SQL Server

Channel Encryption

• Full Secure-Sockets Layer (SSL) encryption

• Login credentials always encrypted

• Self-signed certificates

SSL

LOGIN

Userid

Password

...

Page 25: Protecting Your Data Using Encryption in SQL Server

Protecting Your Data

• Encrypt data to provide additional layer of

security

• Use TDE to protect data at rest

• Protect your keys!

• Leverage EKM to consolidate key

management and separate data from keys

• Protect data in transit

Page 26: Protecting Your Data Using Encryption in SQL Server

For More Information…

• Visit TechNet at www.microsoft.com/technet

• For additional information on books, courses, and other community resources that support this session visit

– SQL Server Encryptionhttp://technet.microsoft.com/en-us/library/bb510663.aspx

– Database Encryption in SQL Server 2008 Enterprise Editionhttp://msdn.microsoft.com/en-us/library/cc278098.aspx

– SQL Server Security home page www.microsoft.com/sqlserver/2008/en/us/security.aspx

Page 27: Protecting Your Data Using Encryption in SQL Server

Questions and Answers

• Submit text questions using the “Ask” button

• Don’t forget to fill out the survey

• For upcoming and previously live webcasts:

www.microsoft.com/webcast

• Got webcast content ideas? Contact us at:

http://go.microsoft.com/fwlink/?LinkId=41781

Page 28: Protecting Your Data Using Encryption in SQL Server