Masking, Row Access, Tags, and Lineage
SnowPro Core · Lesson 12 of 27 · 1:20:14
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 SnowPro Core Certification exam (COF-C03). In this lesson: masking and row access policies, tags, classification, privacy policies, lineage and access history, and choosing the right control. Follows Foxglove Apparel, a fictional online clothing retailer. Includes three original practice questions.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Who sees which data
Foxglove's customer table holds names, emails, and addresses, and only the support team should see full emails. Regional managers may see only the orders of their own region, and partners may receive data only as totals. Snowflake governs all of this with policies attached to the data itself.
Masking policies
A masking policy protects a column: this is column-level security, and like the other policies in this lesson, it requires the Enterprise edition. It is a schema-level object, whose conditions decide, at query time, whether the current role sees the real value, or a masked one. Once the policy is attached to a column, it applies wherever that column appears, so a security team can define it once, separately from the data owners. External tokenization is a variant, where data is tokenized before it is loaded, and detokenized at query time for authorized users.
Row access policies
A row access policy decides which rows a role can see, which is row-level security. Its expression returns true or false for each row, often by looking up the current role in a mapping table, such as one that links each manager role to a region. The expression runs with the role of the policy owner, so users do not need access to the mapping table. And when a table has both kinds of policies, Snowflake evaluates the row access policy first, then the masking policies.
Tags and classification
A tag is a schema-level object that you assign to other objects, with a string value, such as a cost center tag set to sales. Tags are inherited down the hierarchy, so a tag set on a table applies to all its columns, and they can also propagate automatically, from source objects to target objects. A masking policy can be assigned to a tag, and every column with that tag is then masked, which is tag-based masking. Sensitive data classification finds the columns that hold personal data, and gives each one a semantic category, such as email, and a privacy category, such as identifier.
Privacy policies
Privacy policies control how data can be queried, especially once it is shared. An aggregation policy forces queries to aggregate rows into groups of a minimum size, so no single record is returned. A projection policy decides whether a column may appear in query results, although the column can still be used in a WHERE clause. And differential privacy adds noise to aggregate results, so consumers learn trends about groups, without identifying any individual.
Lineage and access history
Lineage in Snowsight shows how data flows between objects, and between columns. An object that feeds another one is upstream, and the object it feeds is downstream, so you can trace where a column comes from, and what depends on it. Lineage also helps you work with the tags and masking policies on columns. And the ACCESS_HISTORY view, in the ACCOUNT_USAGE schema, keeps track of the objects and columns that each query read or wrote, including the base tables behind a view.
Choosing the right control
To choose a control, start from what must be protected. Values in a column call for a masking policy, and rows call for a row access policy. Shared data that must stay anonymous calls for aggregation, projection, or differential privacy. And tags with classification help you find sensitive columns, and protect them at scale.
Recap
Let's recap. Masking policies protect columns at query time, and external tokenization replaces data before it is loaded. Row access policies filter rows, often with a mapping table, and they are evaluated before masking. Tags are inherited and can propagate, tag-based masking protects every tagged column, and classification finds sensitive data. Aggregation, projection, and differential privacy policies protect shared data. And lineage shows how data flows, while ACCESS_HISTORY shows who read what.
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.
Foxglove’s regional managers must see only the orders of their own region, in the same orders table, and the list of managers changes every month. What should protect the table?
- A masking policy on the region column
- A secure view for each region
- A row access policy with a mapping table
- A projection policy on the region column
Show the answer
A row access policy with a mapping table
A row access policy filters rows for each role, and a mapping table lets the list change without touching the policy. “A masking policy on the region column” would hide the values of a column, but every row would still be returned. “A secure view for each region” would multiply views to maintain, and the managers would no longer query the same table. And “A projection policy on the region column” only stops a column from appearing in results, so every row would still come back.
Foxglove shares customer purchase data with a partner brand. The partner may compute totals per city, but must never get back an individual customer’s row. Which policy fits?
- A masking policy on the email column
- A row access policy for the partner
- A tag on the customer table
- An aggregation policy with a minimum group
Show the answer
An aggregation policy with a minimum group
An aggregation policy only returns results from groups of a minimum size, so no single customer's row comes back. “A masking policy on the email column” would hide one column, but individual rows would still be returned. “A row access policy for the partner” is wrong, because the rows that it lets through would still be individual rows. And “A tag on the customer table” is wrong, since a tag alone protects nothing, until a policy is attached to it.
Foxglove’s auditors ask which users read the customer emails last month, even through views. Where can the security team find this?
- The lineage graph in Snowsight
- The ACCESS_HISTORY view
- The QUERY_HISTORY view
- The tags on the email column
Show the answer
The ACCESS_HISTORY view
ACCESS_HISTORY keeps track of the columns that each query read, including the base table columns behind a view. “The lineage graph in Snowsight” shows how data flows between objects, not who read it. “The QUERY_HISTORY view” lists queries, but it does not resolve the columns read through a view. And “The tags on the email column” only shows which tags are set on the column.