PostgreSQL 安全管理 数据脱敏 Anonymizer 安全
1 背景知识
对于脱敏规则和真实数据还有脱敏数据需要一套规则进行限制,以防造成数据泄露。
2 权限
下面表格描述了用户权限的事情。
Action | Superuser | Owner | Masked Role |
---|---|---|---|
Create the extension | Yes | ||
Drop the extension | Yes | ||
Init the extension | Yes | ||
Reset the extension | Yes | ||
Configure the extension | Yes | ||
Put a mask upon a role | Yes | ||
Start dynamic masking | Yes | ||
Stop dynamic masking | Yes | ||
Create a table | Yes | Yes | |
Declare a masking rule | Yes | Yes | |
Insert, delete, update a row | Yes | Yes | |
Static Masking | Yes | Yes | |
Select the real data | Yes | Yes | |
Regular Dump | Yes | Yes | |
Anonymous Dump | Yes | Yes | |
Use the masking functions | Yes | Yes | Yes |
Select the masked data | Yes | Yes | Yes |
View the masking rules | Yes | Yes | Yes |
3 为脱敏函数指定信任函数
默认情况下,数据库所有者只能信任模式里面的函数进行脱敏规则的使用。
4 函数的安全调用
此扩展的函数都是使用 SECURITY INVOKER
限制函数只能为调用者的权限。
此扩展还包含 SECURITY DEFINER
以创建者的权限调用。具体可以查看函数调用陷阱攻击。