+ All Categories
Home > Technology > SQL Server 2016 New Security Features

SQL Server 2016 New Security Features

Date post: 16-Apr-2017
Category:
Upload: gianluca-sartori
View: 1,106 times
Download: 4 times
Share this document with a friend
40
#SQLSAT454 SQL Server 2016 New Security Features Gianluca Sartori @spaghettidba
Transcript
Page 1: SQL Server 2016 New Security Features

#SQLSAT454

SQL Server 2016 New Security Features

Gianluca Sartori@spaghettidba

Page 2: SQL Server 2016 New Security Features

#SQLSAT454

Sponsors

Page 3: SQL Server 2016 New Security Features

#SQLSAT454

Gianluca Sartori Independent SQL Server consultant

SQL Server MVP, MCTS, MCITP, MCT

Works with SQL Server since version 7

DBA @ Scuderia Ferrari

Blog: spaghettidba.com Twitter: @spaghettidba

Page 4: SQL Server 2016 New Security Features

#SQLSAT454

Agenda Security Boundaries Always Encrypted Row Level Security Dynamic Data Masking

Page 5: SQL Server 2016 New Security Features

#SQLSAT454

Why New Security Features? SQL Server has plenty security features

TDE Protects database files and backups at rest

Cell-Level Encryption Encrypts single values in database tables

SSL Protects data on the network

Page 6: SQL Server 2016 New Security Features

#SQLSAT454

Security Boundaries – Open

Apps

SSMS

Database

Developer DBA

Manager User

Software VendorUnauthorized

Users

Page 7: SQL Server 2016 New Security Features

#SQLSAT454

Security Boundaries – Non Sensitive

Apps

SSMS

Database

Developer

DBA

Manager User

Software Vendor

Unauthorized Users

Copy

Copy

Page 8: SQL Server 2016 New Security Features

#SQLSAT454

Security Boundaries – Sensitive

Apps

SSMS

Database

Developer

DBA

Manager User

Software Vendor

Unauthorized Users

Copy

Copy

Page 9: SQL Server 2016 New Security Features

#SQLSAT454

ALWAYS ENCRYPTED

Page 10: SQL Server 2016 New Security Features

#SQLSAT454

Always Encrypted – Key FeaturesPrevents Data Disclosure End-to-end encryption of individual columns in a table with keys that are never given to the database system.

Queries on Encrypted DataSupport for equality comparison, incl. join, group by and distinct operators.

Application TransparencyMinimal application changes via server and client library enhancements.

Page 11: SQL Server 2016 New Security Features

#SQLSAT454

Always Encrypted Sensitive data is encrypted at column

level Data is protected from high-privileged

users DBAs System Admins Hackers

Data is stored securely outside security boundaries The database never sees unencrypted data

Cloud providers Third-parties

Page 12: SQL Server 2016 New Security Features

#SQLSAT454

Always Encrypted – How it worksApp

SELECT Name FROM Patients WHERE SSN=@SSN@SSN='198-33-0987'

Column Encryption

Key

Jane Doe

Name1x7fg655se2e

SSNUSA

Country

Jim Gray 0x7ff654ae6d USA

John Smith 0y8fj754ea2c USA

dbo.Patients

Result Set

Jim Gray

Name

Query

Application - Trusted SQL Server - Untrusted

SELECT Name FROM Patients WHERE SSN=@SSN

@SSN=0x7ff654ae6d

EnhancedADO.NET

Library

SQL Server Native Client

.NET 4.6

Column

MasterKey

Page 13: SQL Server 2016 New Security Features

#SQLSAT454

Encryption Types Deterministic Encryption

Same plaintext value Same encrypted valueSupports indexing, equality comparison, JOINs, DISTINCT

Randomized EncryptionSame plaintext value Different encrypted valueSupports retrieval of encrypted dataNo SQL operations supported

Page 14: SQL Server 2016 New Security Features

#SQLSAT454

DEMOWorking with Always Encrypted

Page 15: SQL Server 2016 New Security Features

#SQLSAT454

TDE vs Always EncryptedAlways Encrypted TDEColumn level Database levelClient encryption Server encryptionServer doesn’t know encryption keys

Server knows encryption keys

Data in memory is encrypted

Data in memory is in plaintext

Data travels the network encrypted

Data travels the network in plaintext

Page 16: SQL Server 2016 New Security Features

#SQLSAT454

Custom encryption vs Always EncryptedAlways Encrypted Custom EncryptionSlight application changes

Needs obtrusive changes

Disallows saving plaintext data

Plaintext data can be saved by accident

Allows indexing of cyphertext *

Allows indexing of cyphertext *

* depending on encryption algorithm

Page 17: SQL Server 2016 New Security Features

#SQLSAT454

Always Encrypted - Limitations Deterministic encryption needs _BIN2

collation Not all datatypes supported Partial support for triggers Unsupported features:

Full-text search Replication Change Data Capture In-Memory OLTP Stretch Database

Page 18: SQL Server 2016 New Security Features

#SQLSAT454

What changes for Applications? ConnectionString must include new key:Column Encryption Setting=enabled;

