Professional Documents
Culture Documents
Knowledge Transfer Data Redaction On EnterpriseDB
Knowledge Transfer Data Redaction On EnterpriseDB
060/IRD-ITGI/V/20
Agenda
● Introduction
● Highlight Data Direction
● Step-by-step walkthrough
Introduction
Creating a Data Redaction Capability to Meet GDPR Requirements Using EDB
Postgres to demonstrate data redaction on EDB Postgres Advanced Server 10, which
has taken the approach to leverage the PostgreSQL search_path feature to direct
privileged users to the raw unredacted data when they run a query, and to direct
non-privileged users to a view that implements redaction logic.
Highlight Data Direction
1. A sample data set with employee IDs, names, social security numbers, salary etc. is
created in the table ‘employees’ in the mycompany database.
2. A library of redaction functions for SSN, and salaries apply data type specific
redaction techniques.
3. A data redaction policy for ssn and salary column will be applied whenever user
other than ‘privileged user’ tries to access the ‘employees’ table data
Step-by-step
mycompany=#
Step-by-step
4. Add sample data
5. Create privileged and non-privileged user and grant the necessary access.
8. Create data redaction policy on employee table to redact column data when current session user is not
'privilegeduser'. ADD COLUMN … USING syntax adds a column of the table to the data redaction policy and
specifies a redaction function expression to mask that column data.
CREATE REDACTION POLICY emp_data_protect ON employees FOR (session_user <>
'privilegeduser')
ADD COLUMN ssn USING redact_ssn(ssn),
ADD COLUMN salary USING redact_salary(salary);
9. User can add more columns to this policy using the ALTER REDACTION POLICY command like this:
8. Create data redaction policy on employee table to redact column data when current session user is not
'privilegeduser'. ADD COLUMN … USING syntax adds a column of the table to the data redaction policy and
specifies a redaction function expression to mask that column data.
CREATE REDACTION POLICY emp_data_protect ON employees FOR (session_user <>
'privilegeduser')
ADD COLUMN ssn USING redact_ssn(ssn),
ADD COLUMN salary USING redact_salary(salary);
9. User can add more columns to this policy using the ALTER REDACTION POLICY command like this:
mycompany=# \d employees
Table "public.employees"
Column | Type | Collation | Nullable | Default
--------+-----------------------+-----------+----------+---------------------------
-------
id | integer | | not null | generated by default as
identity
name | character varying(40) | | not null |
ssn | character varying(11) | | not null |
salary | money | | |
Indexes:
"employees_pkey" PRIMARY KEY, btree (id)
Redaction Policies:
REDACTION POLICY "emp_data_protect" FOR (SESSION_USER <>
'privilegeduser'::name) ENABLED
Number of redacted columns: 2 (Use \d+ to list them.)
Step-by-step
By default table owner and super user can see unreacted data.
When a user other than privilegeduser tries to access the employee table will see redacted data for
ssn and salary column.
Connect to table owner and alter the redaction option for SSN column