What Ranger Does
Apache Ranger is a central authorization and audit framework. Admins write policies once in a web console. Small plugins inside each service download policies and enforce them locally.
| Component | Purpose |
|---|---|
| Ranger Admin | Web UI, policy store, REST API |
| Plugins | Run in the service JVM and check each request against cached policies |
| Usersync | Imports users and groups from LDAP, AD or Unix |
| Tagsync | Imports classifications (tags) from Apache Atlas |
| Audit | Records allowed and denied accesses (Solr, OpenSearch, HDFS) |
Access Evaluation Order (Simplified)
- Deny policies and deny exceptions are checked
- Allow policies are checked
- If Ranger has no matching policy, many plugins fall back to native permissions (HDFS) if configured
- Otherwise access is denied
Policy Anatomy
| Field | Example |
|---|---|
| Service | prod_hadoop (HDFS), prod_hive |
| Resource | HDFS path /data/finance/*, Hive db=sales, table=orders, column=* |
| Users / Groups / Roles | group finance_analysts |
| Permissions | read, write, execute (HDFS); select, update, create, drop (Hive) |
| Conditions | IP range, time window, tags |
| Deny conditions | Explicit blocks and exceptions |
Column Masking and Row Filters (Hive)
| Feature | Effect |
|---|---|
| Masking: Partial show last 4 | 1234-5678-9012-3456 becomes xxxx-xxxx-xxxx-3456 |
| Masking: Hash / Nullify / Date show year | Hide or reduce sensitive values |
| Row filter expression | region = 'EU' so a group only sees its rows |
Users query the same table. Ranger rewrites the query on the fly, so there are no duplicated 'masked' copies of the data.
Tag-Based Policies
Instead of writing a policy per table, classify data in Apache Atlas (for example tag PII). Tagsync sends tags to Ranger. One policy 'deny PII except group hr' then covers every table and file with that tag, even new ones.
Audit
- Who accessed what, when, from which IP, result (allowed or denied) and which policy applied
- Store hot audit in Solr or OpenSearch for the UI, and long-term audit in HDFS or object storage
- Set retention and size limits, audit volume can be huge on busy clusters
- Forward important events to your SIEM
Typical Rollout Plan
- Install Ranger Admin with a production database and TLS
- Enable usersync from your directory
- Add services and enable plugins in audit-only mode first, to learn real access patterns
- Create policies by group, not by individual user
- Turn off permissive fallback only when ready
- Add masking, row filters and tag policies
- Review policies and audit reports regularly
<service>_<dataset>_<role>) and keep an export of policies in Git as a backup and review trail.
Conclusion
Ranger centralises authorization with per-service plugins, group-based policies, masking, row filters, tag policies and audit. Roll out with audit first, keep native permissions tight and back up policies.

