To control access by classification on Cloudera, classify data in Atlas, let Ranger TagSync carry the tags into the Ranger tag store, and write policies against the tags. A new column that carries a tag picks up its rules without a new policy. Test with real users, then run a review cycle.
How the pieces fit
Cloudera describes tag-based control as separating two jobs: classifying a resource, and authorizing access to it. You tag resources such as Hive tables or HDFS files with labels like PII, PCI or PHI, and the authorization for the tag is enforced automatically, so you do not write a policy for each resource. One tag policy can govern several components, without separate services and policies in each.
| Piece | Job |
|---|---|
| Atlas | Holds classifications and attaches them to databases, tables, views and columns |
| Ranger TagSync | A daemon, similar to UserSync, that receives change notifications from Atlas and updates the tag store |
| Tag store | Ranger Admin keeps tag details in its policy store and serves them to plugins over REST |
| Ranger plugins in Hive and Impala | Cache the tags, poll the store for changes, and evaluate tag policies with the request |
The plugins also keep a local cache file. If the tag store cannot be reached on a restart, they use that file, so a short outage does not strip protection.
Classify with Atlas
Atlas holds classifications such as personal data. You can apply them by hand, by rule or through lineage propagation, where a tag on a source column follows later columns made from it. Cloudera states that no manual step is needed for propagated tags, and the Ranger policies built on them apply to the new location. Prefer rules over manual tagging, because hand-applied tags drift.
Classifications can carry attributes, and Ranger policies can read them. Cloudera's example marks a column as a national ID with an attribute naming the region whose rules apply, such as EU or JPN, and policies then apply different mask patterns by region. Use attributes when one tag needs more than one treatment.
Map tags to policies
Ranger TagSync receives tag details from Atlas through change notifications. The service user it runs as needs read access to classifications, business metadata and labels in Atlas. The tag service in Ranger must be linked to the Hive, Impala and other services you want the tags to govern.
A tag policy then names the tag and the access it grants or denies. The shape below is an illustration of a Ranger tag policy, not an export. Take the real service name and access types from your own cluster.
{
"service": "<tag-service-name>",
"name": "personal-data-analysts-deny",
"policyType": 0,
"resources": { "tag": { "values": ["PII"], "isExcludes": false } },
"denyPolicyItems": [
{ "groups": ["analysts"],
"accesses": [ { "type": "hive:select", "isAllowed": true } ] }
]
}Treat this as a sketch.
Tag policies can also mask. A tag-based masking policy targets columns by their tags and attribute values, so one rule can mask every column tagged as a national ID, wherever it sits. Remember that the usual Ranger evaluation order applies: a matching deny is checked before an allow. See Apache Ranger policy design for the order.
Test
- Tag one column in a test table, wait for TagSync, and confirm the tag appears in Ranger.
- Query as a user in the denied group in each engine, and confirm the denial.
- Create a derived table and confirm the tag propagated and the policy applies.
- Check the Ranger audit shows the denial.
- Remove the tag and confirm access returns after the plugins refresh their cache.
Plugins poll for tag changes, so a new tag is not instant. Build a wait into tests and into your change windows.
When tag policies do not take effect
| Symptom | Likely cause | Check |
|---|---|---|
| Tag never shows in Ranger | TagSync is stopped, or its service user cannot read classifications in Atlas | TagSync health and the Atlas permissions of its user |
| Tag shows but the policy does nothing | The tag service is not linked to the Hive or Impala service | The tag service setting on each resource service |
| New column is not covered | No classification, or propagation did not run | The lineage link and the classification on the new column |
| Group policy fails for some users | Cloudera notes group policies may fail where SSSD gives a group more than one GID | The group mapping; Cloudera suggests adding the Hadoop native library path to the Atlas process |
Operate
| Check | How often | Why |
|---|---|---|
| TagSync running and healthy | Daily | Tags stop flowing if it stops |
| Unclassified tables list | Weekly | Unclassified data falls outside tag policies |
| Policy review | Quarterly | Keep the set small and owned |
| Test queries as each role | After every change | Catch drift early |
Tag-based policies restrict data access, not the metadata shown in a catalog. Cloudera says to control access to the metadata of a tagged asset with a resource-based policy on Atlas, so plan metadata visibility separately. Cloudera also ships a default tag policy for an EXPIRES_ON tag, which can time-limit access using a date attribute. Test the date logic carefully on your release before you rely on it.
Questions we hear
Is a tag policy better than a resource policy? It is better for sensitive data spread over many tables. Resource policies stay simpler for platform areas.
What if the data is not classified yet? Then no tag policy covers it. Keep new areas closed, with no allowing resource policy, until classification catches up.
For the design of the resource side see Apache Ranger policy design, and for a worked example tag-based access control for a bank.