Ad-hoc queries not supportedSELECT SomeColumn FROM SomeTable WHERE EncrypedColumn = 'SomeValue';

Needs correctly parameterized queriesSELECT SomeColumn FROM SomeTable WHERE EncrypedColumn = @param;

Page 19: SQL Server 2016 New Security Features

#SQLSAT454

Always Encrypted for Existing Data Existing columns must be encrypted client

side Easiest way: Import / Export wizard Ad-hoc wizard

In SSMS 2016?

Page 20: SQL Server 2016 New Security Features

#SQLSAT454

Performance Impact

Page 21: SQL Server 2016 New Security Features

#SQLSAT454

Space Usage Impact

Page 22: SQL Server 2016 New Security Features

#SQLSAT454

Q&A

Questions?

Page 23: SQL Server 2016 New Security Features

#SQLSAT454

DYNAMIC DATA MASKING

Page 24: SQL Server 2016 New Security Features

#SQLSAT454

Dynamic Data Masking – Key FeaturesLimits Sensitive Data Exposure Sensitive data is masked.Administrators designate how much of the sensitive data to reveal.

Useful for ComplianceHelps adhering to privacy standards imposed by regulation authorities.

Application TransparencyNo application changes. Existing queries keep working.

Page 25: SQL Server 2016 New Security Features

#SQLSAT454

Dynamic Data Masking

Database

Non-Privileged User

Privileged User

Unmasked Data

DATA

Jane Doe

Name062-56-4651

SSN2.500

Salary

Jim Gray 915-12-9845 2.350

John Smith 354-21-9184 1.500

dbo.Employees062-56-4651SSN

Masked Data

XXX-XX-XXXX

SSN

Page 26: SQL Server 2016 New Security Features

#SQLSAT454

Dynamic Data Masking Obfuscates data using 3 masking functions

Default: depends on data type Email: aXXX.XXXX.com Partial: prefixXXXXXXsuffix

Data is stored unmasked Masking happens on resultset formation

GRANT UNMASK to disclose data

Works in Azure SQL Database (preview)

Page 27: SQL Server 2016 New Security Features

#SQLSAT454

Dynamic Data Masking - Limitations Not all datatypes supported Not intended as a complete protection feature

for sensitive data Ad-Hoc queries disclose data. Ex: WHERE Salary >

2000 INSERT…SELECT does not preserve masking Some quirks

Not suitable for handing out copies of the database to software vendors or third-parties

Page 28: SQL Server 2016 New Security Features

#SQLSAT454

DEMOWorking with Dynamic Data Masking

Page 29: SQL Server 2016 New Security Features

#SQLSAT454

Q&A

Questions?

Page 30: SQL Server 2016 New Security Features

#SQLSAT454

ROW-LEVEL SECURITY

Page 31: SQL Server 2016 New Security Features

#SQLSAT454

Row Level Security – Key FeaturesFine-grained access control In multi-tenant databases, limits access by other users who share the same tables.

Centralized Security LogicPredicate-based access control logic resides inside the database and is schema-bound to the tables it protects.

Application TransparencyNo application changes. Existing queries keep working.

Page 32: SQL Server 2016 New Security Features

#SQLSAT454

Row-Level Security

LATAM Salesperson

EMEA Salesperson

Evil Inc.

NameEMEA

Area2.500

Budget

Wealthy Corp. LATAM 2.350

Greedy Corp. APAC 1.500

dbo.Customer

Manager

APAC Salesperson

Page 33: SQL Server 2016 New Security Features

#SQLSAT454

Row-Level Security - Concepts Predicate function

User-defined inline iTVF implementing access control logic.Can be arbitrarily complicated

Security predicateApplies a predicate function to a particular table (APPLY)Two types: filter predicates and blocking predicates

Security policyCollection of security predicates Manages security across multiple tables

Page 34: SQL Server 2016 New Security Features

#SQLSAT454

Row-Level Security – How it works

EMEA Salesperson

Evil Inc.

NameEMEA

Area2.500

Budget

Wealthy Corp. LATAM 2.350

Greedy Corp. APAC 1.500

dbo.Customer

DBA

Security Policy

SELECT *FROM Customer

SELECT *FROM CustomerAPPLY itvf_securityPredicate()

Page 35: SQL Server 2016 New Security Features

#SQLSAT454

DEMOWorking with Row-Level Security

Page 36: SQL Server 2016 New Security Features

#SQLSAT454

Row-Level Security - Limitations SCHEMABINDING: all tables in the predicate

function must reside in the database Performance impact: queries are rewritten When authenticating the application,

CONTEXT_INFO() can be used to filter on real user

Not really secure if users can run ad-hoc queries

Don’t lock out the DBA!

Page 37: SQL Server 2016 New Security Features

#SQLSAT454

Q&A

Questions?

Page 39: SQL Server 2016 New Security Features

#SQLSAT454

Evaluations Don’t forget to compile evaluations

form here http://speakerscore.com/sqlsat454

Page 40: SQL Server 2016 New Security Features

#SQLSAT454

THANKS!

#sqlsat454


Recommended