Duczer East
Healthcare

In-perimeter AI on governed clinical and operational data.

Financial Services

Private AI and data platforms built to clear model-risk and audit review.

Financial services

Private AI, KYC/AML, API gateways and data governance for banks.

Insurance

Change data capture, governed agents and integration for insurers.

Healthcare

PHI document intelligence, FHIR APIs and in-perimeter AI for health systems and plans.

GuideCloudera / Data Services & AI7 min read

Apache Ranger policy design: resource policies, tag policies and a review process

A small set of policies you can explain to an examiner

Authored byCo-Founder and Managing Partner, Duczer East
Part of the Insights topic: Private AI & Data Architecture
On this page
  1. The policy model
  2. How Ranger decides: evaluation order
  3. Resource policies versus tag policies
  4. Security zones for separate owners
  5. Row and column controls
  6. A review process
  7. Smells that mean the set needs cleaning
  8. Questions we hear
  9. A first engagement

Good Ranger design is a small set of policies, each with an owner, written by role and by classification rather than by individual. Use resource policies to start, tag-based policies once classification exists, and row and column controls where the engine enforces them. Review the set on a schedule so it stays explainable.

The policy model

Ranger authorizes access to resources in each service, for example Hive tables, Impala tables, HDFS paths or Ozone buckets. A policy lists the resource, who may do what, and conditions. Cloudera lists four access conditions: Allow, Exclude from Allow, Deny and Exclude from Deny. Deny policies and exceptions exist, but every one is a rule you must later explain.

How Ranger decides: evaluation order

Knowing the order stops most policy arguments. The Apache Ranger design notes set it out like this:

  1. Deny conditions are checked first. If a request matches a deny and none of that policy's deny-excludes, access is denied.
  2. A matching deny-exclude lets the request move on to the next deny condition.
  3. If nothing denied it, allow conditions are checked. A match with no matching allow-exclude grants access.
  4. If no allow matches, the result is undetermined. Most components then deny. HDFS and YARN fall back to their own native ACLs instead.

Cloudera's pages state the same default: with no allowing policy, the request is typically denied. The practical rule is that a deny always beats an allow, so use a deny only when you mean it to be final, and use an exclude when one person is the exception.

Resource policies versus tag policies

QuestionResource policyTag policy
Written againstA named database, table or columnA classification such as personal data
New dataNeeds a new policy or a wildcardCovered once the data carries the tag
Best forPlatform areas and teamsSensitive data across many tables
RiskWildcards grow too broadUnclassified data is not covered
What it controlsData access, and metadata when written on AtlasData access only, not the metadata shown in a catalog

Start with resource policies for platform areas, and add tag policies when Atlas classification is in place. The Atlas-to-Ranger pattern shows how.

Security zones for separate owners

When different teams own different data, a security zone lets each manage its own policies. Cloudera describes a zone as a set of resources, such as a Hive database and some HDFS paths, whose policies only apply inside the zone. When a request arrives, Ranger works out which zone holds the resource, and only that zone's policies apply. A resource that matches no zone falls to the default zone.

  • Only users with the ROLE_SYS_ADMIN role create, change or delete zones.
  • Zone administrators manage policies for their zone only, and zone auditors can read but not change them.
  • A resource cannot belong to more than one zone, and Ranger rejects zones that overlap.

Zones suit a bank with a finance and a markets team on one cluster. They add a layer to explain, so do not create them for a single team.

Row and column controls

Ranger can mask a column or filter rows for the engines that enforce those policies. Use masking for fields that analysts need in shape but not in value, and row filters for data that belongs to one region or business unit. Cloudera documents these mask types for Hive:

MaskResult
RedactLetters become x and digits become n
Partial, last 4 or first 4Only those characters show
HashThe whole value becomes a hash
NullifyThe value becomes NULL
Date, year onlyMonth and day are set to 01/01
CustomAny Hive function that returns the column's type

Four rules from the Cloudera pages shape the design:

  • Each column needs its own masking policy, and wildcards are not supported there.
  • Masking conditions are evaluated top to bottom in the order listed.
  • An audit entry is written each time a mask applies.
  • Cloudera warns that users with ALTER permission on a table can override row-filter and masking policies. Keep ALTER tight on protected tables.

Cloudera also notes that when a row filter or mask applies to a user on a table, insert, update, delete and export are denied for that user on it. Plan the write path for those tables. Test each rule with a real user in each engine, because the engines that reach the data may differ in what they enforce. For example, the Iceberg REST catalog path does not support masking or row filtering, as covered in the REST catalog guide.

A review process

  1. Name an owner for every policy and record it in the description.
  2. Use groups that map to roles, not to individuals.
  3. Review policies every quarter: remove unused, merge overlapping, narrow broad ones.
  4. Export the policy set and keep the history as audit evidence.
  5. Test a sample of users after each change.

Smells that mean the set needs cleaning

SmellWhy it hurtsFix
Policies named after peopleNobody can tell why a rule exists once the person movesMove to role groups
Many deny policies with excludesThe outcome depends on evaluation order, which few people hold in their headReplace with narrower allows
Wildcards on a whole databaseNew tables get access nobody approvedName the tables or use a tag
No owner in the descriptionNo one answers the audit questionAdd an owner and a review date
A tag policy with no unclassified-data checkUntagged data is not coveredList unclassified tables weekly

Questions we hear

Do deny policies override allow policies? Yes. Deny conditions are checked first, and a matching deny ends the check unless a deny-exclude applies.

Should we use zones or just groups? Start with groups. Add zones when separate teams must administer their own policies.

Policy design is one part of governance. The wider operating model, catalog and quality rules are on our data governance consulting page, and the Cloudera view is on Ranger and Atlas on Cloudera.

A first engagement

Duczer East offers a policy review: we export your policy set, map it against the checks above, test a sample of users in each engine and hand back a short list of fixes with owners.

Related: Impala and Hive authorization with Ranger

Frequently asked questions

What are Ranger resource-based policies?

Policies written against a named resource, such as a database, table or column, that say which users and groups can do what.

What are Ranger tag-based policies?

Policies written against a classification such as personal data. Anything carrying the tag falls under the policy, even data classified later.

Does Ranger support row and column controls?

Yes. Ranger supports column masking and row-level filtering for engines that enforce them, such as Hive and Impala. Cloudera notes they are not supported on the Iceberg REST catalog path.

How do we stop policies piling up?

Give every policy an owner, group users by role instead of by name, review policies on a schedule and remove those with no recent use.

In what order does Ranger evaluate policies?

Deny conditions are checked first, then allow conditions. If no allow matches, most components deny, while HDFS and YARN fall back to their own ACLs.

What is a Ranger security zone?

A zone groups resources so that only that zone's policies apply to them, and zone administrators manage those policies. A resource cannot belong to more than one zone.

Who can override a masking or row filter policy?

Cloudera warns that users with ALTER permission on a table can override row-level filtering and masking policies, so limit ALTER on protected tables.

Authored by

Co-Founder and Managing Partner, Duczer East

David deBoisblanc is co-founder of Duczer East and a digital transformation and innovation leader in data-centric AI, agentic systems, and enterprise integration. He shapes intent-driven AI solutions that modernize how organizations use data, drawing on deep experience with Cloudera and complex enterprise integration landscapes.

Newsletter

The Practitioner's Briefing

Senior-level insights on agentic AI, data engineering and enterprise integration, delivered to your inbox.

One email when there is something worth reading. Unsubscribe any time.

Let's Talk

Want to discuss the ideas raised here?

Tell us what you are working on. A senior practitioner replies, and only your email is required.

Get a quote