SlideShare a Scribd company logo
Dynamic data masking sql server 2016
Dynamic Data
Masking
in SQL Server 2016
SQLschool.gr
Team
Antonios Chatzipavlis
SQL Server Evangelist • Trainer
Vassilis Ioannidis
SQL Server Expert • Trainer
Fivi Panopoulou
System Engineer • Speaker
Sotiris Karras
System Engineer • Speaker
Followus
insocialmedia
@sqlschool / @panfivi
fb/sqlschoolgr
yt/c/SqlschoolGr
SQL School Greece group
Helpneeded?
help@sqlschool.gr
DynamicDataMasking
Presentation
Content
 Introducing Dynamic Data Masking
 Using Dynamic Data Masking
 DDM on Azure
 Some points to keep
Introducing Dynamic Data Masking
• Protect sensitive data and personally identifiable
information
• Regulatory Compliance
• Expose sensitive data only on a need-to-know basis
• Custom obfuscation in application, views or third party
solutions are used to address this need
The Need
Dynamic Data Masking in SQL Server 2016
• Built-in feature for SQL Server
2016 and Azure SQL DB
• Data masked on the fly when
queried, underlying data do
not change
• Control on how the data
appear in the result set
 Dynamic data masking is a data protection feature that
masks the sensitive data in the result set of a query over
chosen database fields
• Protects against unauthorized disclosure of sensitive
data in the application
• Very simple to configure and use
• Does not require changes in application code
• Centralized masking logic
Benefits
• “Dynamic data masking does not aim to prevent
database users from connecting directly to the database
and running exhaustive queries that expose pieces of
the sensitive data”
• It is not a method for physical data encryption
• It is complementary to other SQL Server security
features
Keep in mind
Using Dynamic Data Masking
 Steps
 Masking Functions
 Permissions
 System view information
