Skip to content

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

Merged
ramackri merged 11 commits into
masterfrom
RANGER-5645-patch
Jun 15, 2026
Merged

RANGER-5645: Add audit-ingestor service-user allowlist for Docker plugins#1017
ramackri merged 11 commits into
masterfrom
RANGER-5645-patch

Conversation

@ramackri

@ramackri ramackri commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

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

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.

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",...}
HTTP Meaning
401 Kerberos/SPNEGO auth failed
403 Auth OK; user not on allowlist for that repo

Solution

  1. Add ranger.audit.ingestor.service.<repo>.allowed.users for Docker resource services in shipped ranger-audit-ingestor-site.xml.
  2. Clarify auth_to_local description (DEFAULT rule maps most plugin principals; no extra plugin-specific RULE lines needed).
  3. Align Ozone in create-ranger-services.py: policy.download.auth.users=om (plugin runs on OM only).

Review feedback addressed (@mneethiraj)

Comment Action
Extra auth_to_local RULE lines redundant vs DEFAULT Not added (kept hdfs/yarn/jhs + DEFAULT only)
Do not create dev_tag in create-ranger-services.py (RANGER-2481) Not added
Ozone allowlist / download auth: OM only om only
Remove atlas/kudu/nifi from Docker service script Not in create-ranger-services.py
No allowlist for dev_tag (tag services do not send resource audits) Removed from site XML
Tag fixture date changes → separate Jira/PR Moved to #1018 (RANGER-5647)
Keep parallelStream() in TestPolicyEngine Reverted sequential change

Changes

File Change
audit-server/audit-ingestor/.../ranger-audit-ingestor-site.xml allowed.users for Docker resource repos; updated auth_to_local docs
dev-support/ranger-docker/scripts/admin/create-ranger-services.py Ozone download auth user ozoneom

Shipped allowlist (Docker resource services)

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 om
dev_solr solr

Test plan

  • Rebuild/redeploy audit-ingestor with updated site XML
  • Enable audit-server destination on a Docker plugin (e.g. Kafka); confirm no HTTP 403
  • CI green (requires #1018 for TestPolicyEngine_hiveForTag_filebased on master)

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>
Comment thread dev-support/ranger-docker/scripts/admin/create-ranger-services.py Outdated
Comment thread dev-support/ranger-docker/scripts/admin/create-ranger-services.py Outdated
Comment thread dev-support/ranger-docker/scripts/admin/create-ranger-services.py Outdated
ramk and others added 3 commits June 15, 2026 07:41
Remove redundant auth_to_local plugin rules covered by DEFAULT, restrict Ozone to om-only, and drop tag/atlas/kudu/nifi from create-ranger-services.py per Docker stack scope.

Co-authored-by: Cursor <cursoragent@cursor.com>
RESTRICTED-FINAL deny-exception uses isAccessedBefore(activation_date);
fixture dates were 2026/06/15 so TestPolicyEngine_hiveForTag_filebased
failed on/after that day (unrelated to ingestor allowlist changes).
Use 2099/12/31 in tag test fixtures so CI stays stable.

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

parallelStream() on a shared RangerPolicyEngine caused intermittent
failures (e.g. hdfs_resourcespec {USER} path policy) under CI load.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread agents-common/src/test/resources/policyengine/plugin/resourceTags.json Outdated
- Remove dev_tag, dev_atlas, dev_kudu, dev_nifi allowlist entries (not
  applicable to Docker audit-ingestor scope per review)
- Revert agents-common test fixture and TestPolicyEngine changes; tag
  date updates belong in separate RANGER-5647 PR
- Restore parallelStream() in TestPolicyEngine per review

Co-authored-by: Cursor <cursoragent@cursor.com>
@ramackri ramackri merged commit 9ab0069 into master Jun 15, 2026
6 of 8 checks passed
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