简体   繁体   English

如何动态屏蔽通过 Azure 保存为 json 的数据?

[英]How do you dynamically mask data that saved as json via Azure?

I'm trying to mask sensitive data via an Azure SQL database.我正在尝试通过 Azure SQL 数据库屏蔽敏感数据。 The data is saved as normal text and one column as XML and another saved as json.数据保存为普通文本,一列为 XML,另一列为 json。 I've tried adding rules to the database but when I open SSMS and run a select statement it does not apply to any of the data in the columns (normal text, xml or json saved data)我尝试向数据库添加规则,但是当我打开 SSMS 并运行 select 语句时,它不适用于列中的任何数据(普通文本、xml 或 Z466DEEC76ECDF5FCA6D38571F6324 保存的数据)

There's no user excluded to see unmasked data.没有排除用户查看未屏蔽数据。 Just want to understand why the data is not masked when I perform a select on SSMS.只是想了解为什么当我在 SSMS 上执行 select 时数据没有被屏蔽。

My rules look like the below:我的规则如下所示:

XML Rule XML 规则

XML 规则

JSON Rule: JSON 规则:

json规则

Text Rule:文字规则:

文字规则

My SQL statment:我的 SQL 声明:

SELECT TOP (1000) * from database_Name SELECT TOP (1000) * 来自 database_Name

As mentioned in Microsoft Document it says,正如微软文档中提到的那样,它说,

The identities in Azure Active Directory (Azure AD) or SQL are included in the masking process and should have access to the unmasked sensitive data. Azure Active Directory (Azure AD) 或 SQL 中的身份包含在屏蔽过程中,并且应该可以访问未屏蔽的敏感数据。

Maybe you are accessing data as SQL admin or Azure AD user because of that you can see sensitive data.也许您正在以SQL adminAzure AD user身份访问数据,因为您可以看到敏感数据。

By hiding important information from unwanted users at multiple layers of the database, you may prevent access and gain control.通过在数据库的多个层向不需要的用户隐藏重要信息,您可能会阻止访问并获得控制权。 You may give or remove UNMASK permission to a user.您可以授予或删除用户的 UNMASK 权限。

The code taken from Microsoft-documentation it says,代码取自微软文档,它说,

Give UNMASK permission to user向用户授予 UNMASK 权限


GRANT UNMASK ON Data.Membership TO USER;

To Query the data under the context of user查询用户上下文下的数据


EXECUTE AS USER='USER';

To revoke UNMASK permissions撤销 UNMASK 权限


REVOKE UNMASK ON Data.Membership FROM USER;

Data after granting permission to user授予用户权限后的数据

在此处输入图像描述

Data after removing permission from user删除用户权限后的数据

在此处输入图像描述

Taken Reference from:参考自:

SQL Database dynamic data masking with the Azure portal SQL 数据库动态数据屏蔽与 Azure 门户

Granting and Revoking the Permission 授予和撤销权限

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM