Securing analytical data
Professional Data Engineer · Lesson 17 of 23 · 2:05:17
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Google Cloud Professional Data Engineer exam, on the official exam guide. In this lesson: access with IAM and authorized views and datasets, column-level security with policy tags and data masking, row access policies, and Sensitive Data Protection discovery, inspection, and de-identification. Includes three original practice questions, with Cymbal Mobility, a fictional ride-hailing and scooter company, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Who sees what
Cymbal Mobility's ride tables hold rider emails, phone numbers, and the city of each trip. City managers should see only their own city, analysts need trends without identities, and the fraud team needs the real emails. The data engineer must give each group exactly what it needs, from the same tables.
IAM and authorized views
Start with IAM, through groups, at the narrowest level that works. Grant BigQuery Data Viewer on a dataset or a table, and BigQuery Job User on the project where queries run. An authorized view shares the results of a query with users, without giving them access to the source dataset. Keep the view in a separate dataset, authorize it on the source dataset, and authorize a whole dataset to share all of its views at once.
Column-level security and masking
Column-level security uses policy tags, organized in a taxonomy, and attached to sensitive columns. Only principals with the Fine-Grained Reader role on a tag can read the raw values, and others get an error, unless they leave the column out of their query. Dynamic data masking adds data policies to the same tags, so users with the Masked Reader role see masked values, instead of an error. Masking rules include a hash, which keeps joins possible, an email mask, the first or last four characters, a year-only date, a null value, and a default value for the type. The mask is applied when the query runs, so the stored data never changes.
Row-level security
Row-level security filters which rows each user can see, in the same table. A row access policy lists the principals that it covers, called the grantee list, and a filter expression that works like a where clause. A user covered by no policy sees no rows at all, so add a policy with a filter that is always true, for the teams that need everything. Combine it with columns: city managers see only their city's rows, while the email column stays masked.
Sensitive Data Protection
Sensitive Data Protection, which now includes Cloud DLP, finds and protects sensitive data. Its discovery service profiles data across the organization continuously, and shows where sensitive data resides, with sensitivity and risk levels. Inspection looks for info types, like email addresses, phone numbers, or card numbers, in tables, files, and free text. De-identification then masks characters, replaces values with tokens, or encrypts them with a key, before the data reaches analysts. Use it in pipelines to clean data before loading, and policy tags to protect what remains in BigQuery.
Recap
Let's recap. Grant IAM roles to groups at the narrowest level, and share query results through authorized views. Policy tags restrict sensitive columns to Fine-Grained Readers. Data masking shows masked values to Masked Readers, with a hash that keeps joins possible. Row access policies filter rows by user, and users covered by no policy see none. And Sensitive Data Protection discovers, inspects, and de-identifies sensitive data, even in free text.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
Analysts must join trips across tables on the rider’s email, but must never see the real addresses, while the fraud team must see them. What should the data engineer configure?
- A view that leaves out the email column
- A policy tag with a hash mask for analysts
- Deleting the email column from the trips table
- A row access policy on the email column
Show the answer
A policy tag with a hash mask for analysts
A hash mask hides the address, but the same email always gives the same value, so joins still work, and the fraud team keeps the Fine-Grained Reader role. “A view that leaves out the email column” would remove the column, so analysts could not join on it. “Deleting the email column from the trips table” would take the emails away from the fraud team too. And “A row access policy on the email column” filters rows, not the values of a column.
Each city manager must see only the trips of their own city, in the same table, and without creating a view for each city. What should the data engineer create?
- A copy of the trips table for each city
- A policy tag on the city column
- Row access policies filtered on the city
- An authorized view for each city
Show the answer
Row access policies filtered on the city
Row access policies filter the rows of one table, by city, for each group of managers. “A copy of the trips table for each city” would create copies that drift apart, and multiply storage. “A policy tag on the city column” would protect the values of the column, not filter the rows. And “An authorized view for each city” is the view for each city that the company wants to avoid.
Support tickets in Cloud Storage contain free text, where customers sometimes type phone numbers and card numbers. The tickets must be loaded for analysis, without these values. What should the data engineer use?
- Sensitive Data Protection de-identification
- A policy tag on the ticket text column
- A row access policy on the tickets table
- Customer-managed encryption keys on the bucket
Show the answer
Sensitive Data Protection de-identification
Sensitive Data Protection finds those info types inside the text, and replaces them before loading. “A policy tag on the ticket text column” would hide the whole text column, and the analysis with it. “A row access policy on the tickets table” filters rows, and leaves the numbers in every visible ticket. And “Customer-managed encryption keys on the bucket” encrypts the stored files, but analysts would still read the numbers.