Dynamic data masking sql server 2016
• Decide which columns need to be masked
• Choose the masking function that best fits your needs
for each column
• Alter columns to add the masking rules
• The underlying data is unaffected
• Designate which users should see masked data and
configure the permissions.
Steps
Default
Masking Functions
Data Type Family Masked Data
String XXXX
Numeric 0
Date and Time 01.01.1900 00:00:00.0000000
Binary 0
ALTER COLUMN ColumnName
ADD MASKED WITH (FUNCTION = 'default()')
Full masking according to the data types of the designated
fields.
Email
Masking Functions
ALTER COLUMN ColumnName
ADD MASKED WITH (FUNCTION = ‘email()')
Exposes the first letter of an email address and the constant
suffix ".com", in the form of an email address.
aXXX@XXXX.com
Random
Masking Functions
ALTER COLUMN ColumnName
ADD MASKED WITH (FUNCTION = 'random([start range], [end range])')
A random masking function for use on any numeric type to
mask the original value with a random value within a
specified range.
Custom String (Partial)
Masking Functions
ALTER COLUMN ColumnName
ADD MASKED WITH (FUNCTION = ‘partial(prefix,[padding],suffix)’
Exposes the first and last letters and adds a custom padding
string in the middle
• Phone: partial(4,”XXXXXXXXXXX”,0)
• Credit Card: partial(0,”XXXX-XXXX-XXXX-”,4)
• Email: partial(1,”xxxx@xxxx.”,2)
• To retrieve the original data the user must have the
UNMASK permission
• To add, replace, remove masking of existing columns
ALTER ANY MASK permission
• The CONTROL permission on the database includes
both the ALTER ANY MASK and UNMASK permission
! Users without UNMASK but with UPDATE permission can
still update data.
Permissions
system view to query for table-columns that have a
dynamic data masking function applied to them
• Simlar to sys.columns view
• is_masked
• masking_function
sys.masked_columns
Dynamic Data Masking in
Action
DDM on Azure
Azure
Set up DDM using Azure Portal
• Define users excluded from
masking
• Define Masking rules
• Designated fields and masking
functions for each one
There is a recommendations engine that
proposes potentially sensitive fields to
mask
Azure
Default Full Masking according to the
datatypes
Credit card XXXX-XXXX-XXXX-1234
Social Security
number
XXX-XX-1234
Email aXX@XXXX.com
Random Number Random number between selected
boundaries
Custom Text Prefix, Padding String, Suffix
Some points to keep
 Limitations and Restrictions
 Considerations
 Performance
• Not compatible with Always Encrypted columns
• Not compatible with File Stream
• Not compatible with Column set
• A column with data masking cannot be a key for a
FULLTEXT index.
• Masking rule cannot be defined on a computed column
Limitations and Restrictions
• Dynamic Data Masking is applied when running SQL
Server Import and Export
• Dynamic Data Masking is applied when using SELECT
INTO or INSERT INTO to copy data from a masked
column
• Be careful with updates
Considerations
Minimal Performance Impact
Data masking is performed right before the data is
returned.
Performance
SELECT *
FROM Person.EmailAddress;
Dynamic data masking sql server 2016
Dynamic data masking sql server 2016
S E L E C T K N O W L E D G E F R O M S Q L S E R V E R
Copyright © 2015 SQLschool.gr. All right reserved.
PRESENTER MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION

More Related Content

PPTX
Azure Data Explorer deep dive - review 04.2020
PDF
DP-300 Administering Relational Databases Azure_Oct2020
PPT
Database performance tuning and query optimization
PDF
Performance tuning in sql server
PDF
ETL Using Informatica Power Center
PPTX
Slowly changing dimension
PPTX
Gobernanza de datos - Azure Purview
PDF
DataMinds 2022 Azure Purview Erwin de Kreuk
Azure Data Explorer deep dive - review 04.2020
DP-300 Administering Relational Databases Azure_Oct2020
Database performance tuning and query optimization
Performance tuning in sql server
ETL Using Informatica Power Center
Slowly changing dimension
Gobernanza de datos - Azure Purview
DataMinds 2022 Azure Purview Erwin de Kreuk

What's hot (20)

PPTX
Row-level security and Dynamic Data Masking
PPTX
Oracle Data Redaction
PDF
Practical Enterprise Security Architecture
PDF
Enterprise Architecture vs. Data Architecture
PDF
Overview of Data Loss Prevention Policies in Office 365
PPTX
Chapter 6: Data Operations Management
PPT
DB security
PPTX
Breakdown of Microsoft Purview Solutions
PPT
Semantic search
PDF
Sigma and YARA Rules
PDF
The Importance of Metadata
PPTX
Enterprise Security Architecture Design
PPTX
How to Build & Sustain a Data Governance Operating Model
PPTX
Data Governance for Enterprises
PDF
Threat Hunting with Cyber Kill Chain
PDF
Enterprise Security Architecture for Cyber Security
PDF
Best Practices in Metadata Management
PDF
Data Architecture - The Foundation for Enterprise Architecture and Governance
PPTX
Azure conditional access
PDF
Data Warehouse or Data Lake, Which Do I Choose?
Row-level security and Dynamic Data Masking
Oracle Data Redaction
Practical Enterprise Security Architecture
Enterprise Architecture vs. Data Architecture
Overview of Data Loss Prevention Policies in Office 365
Chapter 6: Data Operations Management
DB security
Breakdown of Microsoft Purview Solutions
Semantic search
Sigma and YARA Rules
The Importance of Metadata
Enterprise Security Architecture Design
How to Build & Sustain a Data Governance Operating Model
Data Governance for Enterprises
Threat Hunting with Cyber Kill Chain
Enterprise Security Architecture for Cyber Security
Best Practices in Metadata Management
Data Architecture - The Foundation for Enterprise Architecture and Governance
Azure conditional access
Data Warehouse or Data Lake, Which Do I Choose?
Ad

Viewers also liked (10)

PDF
Row level security
PDF
Introduction to Azure Data Lake
PDF
Exploring sql server 2016
PDF
Live Query Statistics & Query Store in SQL Server 2016
PDF
Microsoft SQL Family and GDPR
PDF
Introduction to azure document db
PDF
Introduction to sql database on azure
PDF
Exploring sql server 2016 bi
PDF
Introduction to Machine Learning on Azure
PDF
Azure SQL Data Warehouse
Row level security
Introduction to Azure Data Lake
Exploring sql server 2016
Live Query Statistics & Query Store in SQL Server 2016
Microsoft SQL Family and GDPR
Introduction to azure document db
Introduction to sql database on azure
Exploring sql server 2016 bi
Introduction to Machine Learning on Azure
Azure SQL Data Warehouse
Ad

Similar to Dynamic data masking sql server 2016 (20)

PPTX
Keeping Private Data Private
PPTX
A Designer's Favourite Security and Privacy Features in SQL Server and Azure ...
PPTX
Designer's Favorite New Features in SQLServer
PPT
SQL Server 2016 Security Features
PPTX
"Test Data Management In a Nutshell" by Satyajit Singh
PDF
Data masking a developer's guide
PPTX
Snowflake Data Access.pptx
PPTX
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
PDF
Oracle Data Masking
PPTX
Karen's Favourite Features of SQL Server 2016
PDF
Data masking techniques for Insurance
PPTX
Securing SQL Azure DB? How?
PPTX
MySQL Enterprise Data Masking
PPTX
DevTalks.ro 2019 MySQL Data Masking Talk
PPTX
Securing SQL Azure DB? How?
PPTX
SQL Server 2016 New Security Features
PPTX
Masking and Encryption Considerations.pptx
PDF
Opteamix_whitepaper_Data Masking Strategy.pdf
PDF
Data goverance two_8.2.18 - copy
PPTX
Seguridad en sql server 2016 y 2017
Keeping Private Data Private
A Designer's Favourite Security and Privacy Features in SQL Server and Azure ...
Designer's Favorite New Features in SQLServer
SQL Server 2016 Security Features
"Test Data Management In a Nutshell" by Satyajit Singh
Data masking a developer's guide
Snowflake Data Access.pptx
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
Oracle Data Masking
Karen's Favourite Features of SQL Server 2016
Data masking techniques for Insurance
Securing SQL Azure DB? How?
MySQL Enterprise Data Masking
DevTalks.ro 2019 MySQL Data Masking Talk
Securing SQL Azure DB? How?
SQL Server 2016 New Security Features
Masking and Encryption Considerations.pptx
Opteamix_whitepaper_Data Masking Strategy.pdf
Data goverance two_8.2.18 - copy
Seguridad en sql server 2016 y 2017

More from Antonios Chatzipavlis (20)

PPTX
Data virtualization using polybase
PDF
SQL server Backup Restore Revealed
PDF
Migrate SQL Workloads to Azure
PDF
Machine Learning in SQL Server 2019
PDF
Workload Management in SQL Server 2019
PDF
Loading Data into Azure SQL DW (Synapse Analytics)
PDF
Introduction to DAX Language
PDF
Building diagnostic queries using DMVs and DMFs
PDF
Exploring T-SQL Anti-Patterns
PDF
Designing a modern data warehouse in azure
PDF
Modernizing your database with SQL Server 2019
PDF
Designing a modern data warehouse in azure
PDF
SQLServer Database Structures
PDF
Sqlschool 2017 recap - 2018 plans
PDF
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
PDF
Statistics and Indexes Internals
PDF
Implementing Mobile Reports in SQL Sserver 2016 Reporting Services
PDF
Auditing Data Access in SQL Server
PDF
Stretch db sql server 2016 (sn0028)
PDF
Troubleshooting sql server
Data virtualization using polybase
SQL server Backup Restore Revealed
Migrate SQL Workloads to Azure
Machine Learning in SQL Server 2019
Workload Management in SQL Server 2019
Loading Data into Azure SQL DW (Synapse Analytics)
Introduction to DAX Language
Building diagnostic queries using DMVs and DMFs
Exploring T-SQL Anti-Patterns
Designing a modern data warehouse in azure
Modernizing your database with SQL Server 2019
Designing a modern data warehouse in azure
SQLServer Database Structures
Sqlschool 2017 recap - 2018 plans
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Statistics and Indexes Internals
Implementing Mobile Reports in SQL Sserver 2016 Reporting Services
Auditing Data Access in SQL Server
Stretch db sql server 2016 (sn0028)
Troubleshooting sql server

Recently uploaded (20)

PDF
[EN] Industrial Machine Downtime Prediction
PPTX
Introduction to Knowledge Engineering Part 1
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PPT
Quality review (1)_presentation of this 21
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PPTX
Market Analysis -202507- Wind-Solar+Hybrid+Street+Lights+for+the+North+Amer...
PPTX
Computer network topology notes for revision
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
SAP 2 completion done . PRESENTATION.pptx
PDF
Mega Projects Data Mega Projects Data
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PDF
annual-report-2024-2025 original latest.
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
[EN] Industrial Machine Downtime Prediction
Introduction to Knowledge Engineering Part 1
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Quality review (1)_presentation of this 21
Data_Analytics_and_PowerBI_Presentation.pptx
oil_refinery_comprehensive_20250804084928 (1).pptx
Market Analysis -202507- Wind-Solar+Hybrid+Street+Lights+for+the+North+Amer...
Computer network topology notes for revision
Acceptance and paychological effects of mandatory extra coach I classes.pptx
SAP 2 completion done . PRESENTATION.pptx
Mega Projects Data Mega Projects Data
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
STUDY DESIGN details- Lt Col Maksud (21).pptx
annual-report-2024-2025 original latest.
IBA_Chapter_11_Slides_Final_Accessible.pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb

Dynamic data masking sql server 2016

  • 3. SQLschool.gr Team Antonios Chatzipavlis SQL Server Evangelist • Trainer Vassilis Ioannidis SQL Server Expert • Trainer Fivi Panopoulou System Engineer • Speaker Sotiris Karras System Engineer • Speaker
  • 7. Presentation Content  Introducing Dynamic Data Masking  Using Dynamic Data Masking  DDM on Azure  Some points to keep
  • 9. • Protect sensitive data and personally identifiable information • Regulatory Compliance • Expose sensitive data only on a need-to-know basis • Custom obfuscation in application, views or third party solutions are used to address this need The Need
  • 10. Dynamic Data Masking in SQL Server 2016 • Built-in feature for SQL Server 2016 and Azure SQL DB • Data masked on the fly when queried, underlying data do not change • Control on how the data appear in the result set  Dynamic data masking is a data protection feature that masks the sensitive data in the result set of a query over chosen database fields
  • 11. • Protects against unauthorized disclosure of sensitive data in the application • Very simple to configure and use • Does not require changes in application code • Centralized masking logic Benefits
  • 12. • “Dynamic data masking does not aim to prevent database users from connecting directly to the database and running exhaustive queries that expose pieces of the sensitive data” • It is not a method for physical data encryption • It is complementary to other SQL Server security features Keep in mind
  • 13. Using Dynamic Data Masking  Steps  Masking Functions  Permissions  System view information
  • 15. • Decide which columns need to be masked • Choose the masking function that best fits your needs for each column • Alter columns to add the masking rules • The underlying data is unaffected • Designate which users should see masked data and configure the permissions. Steps
  • 16. Default Masking Functions Data Type Family Masked Data String XXXX Numeric 0 Date and Time 01.01.1900 00:00:00.0000000 Binary 0 ALTER COLUMN ColumnName ADD MASKED WITH (FUNCTION = 'default()') Full masking according to the data types of the designated fields.
  • 17. Email Masking Functions ALTER COLUMN ColumnName ADD MASKED WITH (FUNCTION = ‘email()') Exposes the first letter of an email address and the constant suffix ".com", in the form of an email address. aXXX@XXXX.com
  • 18. Random Masking Functions ALTER COLUMN ColumnName ADD MASKED WITH (FUNCTION = 'random([start range], [end range])') A random masking function for use on any numeric type to mask the original value with a random value within a specified range.
  • 19. Custom String (Partial) Masking Functions ALTER COLUMN ColumnName ADD MASKED WITH (FUNCTION = ‘partial(prefix,[padding],suffix)’ Exposes the first and last letters and adds a custom padding string in the middle • Phone: partial(4,”XXXXXXXXXXX”,0) • Credit Card: partial(0,”XXXX-XXXX-XXXX-”,4) • Email: partial(1,”xxxx@xxxx.”,2)
  • 20. • To retrieve the original data the user must have the UNMASK permission • To add, replace, remove masking of existing columns ALTER ANY MASK permission • The CONTROL permission on the database includes both the ALTER ANY MASK and UNMASK permission ! Users without UNMASK but with UPDATE permission can still update data. Permissions
  • 21. system view to query for table-columns that have a dynamic data masking function applied to them • Simlar to sys.columns view • is_masked • masking_function sys.masked_columns
  • 22. Dynamic Data Masking in Action
  • 24. Azure Set up DDM using Azure Portal • Define users excluded from masking • Define Masking rules • Designated fields and masking functions for each one There is a recommendations engine that proposes potentially sensitive fields to mask
  • 25. Azure Default Full Masking according to the datatypes Credit card XXXX-XXXX-XXXX-1234 Social Security number XXX-XX-1234 Email aXX@XXXX.com Random Number Random number between selected boundaries Custom Text Prefix, Padding String, Suffix
  • 26. Some points to keep  Limitations and Restrictions  Considerations  Performance
  • 27. • Not compatible with Always Encrypted columns • Not compatible with File Stream • Not compatible with Column set • A column with data masking cannot be a key for a FULLTEXT index. • Masking rule cannot be defined on a computed column Limitations and Restrictions
  • 28. • Dynamic Data Masking is applied when running SQL Server Import and Export • Dynamic Data Masking is applied when using SELECT INTO or INSERT INTO to copy data from a masked column • Be careful with updates Considerations
  • 29. Minimal Performance Impact Data masking is performed right before the data is returned. Performance SELECT * FROM Person.EmailAddress;
  • 32. S E L E C T K N O W L E D G E F R O M S Q L S E R V E R Copyright © 2015 SQLschool.gr. All right reserved. PRESENTER MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION