Skip to content

Commit bab08ed

Browse files
author
Jill Grant
authored
Merge pull request #252142 from WilliamDAssafMSFT/20230919-cls-refresh
20230919 edit pass refresh
2 parents 934f23b + bd9bbde commit bab08ed

File tree

1 file changed

+29
-17
lines changed

1 file changed

+29
-17
lines changed
Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
---
2-
title: Column-level security for dedicated SQL pool
2+
title: Column-level security for dedicated SQL pool
33
description: Column-Level Security allows customers to control access to database table columns based on the user's execution context or group membership, simplifying the design and coding of security in your application, and allowing you to implement restrictions on column access.
44
author: WilliamDAssafMSFT
5+
ms.author: wiassaf
56
manager: craigg
7+
ms.date: 09/19/2023
68
ms.service: synapse-analytics
9+
ms.subservice: sql-dw
710
ms.topic: conceptual
8-
ms.subservice: sql-dw
9-
ms.date: 04/19/2020
10-
ms.author: wiassaf
11-
ms.custom: seo-lt-2019
1211
tags: azure-synapse
1312
---
1413
# Column-level security
1514

1615
Column-Level security allows customers to control access to table columns based on the user's execution context or group membership.
1716

18-
> [!VIDEO https://www.youtube.com/embed/OU_ESg0g8r8]
19-
Since this video was posted [Row level Security](/sql/relational-databases/security/row-level-security?toc=/azure/synapse-analytics/sql-data-warehouse/toc.json&bc=/azure/synapse-analytics/sql-data-warehouse/breadcrumb/toc.json&view=azure-sqldw-latest&preserve-view=true) became available for dedicated SQL pool in Azure Synapse.
20-
2117
Column-level security simplifies the design and coding of security in your application, allowing you to restrict column access to protect sensitive data. For example, ensuring that specific users can access only certain columns of a table pertinent to their department. The access restriction logic is located in the database tier rather than away from the data in another application tier. The database applies the access restrictions every time data access is attempted from any tier. This restriction makes your security more reliable and robust by reducing the surface area of your overall security system. In addition, column-level security also eliminates the need for introducing views to filter out columns for imposing access restrictions on the users.
2218

23-
You can implement column-level security with the [GRANT](/sql/t-sql/statements/grant-transact-sql?toc=/azure/synapse-analytics/sql-data-warehouse/toc.json&bc=/azure/synapse-analytics/sql-data-warehouse/breadcrumb/toc.json&view=azure-sqldw-latest&preserve-view=true) T-SQL statement. With this mechanism, both SQL and Azure Active Directory (Azure AD) authentication are supported.
19+
You can implement column-level security with the [GRANT Object Permissions](/sql/t-sql/statements/grant-object-permissions-transact-sql?toc=/azure/synapse-analytics/sql-data-warehouse/toc.json&bc=/azure/synapse-analytics/sql-data-warehouse/breadcrumb/toc.json&view=azure-sqldw-latest&preserve-view=true) T-SQL syntax. With this mechanism, both SQL authentication and Microsoft Entra ID ([formerly Azure Active Directory](/azure/active-directory/fundamentals/new-name)) authentication are supported.
20+
21+
Consider also the ability to enforce [Row level security](/sql/relational-databases/security/row-level-security?toc=/azure/synapse-analytics/sql-data-warehouse/toc.json&bc=/azure/synapse-analytics/sql-data-warehouse/breadcrumb/toc.json&view=azure-sqldw-latest&preserve-view=true) on tables, based on a `WHERE` clause filter.
2422

25-
![Diagram shows a schematic table with the first column headed by a closed padlock and its cells an orange color while the other columns are white cells.](./media/column-level-security/cls.png)
23+
:::image type="content" source="./media/column-level-security/cls.png" alt-text="Diagram shows a schematic table with the first column headed by a closed padlock and its cells an orange color while the other columns are white cells.":::
2624

2725
## Syntax
2826

27+
The syntax of the `GRANT` statement for object permissions allows for granting permissions to comma-delimited column lists on a table.
28+
2929
```syntaxsql
3030
GRANT <permission> [ ,...n ] ON
3131
[ OBJECT :: ][ schema_name ]. object_name [ ( column [ ,...n ] ) ]
@@ -42,11 +42,11 @@ GRANT <permission> [ ,...n ] ON
4242
| Database_user_mapped_to_Windows_Group
4343
```
4444

45-
## Example
45+
## Examples
4646

4747
The following example shows how to restrict `TestUser` from accessing the `SSN` column of the `Membership` table:
4848

49-
Create `Membership` table with SSN column used to store social security numbers:
49+
Create `Membership` table with `SSN` column used to store social security numbers:
5050

5151
```sql
5252
CREATE TABLE Membership
@@ -58,24 +58,36 @@ CREATE TABLE Membership
5858
Email varchar(100) NULL);
5959
```
6060

61-
Allow `TestUser` to access all columns except for the SSN column, which has the sensitive data:
61+
Allow `TestUser` to access all columns *except* for the `SSN` column, which has the sensitive data:
6262

6363
```sql
6464
GRANT SELECT ON Membership(MemberID, FirstName, LastName, Phone, Email) TO TestUser;
6565
```
6666

67-
Queries executed as `TestUser` will fail if they include the SSN column:
67+
Queries executed as `TestUser` fail if they include the `SSN` column:
6868

6969
```sql
7070
SELECT * FROM Membership;
71+
```
7172

72-
-- Msg 230, Level 14, State 1, Line 12
73-
-- The SELECT permission was denied on the column 'SSN' of the object 'Membership', database 'CLS_TestDW', schema 'dbo'.
73+
With the resulting error:
74+
75+
```output
76+
Msg 230, Level 14, State 1, Line 12
77+
The SELECT permission was denied on the column 'SSN' of the object 'Membership', database 'CLS_TestDW', schema 'dbo'.
7478
```
7579

76-
## Use Cases
80+
## Use cases
7781

7882
Some examples of how column-level security is being used today:
7983

8084
- A financial services firm allows only account managers to have access to customer social security numbers (SSN), phone numbers, and other personal data.
8185
- A health care provider allows only doctors and nurses to have access to sensitive medical records while preventing members of the billing department from viewing this data.
86+
87+
## Next steps
88+
89+
- [GRANT Object Permissions (Transact-SQL)](/sql/t-sql/statements/grant-object-permissions-transact-sql?toc=/azure/synapse-analytics/sql-data-warehouse/toc.json&bc=/azure/synapse-analytics/sql-data-warehouse/breadcrumb/toc.json&view=azure-sqldw-latest&preserve-view=true)
90+
- [Row level security](/sql/relational-databases/security/row-level-security?toc=/azure/synapse-analytics/sql-data-warehouse/toc.json&bc=/azure/synapse-analytics/sql-data-warehouse/breadcrumb/toc.json&view=azure-sqldw-latest&preserve-view=true)
91+
- [Dynamic Data Masking](/sql/relational-databases/security/dynamic-data-masking?view=azure-sqldw-latest&preserve-view=true)
92+
- [Encrypt a Column of Data](/sql/relational-databases/security/encryption/encrypt-a-column-of-data?view=azure-sqldw-latest&preserve-view=true)
93+
- [Permissions (Database Engine)](/sql/relational-databases/security/permissions-database-engine?view=azure-sqldw-latest&preserve-view=true)

0 commit comments

Comments
 (0)