Skip to content

RANGER-5645: Add audit-ingestor service-user allowlist for Docker plugins#1017

Open
ramackri wants to merge 7 commits into
masterfrom
RANGER-5645-patch
Open

RANGER-5645: Add audit-ingestor service-user allowlist for Docker plugins#1017
ramackri wants to merge 7 commits into
masterfrom
RANGER-5645-patch

Conversation

@ramackri

@ramackri ramackri commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes HTTP 403 failures when Ranger Docker plugins send audits to audit-ingestor with the audit-server destination enabled (RANGER-5645).

This is authorization, not authentication — Kerberos/SPNEGO succeeds; ingestor rejects the request because the mapped service short name is missing from ranger.audit.ingestor.service.<repo>.allowed.users.

  • Add complete allowed.users entries in shipped ranger-audit-ingestor-site.xml for all Docker Policy Manager repos
  • Extend auth_to_local rules so service principals map to the same short names as policy.download.auth.users
  • Align create-ranger-services.py (Ozone ozone,om,scm,dn; add dev_atlas, dev_kudu, dev_nifi)
  • Add troubleshooting doc: audit-server/README-AUDIT-INGESTOR-SERVICE-ALLOWLIST.md

Problem

Plugins POST to /audit/access?serviceName=<repo>. Without a matching allowlist entry, ingestor returns:

HTTP status: 403, Response: {"message":"User is not authorized to send audit events",...}

Example (Kafka): dev_kafka needs ranger.audit.ingestor.service.dev_kafka.allowed.users=kafka

Example (KMS): ingestor log: Unauthorized user: user=rangerkms ... service=dev_kms → needs allowed.users=rangerkms

HTTP Meaning
401 Kerberos/SPNEGO auth failed
403 Auth OK; user not on allowlist for that repo

Changes

File Change
audit-server/audit-ingestor/.../ranger-audit-ingestor-site.xml Add allowed.users for 13 Docker repos + plugin auth_to_local rules
dev-support/ranger-docker/scripts/admin/create-ranger-services.py Ozone multi-user; Atlas/Kudu/NiFi services
audit-server/README-AUDIT-INGESTOR-SERVICE-ALLOWLIST.md Troubleshooting guide (401 vs 403, root causes, verification)
audit-server/scripts/README.md Link to allowlist troubleshooting doc

Shipped allowlist (Docker dev repos)

Repo allowed.users
dev_hdfs hdfs
dev_yarn yarn
dev_hive hive
dev_hbase hbase
dev_kafka kafka
dev_knox knox
dev_kms rangerkms
dev_trino trino
dev_ozone ozone,om,scm,dn
dev_solr solr
dev_atlas atlas
dev_kudu kudu
dev_nifi nifi

ramk and others added 4 commits June 14, 2026 22:42
…gins

Ship per-repo allowed.users and auth_to_local rules so plugins using the
audit-server destination are authorized after Kerberos SPNEGO (fixes HTTP 403).
Align create-ranger-services.py with policy.download.auth.users for Ozone,
Atlas, Kudu, and NiFi. Add troubleshooting README for ingestor 403 errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Consolidate auth_to_local property description (JWT note + plugin rules).
Revert audit-server/scripts/README.md and remove troubleshooting README.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match original site XML description style with one bullet per RULE line.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove dev_atlas, dev_kudu, and dev_nifi from ingestor allowlist,
auth_to_local rules, and create-ranger-services.py (not in Docker stack).

Co-authored-by: Cursor <cursoragent@cursor.com>
@ramackri ramackri requested review from mneethiraj and rameeshm June 14, 2026 17:21
ramk and others added 3 commits June 14, 2026 23:00
Create Policy Manager repo for the elasticsearch service type pointing at
ranger-opensearch.rangernw:9200 with opensearch download auth users, and
add matching ingestor allowlist plus auth_to_local rule.

Co-authored-by: Cursor <cursoragent@cursor.com>
Create dev_tag in create-ranger-services.py (matches Policy Manager).
Add dev_tag ingestor allowlist (rangertagsync) and auth_to_local rule.
Use CDATA so description shows <repo> instead of XML entities.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ries

Match Policy Manager repos (dev_atlas, dev_kudu, dev_nifi). Drop
dev_elasticsearch allowlist, auth_to_local rules, and create-service entry.

Co-authored-by: Cursor <cursoragent@cursor.com>
RULE:[2:$1/$2@$0]([ndj]n/.*@.*|hdfs/.*@.*)s/.*/hdfs/
RULE:[2:$1/$2@$0]([rn]m/.*@.*|yarn/.*@.*)s/.*/yarn/
RULE:[2:$1/$2@$0](jhs/.*@.*)s/.*/mapred/
RULE:[2:$1/$2@$0](hive/.*@.*)s/.*/hive/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 276 to 290, mappings introduced in this PR are already covered by DEFAULT rule; hence there is no need to explicitly specify these mappings.

'ranger.plugin.solr.policy.refresh.synchronous':'true'}})

services = [hdfs, yarn, hive, hbase, kafka, knox, kms, trino, ozone, solr]
tag = RangerService({'name': 'dev_tag', 'type': 'tag',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag service is automatically created (refer: RANGER-2481). No need to create it explicitly.

'policy.download.auth.users': 'ozone',
'tag.download.auth.users': 'ozone',
'userstore.download.auth.users': 'ozone',
'policy.download.auth.users': 'ozone,om,scm,dn',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ranger plugin runs only in Ozone Manager (om). Please update this configuration to list only the username associated with Kerberos principal used by om.

tag = RangerService({'name': 'dev_tag', 'type': 'tag',
'configs': {'ranger.plugin.audit.filters': "[ {'accessResult': 'DENIED', 'isAudited': true} ]"}})

atlas = RangerService({'name': 'dev_atlas', 'type': 'atlas',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ranger docker setup doesn't include Atlas, Kudu, NiFi; hence it is not necessary to create service instances for these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants