Skip to content

Backport audit-server, SPIFFE header auth, and SQL fixes to ranger-2.10 - #1228

Open
ramackri wants to merge 67 commits into
ranger-2.10from
backport-audit-spiffe-2.10
Open

Backport audit-server, SPIFFE header auth, and SQL fixes to ranger-2.10#1228
ramackri wants to merge 67 commits into
ranger-2.10from
backport-audit-spiffe-2.10

Conversation

@ramackri

@ramackri ramackri commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Ranger Audit Server (foundation → plugin wiring → docker)

Jira Master PR Description
RANGER-5482 #847 Create Ranger Audit Server with Solr and HDFS as audit consumers
RANGER-5520 #886 Refactor audit server: segregate ingestion and dispatch
RANGER-5613 #971 Fix audit-server Dockerfile duplicate tooling vs base image
RANGER-4676, RANGER-5615 #986 Add OpenSearch dispatcher to audit server
RANGER-5654 #1030 Fix Solr audit dispatcher Kerberos TGT relogin (keytab-aware JAAS)
RANGER-5720 #1138 DB patch 078 — x_audit_config table and audit server bootstrap
RANGER-5483 #969 Audit Server as destination for all Ranger plugins
RANGER-5632 #999 Plugin packaging: audit-server as sole audit destination
RANGER-5633 #1001 Wire audit-server Kafka producer/consumer tuning

Plugin packaging & docker CI (audit-server delivery)

Jira Master PR Description
RANGER-5642, RANGER-5644 #1015 Package Jersey audit-server REST client JARs in Kafka and HBase plugins
RANGER-5650 #1025 KMS plugin: package Jackson/Jersey audit client JARs in kms.xml
RANGER-5642 #1020 Exclude duplicate Jersey JARs from Kafka plugin packaging
RANGER-5646 #1019 Exclude duplicate Hive/Hadoop JARs from hive plugin packaging
RANGER-5661 #1040 Fix Kafka plugin packaging for broker-delegate classloading (Kafka 3.9+)
RANGER-5660 #1039 Fix YARN plugin packaging and enable script lib path
RANGER-5640 #1007 Bump Docker Ozone to 2.1; package audit-server JARs in ozone plugin
RANGER-5637 #1006 Fix Knox and Ozone plugin docker CI smoke-test failures
RANGER-5645 #1017 Audit-ingestor service-user allowlist for Docker plugins
RANGER-5643 #1016 Fix docker Kerberos for Solr audit dispatcher
RANGER-5680 #1167 Restructure audit services in docker compose; OpenSearch as default index store
RANGER-5679 #1057 Document OpenSearch audit setup in docker README; decouple Solr

SPIFFE / header-based authentication

Extends RANGER-5499 already on 2.10.

Jira Master PR Description
RANGER-5700 #1096 SPIFFE-based authn via HTTP headers
RANGER-5766 #1197 Support SPIFFE IDs as usernames in Ranger
RANGER-5767 #1206 Extend header-based authn to support ROLEs in Ranger Admin
RANGER-5723 #1139 Plugin SPIFFE outbound auth for audit-server destination

SQL / admin fixes

Jira Master PR Description
RANGER-5736 #1144 Fix MariaDB grant failure during Ranger Admin DB setup
RANGER-5693 #1081 Stop logging full JWT bearer tokens on validation failure
RANGER-5716 #1118 Fix swapped client IP and resource in KMS Ranger audits

Backport-specific fixes (2.10 / JDK 8)

These commits adapt master changes for ranger-2.10 and are not direct cherry-picks:

  • POM / build: audit-server pom alignment and GDS exclusion; hive.storage-api.version in HDFS dispatcher; Kylin RoaringBitmap → Maven Central 0.7.36; RAT license check fix; remove sortpom backup files
  • Jersey 1.x on JDK 8: audit-server WARs use com.sun.jersey SpringServlet (not Glassfish Jersey 2); plugin REST clients stay on Jersey 1.x with SPIFFE outbound headers only; pre-serialize audit batches for audit-server POST; avoid ClientHandlerException on Kafka classpath; pull jersey-bundle into plugin assemblies via Maven; package Jackson/JAX-RS in HBase/KMS/Kafka plugins
  • JDK 8 compatibility: restore CI build-8/build-11 (revert accidental master build-17); JDK8-compatible SPIFFE and OpenSearch unit tests (Map.of/List.of/Files.writeString replacements)
  • Docker smoke: restore 2.10 .env after Wave 2 conflicts; Kerberos auth_to_local rules for audit ingestor; harden HBase/KMS/Ozone smoke (KDC keytabs, single-node HBase, KMS init); Hive 4.0 ConfVars lookup fix; PostgreSQL driver in Hive docker image; fix jackson-jaxrs exclude filters in HBase/KMS assemblies
  • Conflict cleanup: RANGER-5680 rename conflict leftovers; GDS cleanup from --theirs on shared admin/agents-common files; security-admin build fixes without GDS

Explicitly excluded from this backport

Ranger Audit Server — what we tested

Audit pipeline topology (OpenSearch default, RANGER-5680)

Docker CI and local smoke use the audit-service compose stack with --profile audit-store-opensearch (not standalone Solr):

Ranger plugins / PDP  →  audit-ingestor (:7081)  →  Kafka  →  audit-dispatcher-opensearch  →  OpenSearch (:9200)

Audit server components verified

Component Local docker smoke GitHub Actions CI
audit-ingestor Starts; accepts plugin/PDP audit batches over HTTP services-docker-build + plugins-docker-build container check
audit-dispatcher-opensearch Health on :7093; indexes events into OpenSearch Same — both CI jobs verify container running
OpenSearch index store (ranger-opensearch) Cluster reachable on :9200 CI container check
Kafka (audit bus) Broker healthy; policy-cache topic populated after staged Admin bring-up CI — longer healthcheck + admin-first compose staging
KDC keytabs Principals for ingestor + all dispatchers (Solr/HDFS/OpenSearch) + ranger-pdp CI KDC health step passes; keytabs provisioned at init

Audit destinations wired in docker

Producer Destination config tested Result
PDP ranger.authz.audit.destination.auditserver=truehttp://ranger-audit-ingestor.rangernw:7081 (Solr disabled) PDP container stays up; no SolrAuditDestination ClassNotFoundException
Hive plugin XAAUDIT.AUDITSERVER.ENABLE=true in ranger-hive-plugin-install.properties Plugin enabled; audit spool dir created; HS2 starts in CI
Kafka / HBase / KMS / Knox / Ozone plugins ranger-audit-dest-auditserver JAR in plugin-impl assemblies Jersey + Jackson audit REST client on classpath; containers start in CI

End-to-end audit indexing (local smoke)

Verified audit events flow through the full pipeline into OpenSearch indices:

  • Kafka plugin — events indexed in dev_kafka index (+140 during smoke)
  • HDFS plugin path — events indexed in dev_hdfs index (+13)
  • Hivedev_hive audit count increased after HS2 + plugin enable
  • Ozone — container startup + audit path exercised
  • KMS — key operations produce audits after jsr311/jersey-bundle packaging fix
  • OpenSearch dispatcher — health endpoint on :7093 after removing duplicate spring-web from dispatcher lib

Not tested on this branch

  • Solr audit dispatcher docker profile (compose defaults to OpenSearch; Solr dispatcher code is backported but not CI-smoke-tested)
  • HDFS audit dispatcher docker profile (plugin → OpenSearch path verified instead)
  • DB patch 078 (x_audit_config) on fresh DB installs outside docker Postgres
  • SPIFFE provisioning end-to-end (header auth config present; full SPIFFE smoke pending)

Test plan

Build & unit compile (local, JDK 8)

  • mvn install -pl audit-server/audit-common,audit-server/audit-ingestor,audit-server/audit-dispatcher,agents-audit/dest-auditserver,agents-audit/dest-os,common-utils -am -DskipTests -Drat.skip=true
  • mvn compile -pl security-admin -am -DskipTests -Drat.skip=true
  • mvn verify -pl audit-server,agents-audit/dest-auditserver,agents-audit/dest-os,agents-common -DskipTests -Drat.skip=true (checkstyle + PMD on backport modules)
  • mvn pmd:check -pl security-admin,agents-common,pdp,embeddedwebserver,hive-agent,kms -DskipTests -Drat.skip=true (PMD clean after unused-import fix)
  • JDK 8–compatible SPIFFE / OpenSearch unit tests compile (SpiffeIdUtilTest, OpenSearchUtilTest, audit-server dispatcher tests)

Packaging verification (local docker build)

  • Full reactor build via docker compose run ranger-build with mvn -pl distro -am (not distro-only — avoids empty ~19 KB plugin tarballs)
  • Plugin tarballs contain jersey-bundle-1.19.4.jar (Kafka, HBase, KMS, Knox) after POM/assembly alignment
  • HBase/KMS/Knox plugin tarballs contain jackson-jaxrs-* JARs after removing conflicting assembly excludes
  • OpenSearch dispatcher WAR starts without Tomcat spring-web duplicate-class conflict

Docker smoke — audit server + plugins (local)

  • Ranger Admin, Postgres, ZK, audit-ingestor, audit-dispatcher-opensearch, OpenSearch start cleanly under Kerberos
  • Audit E2E: plugin → ingestor → Kafka → OpenSearch dispatcher → OpenSearch (9200)
  • PDP audits route to audit-ingestor (not Solr)
  • Hive HS2 + Ranger plugin; schematool + Kerberos HDFS setup; audit spool dirs
  • HBase master stable after jackson-jaxrs packaging fix
  • KMS key ops + audits after jsr311/jersey-bundle in plugin-impl
  • Knox WebHDFS policy enforcement (403 deny) after Jersey 1.x split-jar packaging
  • Solr authorizer plugin init OK (Solr plugin container; separate from audit index store)

CI (GitHub Actions) — run 34700451794

  • build-8 — pass
  • build-11 — pass (Knox/KMS jars installed from build-8; modules excluded from JDK 11 compile)
  • services-docker-build — pass (Admin, PDP, usersync, tagsync, KMS, Kafka, audit-ingestor, audit-dispatcher-opensearch, ranger-opensearch)
  • plugins-docker-build — pass (Hadoop, HBase, Hive, Knox, Ozone + audit pipeline containers)
  • Staged compose: Admin first → full stack (Kafka policy cache ready before audit healthchecks)
  • OpenSearch audit pipeline via docker-compose.ranger-audit-service.yml + --profile audit-store-opensearch

Admin / DB / auth — pending

  • Apply DB patch 078 (x_audit_config) on a test Postgres/MySQL/Oracle instance
  • SPIFFE / header-based auth provisioning smoke (Admin + PDP + plugin outbound SPIFFE headers)
  • MariaDB grant fix (RANGER-5736) on MariaDB install path

rameeshm and others added 30 commits September 11, 2026 13:17
…nsumer (#847)

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - fix failing testing

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - fix pmd issue

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - Fix audit commit failure propagation and recovery in the consumers

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - audit server partition management enhancement

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - Fix review comments

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - PojoMappingFeature for AuditEvent Object for serialization

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - Fix review comments set #2

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - Audit Batch processing and failure reprocessing improvement

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - Fix duplicate dependency error in the pom for sl4j

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - Fix ubuntu audit ranger module  war file creation failure

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - Fix Review comments set #3

* RANGER-5482:Create Ranger Audit Server with SOLR and HDFS as audit consumer - Fix failing test

* RANGER-5482: addressed review comments/suggestions

* RANGER-5482: support configuration to specify authorized users per service, instead of a global list of users

* addressed review comments

* cleanup in AuditConsumer implementations, RangerAuditServerDestination

* added NoContentException to resolve failure in instantiating RangerJsonProvider

---------

Co-authored-by: Ramesh Mani <rmani@apache.org>
Co-authored-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit 89ce14a)
#886)

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality - copilot review comment fix

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality - Fix review comments

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality -Fix review comments -set #2

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality -Fix review comments - set #3

* addressed review suggestions

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality - Fix review comments #4 - remove audit dispatcher registry

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality - Fix merge conflit

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality - fix dispatcher issue with handling failed audits

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality - fix review comments #5

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality -fix review comments

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality - Fix review comments on docker file separation for ingestor and dispatchers

* RANGER-5520:Audit Server refactoring to segregate audit ingestion and dispatching functionality - Fixed review comment on docker file

---------

Co-authored-by: Ramesh Mani <rmani@apache.org>
Co-authored-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit 3fd46db)
…ls sets which are already in Ranger Base image (#971)

* RANGER-5613:DockerFile of Ranger Audit Server has issue duplicate tools sets which are already in Ranger Base image

* RANGER-5613:DockerFile of Ranger Audit Server has issue duplicate tools sets which are already in Ranger Base image - Review Comment addressed

---------

Co-authored-by: Ramesh Mani <rmani@apache.org>
(cherry picked from commit e3ab2b3)
…erver (#986)

* RANGER-4676, RANGER-5615: Add OpenSearch audit destination via dedicated dispatcher module

* Update OpenSearchAuditDestination.java

* Update AuditOpenSearchDispatcher.java

* Update OpenSearchDispatcherManager.java

* Update OpenSearchUtilTest.java

* Update OpenSearchMgrTest.java

* Update OpenSearchAccessAuditsServiceTest.java

* Update OpenSearchUtil.java

* Update OpenSearchAccessAuditsService.java

* Update TestAuditOpenSearchDispatcher.java

---------

Co-authored-by: Paras <pagnihotri@cloudera.com>
Co-authored-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit a23c30c)
…o store) via keytab-aware JAAS relogin (#1030)

* RANGER-5654:Solr audit dispatcher fails to index after Kerberos TGT relogin (No key to store) with default useTicketCache=true


* RANGER-5654: Restore site XML descriptions and document relogin recovery


* RANGER-5654: Drop AbstractKerberosUser change; config-only fix


* RANGER-5654: Keytab-aware JAAS relogin; restore useTicketCache=true

Replace config-only useTicketCache=false with in-place keytab relogin in
AbstractKerberosUser (agents-audit + security-admin). KerberosAction uses
performRelogin() on SecurityException retry. Revert shipped and docker site
XML to useTicketCache=true so the Java fix alone addresses "No key to store"
at TGT renewal. Add unit test for keytab relogin without logout.


* RANGER-5654: Wrap Kerberos javadoc and log lines for checkstyle

Keep LineLength within 80 characters in AbstractKerberosUser,
KerberosAction, and KerberosJAASConfigUser; no new checkstyle
violations versus the pre-change baseline in those files.


* RANGER-5654: Use single-line Kerberos relogin log statements


* RANGER-5654: Address KerberosJAASConfigUser PR review feedback

Cache useKeyTab in the constructor, rename helper to getBooleanOption,
and use a single return per method in both agents-audit and security-admin.

---------

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 7017225)
…tstrap (#1138)

* RANGER-5720: DB patch 078 for audit partition plan global state

Add patch 078 and optimized schema updates for all DB backends: seed
rangerauditserver with ROLE_ADMIN_AUDITOR and register RangerAuditPartitionPlan
global state name for RANGER-5655 admin-managed partition plans.

* RANGER-5720: Address Copilot review on patch 078 audit DB changes.

Disable JDBC login for rangerauditserver (status=0, empty password) for
SPIFFE-only Admin access; fix Oracle app_data ALTER guard; use SQL Anywhere
ALTER COLUMN syntax.

* RANGER-5720: Fix Oracle and SQL Server fresh-install schema for patch 078.

Oracle stores empty string as NULL on NOT NULL PASSWORD; use a space placeholder for rangerauditserver. Remove stale x_policy_ref_user_FK_upd_by CHECK from SQL Server optimized schema (patch 077 regression).

* RANGER-5720: Address review on MySQL LONGTEXT and Oracle CLOB upgrade.

Use LONGTEXT for app_data on MySQL so the partition plan can grow beyond
TEXT limits. On Oracle upgrade, migrate VARCHAR2 app_data via add/copy/drop/
rename instead of MODIFY to avoid ORA-22858.


* RANGER-5720: Add x_audit_config table for audit runtime settings.

Per review feedback, store ingestor URL, per-service allowed users, and
topic partition count in x_audit_config (patch 078 + optimized schema on
all DB backends). Seed defaults idempotently on fresh install and upgrade.


* RANGER-5720: Align x_audit_config with Option A config split.

Keep ingestor URL and per-service allow-list in x_audit_config; partition
routing (topic, topicPartitionCount, plugins, buffer) stays in
RangerAuditPartitionPlan JSON only. Drop topic-partitions from x_audit_config.


* Revert "RANGER-5720: Align x_audit_config with Option A config split."

This reverts commit 3b33734.

* RANGER-5720: Move audit config to x_audit_config table.

Store ingestor URL, topic, partition plan JSON, and per-service allow-list
in x_audit_config. Revert patch 078 changes to x_ranger_global_state
(no app_data widen, no RangerAuditPartitionPlan row). Keep rangerauditserver
machine user setup in patch 078.


* RANGER-5720: Finalize patch 078 x_audit_config and add docker DB E2E tests.

Rename patch 078 to add-x_audit_config, store all audit runtime settings in
x_audit_config (not x_ranger_global_state), fix Oracle upgrade SQL, drop a
stale SQL Server FK CHECK from optimized schema, and add ranger-docker scripts
to verify fresh install and 077→078 upgrade on all four docker DB backends.


* RANGER-5720: Align SQL Server patch UK constraint naming.

Use x_audit_config$x_audit_config_UK_cfg_name in patch 078 to match
Ranger SQL Server convention and fresh-install schema.

* RANGER-5720: Remove patch 078 docker DB test scripts.

Drop db-test helpers from PR scope; patch 078 remains DB-only.

---------

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 2ad565f)
- Set audit-server module parent versions to 2.10.0-SNAPSHOT
- Add Jersey 2 dependencyManagement for audit WAR modules
- Restore 2.10 agents-common and security-admin biz code without GDS
- Add AUDIT_STORE_OPENSEARCH constant for audit UI routing
…ins available (#969)

* RANGER-5483:Add Audit Server as a destination for all the Ranger Plugins available

* RANGER-5483:Add Audit Server as a destination for all the Ranger Plugins available - addressed review comments

---------

Co-authored-by: Ramesh Mani <rmani@apache.org>
(cherry picked from commit d2cd9ea)
…y audit destination (#999)

(cherry picked from commit e3babee)
)

* RANGER-5633: Wire audit-server Kafka producer and consumer tuning

Wire ingestor producer properties from site XML, apply optional topic
configs at create time, default dispatchers to CooperativeStickyAssignor,
and add unit tests for producer config and topic config wiring.


* RANGER-5633: Wire audit-server Kafka producer and consumer tuning

* RANGER-5633: Addressing Review comments

---------

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 4a06175)
… in Kafka and HBase plugins (#1015)

* RANGER-5642, RANGER-5644: Package Jersey auditserver REST client JARs in Kafka and HBase plugins

Whitelist missing Glassfish Jersey dependencies in plugin assembly descriptors so
auditserver destination can POST JSON audits without MessageBodyWriter errors.


* RANGER-5644: Align HBase plugin Jersey deps with HDFS/Hive for CI stability.

Omit jersey-hk2 and javax.inject from the HBase plugin tarball; they crash
HMaster in plugins-docker-build while entity-filtering and
jersey-media-json-jackson still fix auditserver MessageBodyWriter errors.


---------

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 10bda4d)
…kms.xml for audit-server delivery (#1025)

Add Jackson, Jersey client, and HK2 coordinates to ranger-kms-plugin-impl
so the isolated plugin classloader can POST audit batches to the audit-server
ingestor without LinkageError or Jersey SPI failures.

https: //issues.apache.org/jira/browse/RANGER-5650

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 33e7b3a)
#1020)

* RANGER-5642: Exclude duplicate Jersey JARs from Kafka plugin packaging

Revert the Kafka portion of #1015: the broker already ships Jersey on the
application classpath; duplicate JARs in plugin-impl cause WadlAutoDiscoverable
ClassCastException and audit ingestor POST failures.


* RANGER-5647: Fix remaining ISO EXPIRES_ON dates in hive tag tests.

PR #1018 updated slash-format tag fixture dates to 2099/12/31 but left
2026-06-15 ISO expiry_date values in test_policyengine_tag_hive.json.
After 2026-06-15, TestPolicyEngine.testPolicyEngine_hiveForTag fails CI
with isAllowed expected true but was false for EXPIRES_ON SELF match.


* Revert "RANGER-5647: Fix remaining ISO EXPIRES_ON dates in hive tag tests."

This reverts commit ef0dbdd.

* RANGER-5642: Exclude duplicate Jackson JARs from Kafka plugin packaging

Review feedback on #1020: broker ships Jackson 2.16.x; plugin-impl must not
also whitelist jackson-annotations, jackson-core, jackson-databind, and
jackson-jaxrs-json-provider at Ranger 2.17.x — same principle as the Jersey
revert (use broker classpath for shared libraries).


---------

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 6bf1913)
…aging. (#1019)

Stop whitelisting Jackson 2.17, httpclient/httpcore, hppc, and other
libraries HiveServer2 already provides so audit-server REST delivery no
longer fails with HTTP 401 from plugin classpath version skew.

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 9272baf)
…ng on Kafka 3.9+ (#1040)

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 6d9b1b2)
)

Add missing plugin-yarn template for assembly, install YARN plugin jars
under share/hadoop/yarn/lib, and include slf4j-api in ranger-yarn-plugin-impl
to match hdfs-agent packaging.

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit abe6718)
…1006)

* RANGER-5637: Fix Knox and Ozone plugin docker CI smoke-test failures.

Use Java 17 ozone-runner (20241022-jdk17-1) and container JAVA_HOME for
plugin enable so XmlConfigChanger and RangerOzoneAuthorizer load correctly.
Start OM after SCM and datanode to reduce startup-order flakes.

Package Jersey/HK2 and javax.inject in the Knox plugin tarball for
auditserver destination after RANGER-5632, and tail gateway.log when
the Knox gateway fails to start in CI.


* RANGER-5637: Fix Knox and Ozone Java 17 docker smoke-test startup.

Knox 2.0.0 needs JDK 17 module exports for SSL keystore generation; Ozone SCM
needs -XX:-UseContainerSupport on GitHub Actions kernels with broken cgroup metrics.


* RANGER-5637: Bump Knox to 2.1.0 and fix Ozone auditserver JAX-RS packaging.

Knox 2.0.0 cannot generate gateway SSL certs on JDK 17 (md5WithRSAEncryption_oid
removed from AlgorithmId); 2.1.0 includes KNOX-2923 JDK 17 support. Whitelist
javax.ws.rs-api in Knox and Ozone plugin assemblies for auditserver REST client.


* RANGER-5637: Skip redundant Ozone re-downloads in plugin archive CI step.

Replace unconditional rm -rf downloads/ozone-* with extractOzoneIfNeeded(), which
re-extracts only when the tree is missing, incomplete, or older than the tarball.


* RANGER-5637: Stabilize Ozone extract cache with tarball stamp file.

Use .ozone-extract.stamp (mtime:size) instead of directory mtime so CI skips
re-extraction on warm cache hits. Document extractOzoneIfNeeded in script and workflow.


* RANGER-5637: Add HK2 javax.inject to Ozone plugin and wait for SCM leader.

Package org.glassfish.hk2.external:javax.inject for Jersey Singleton on the
Ozone plugin classpath. Wait for SCM client port before OM plugin enable to
reduce ServerNotLeaderException flakes.


* RANGER-5637: Package javax and jakarta inject in Ozone plugin tarball.

Declare javax.inject as a runtime dependency and include jakarta.inject in
the assembly so OM auditserver JAX-RS clients resolve HK2 inject APIs.


* RANGER-5637: Use multi-arch ozone-runner 20241108-jdk17-1.

20241022-jdk17-1 is amd64-only; 20241108-jdk17-1 adds arm64 for Apple Silicon
without QEMU emulation. Document the choice in .env and Dockerfile.ranger-ozone.


---------

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 137a5dd)
…gins (#1017)

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

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.


* RANGER-5645: Fix auth_to_local description; drop README files from PR

Consolidate auth_to_local property description (JWT note + plugin rules).
Revert audit-server/scripts/README.md and remove troubleshooting README.


* RANGER-5645: List auth_to_local rules in Default rules provided format

Match original site XML description style with one bullet per RULE line.


* RANGER-5645: Limit scope to Docker services listed in Jira

Remove dev_atlas, dev_kudu, and dev_nifi from ingestor allowlist,
auth_to_local rules, and create-ranger-services.py (not in Docker stack).


* RANGER-5645: Add dev_elasticsearch for Docker OpenSearch stack

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.


* RANGER-5645: Add dev_tag service and fix auth_to_local description

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.


* RANGER-5645: Add atlas/kudu/nifi; remove OpenSearch elasticsearch entries

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


* RANGER-5645: Address PR review feedback on allowlist and Docker services

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.


* RANGER-5645: Fix date-bound tag policy engine tests after 2026-06-15

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.


* RANGER-5645: Run TestPolicyEngine sub-tests sequentially for CI stability

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


* RANGER-5645: Address review feedback on allowlist scope and test changes

- 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: ramk <ramk@cloudera.com>
(cherry picked from commit 9ab0069)
Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit ce93068)
Wave 2 cherry-picks used --theirs on .env and polluted master/JDK17
settings. Restore ranger-2.10 branch, JDK8 base images, and 2.10.0-SNAPSHOT
versions; keep OPENSEARCH_VERSION for audit stack. Fix plugin-ozone parent pom.
…nSearch as the default Index Store (#1167)

(cherry picked from commit d4a0759)
…ouple Solr (#1057)

- Extract ranger-solr from docker-compose.ranger.yml into a dedicated
  docker-compose.ranger-solr.yml (mirrors docker-compose.ranger-opensearch.yml)
- Remove hard depends_on: ranger-solr from ranger, ranger-pdp, and ozone-om
  so the core, pdp, and ozone stacks start without Solr; Solr is now opt-in
  via -f docker-compose.ranger-solr.yml
- Add OpenSearch audit setup one-liners to README, parallel to Solr/HDFS docs
- Add audit_store=opensearch config block to mysql and oracle install.properties
- CI (plugins-docker-build): switch from docker-compose.ranger-solr.yml to
  docker-compose.ranger-opensearch.yml — the plugins job has no need for Solr,
  and the Solr compose file's ranger-kdc dependency caused a keytab race that
  crashed ozone-datanode on CI runners
- CI (services-docker-build): already using docker-compose.ranger-opensearch.yml
  (no change needed there)

Co-authored-by: Paras <pagnihotri@cloudera.com>
(cherry picked from commit 0249cc1)
…in (#1206)

Co-authored-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit d9d2c44)
…#1139)

* RANGER-5723: Plugin SPIFFE outbound auth for audit-server destination

Add PluginHeaderAuthConfig, SpiffeIdentityResolver, and
RangerRESTClient.setTrustedAuthHeaders(); wire SPIFFE headers into
RangerAuditServerDestination when audit XML authn.header.enabled=true.

* RANGER-5723: Remove unused SPIFFE prefix-discovery helpers

Drop configPrefixForServiceType, resolveEnabledConfigPrefix, and
RANGER_CONFIG_PREFIX; audit destination passes an explicit config prefix to
buildSpiffeAuthHeaders.

* RANGER-5723: Address PR review comments for SPIFFE outbound auth

Remove redundant SPIFFE ID trim, add misconfiguration and REST client
header tests, and document that SPIFFE header auth is additive to authn.type.

* RANGER-5723: Fix Checkstyle import order in TestRangerRESTClient

Add blank line between javax and java import groups required by
dev-support/checkstyle.xml ImportOrder rule.

* Update SpiffeIdentityResolver.java

* Update SpiffeIdentityResolver.java

* RANGER-5723: Fix checkstyle and address remaining PR review comments

Fix SpiffeIdentityResolver checkstyle violations, rename buildSpiffeAuthHeaders
to buildTrustedAuthHeaders, and add generic authn.header.headers slot-based
configuration with file:/env: value resolution.

* RANGER-5723: Document trusted-header config modes and value specs

Expand PluginHeaderAuthConfig Javadoc for legacy SPIFFE and generic slot
configuration, including file:/env:/literal value spec examples.

* RANGER-5723: Use header-name-as-property for trusted auth config

Address PR review: configure outbound trusted headers as
authn.header.{Header-Name}=value specs (file:/env:/literal) instead
of slot-based or legacy SPIFFE properties.

* Update RangerAuditServerDestination.java

* Update RangerAuditServerDestinationTest.java

* Update TestRangerRESTClient.java

* Update PluginHeaderAuthConfig.java

* RANGER-5723: Drop outbound SPIFFE validation and SpiffeIdentityResolver

Address PR review: trusted outbound headers pass resolved values
through without SPIFFE format checks; remove SpiffeIdentityResolver
and obsolete tests for the old authn.spiffe.* resolution model.

* Update PluginHeaderAuthConfig.java

* Update PluginHeaderAuthConfig.java

* RANGER-5723: Remove unnecessary property-name sorting in header auth config.

HTTP header order does not affect auth; iterate props directly per review feedback.

---------

Co-authored-by: ramk <ramk@cloudera.com>
Co-authored-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit 8e7716c)
…1144)

* RANGER-5736: Fix MariaDB grant failure during Ranger Admin DB setup

MariaDB returns error 1133 when dba_script.py grants privileges to a
host-specific user after wildcard grants with FLUSH PRIVILEGES. Detect
MariaDB at runtime and adjust grant order, flush timing, and retry logic
without changing behavior for Oracle MySQL or other DB flavors.


* RANGER-5736: Inline MariaDB grant fix, drop extracted helpers

Keep grant/flush logic inline in grant_xa_db_user; retain only
detect_server_type() and user_hosts() as small MariaDB-specific helpers.


* RANGER-5736: Mirror MariaDB grant fix in KMS dba_script.py

Apply the same MysqlConf MariaDB detection, host order, flush timing,
and grant retry logic to kms/scripts/dba_script.py for KMS Docker installs.


---------

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 06c44cb)
#1081)

* RANGER-5693: Stop logging full JWT bearer tokens on validation failure

Replace jwtToken.serialize() in the validation-failure WARN path with
safeJwtLogContext() that logs only non-sensitive metadata and a SHA-256
hash for log correlation. Add null-safety for missing audience claims
and unit tests for the safe logging path.

* RANGER-5693: Drop tokenHash from JWT validation failure logs.

Per review feedback, remove sha256Hex/tokenHash from safeJwtLogContext;
jwtId is sufficient for log correlation when present.

* Remove tokenHash assertion from JWT test

---------

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit 6723329)
…1118)

Pass the HTTP client address and key name to the correct assertAccess
overload for invalidate cache and reencrypt operations so Ranger audit
records show the real client IP and key resource instead of swapping them.

Co-authored-by: ramk <ramk@cloudera.com>
(cherry picked from commit b4fd13c)
…ing.

Revert accidental master CI migration to build-17; ranger-2.10 uses build-8
and build-11. Clear JDK 17-only JAVA_OPTS from docker .env for -8 images.
Bundle Jersey/Jackson JAX-RS jars in the kafka plugin for audit-server dest.
@ramackri
ramackri force-pushed the backport-audit-spiffe-2.10 branch from f642e62 to c6b3767 Compare September 11, 2026 11:55
ramk added 10 commits September 11, 2026 17:59
…ARs.

Replace Glassfish Jersey 2 servlet wiring with com.sun.jersey SpringServlet
so Spring beans inject on JDK 8. Drop Jersey 2 deps from ingestor and
dispatcher-app; use jaxb-api instead of jakarta.xml.bind in dispatcher.
… POST.

Jersey 1.x on plugin spool threads cannot reliably write List bodies, and
JsonUtils date format is rejected by the audit ingestor ObjectMapper.
…ngestor.

Map hive, hbase, kafka, om, and rangerkms service principals for smoke tests.
… KMS plugins.

Include jackson-jaxrs and exclude Glassfish Jersey 2.x from plugin tarballs.
Use HiveConf.getConfVars for hive.exec.pre.hooks instead of removed enum.
…e audits.

Fix single-node HBase startup, KMS service name and init scripts, KDC keytabs
for ozone/kms/hbase, and wait for keytabs before Ozone services start.
…afka classpath.

RangerRESTClient already uses com.sun.jersey types; serialization errors
should not throw ClientHandlerException which breaks plugins without jersey-bundle.
…a Maven.

Replace jersey-client/core with jersey-bundle in agents-common, hbase-agent,
and plugin-kms so assembly filters match the dependency tree. Align kms.xml
plugin-impl with Jersey 1.x packaging used by docker KMS.
…ckaging.

Restore jackson-jaxrs in HBase/KMS plugin assemblies (exclude filter was
dropping them), add PostgreSQL driver to Hive docker image, and wait for
HS2 startup before declaring the container healthy.
Align backport Java sources with Ranger import layout and whitespace rules,
convert tab-indented security-admin files to spaces, remove an unused import
that failed PMD, and add dev-support formatting helpers for future use.
@ramackri
ramackri force-pushed the backport-audit-spiffe-2.10 branch from 20bea2e to 56abfa2 Compare September 12, 2026 03:39
ramk added 5 commits September 12, 2026 09:10
…om PR.

Remove format-changed-java.py and RangerCodeScheme-IntelliJ.xml added for
one-time style cleanup; keep the Java source formatting changes only.
Ship jersey-bundle and javax.ws.rs-api in KMS server and plugin-impl lib sets so the Jersey 1.x REST servlet and Ranger policy client start cleanly. Fix Knox image directory permissions, JAVA_HOME, and preserve env for gateway startup; align Solr 9 entrypoint and Kerberos settings with master.
knoxcli create-master runs as root and leaves /opt/knox/data/security unreadable by the knox user; chown data/logs/pids after expect so gateway startup succeeds.
knox-jdk17-env.sh --add-exports options are rejected by Java 8 and prevent LDAP/gateway startup on the ranger-2.10 base image.
Package Jersey 1.x correctly for KMS, Knox, and Solr plugins, add audit-core
to Knox/Solr assemblies, fix OpenSearch dispatcher duplicate Spring jars, and
correct KMS auth_to_local rules so keyadmin mapping works in docker.
@ramackri
ramackri force-pushed the backport-audit-spiffe-2.10 branch from caf47f3 to cd9daaa Compare September 12, 2026 06:24
ramk added 11 commits September 12, 2026 12:33
RangerAdminJersey2RESTClient requires JAX-RS 2.0 Response APIs at compile
time; plugin runtime packaging still uses Jersey 1.x via assembly excludes.
com.sun.jersey jersey-client pulled JAX-RS 1.x jsr311-api, which shadowed
javax.ws.rs 2.x Response APIs required by RangerAdminJersey2RESTClient.
Reorder provided-scope dependencies so sortpom:verify passes in CI.
Install the Knox plugin jar from build-8 before the JDK 11 reactor run,
start Solr in services/plugins docker compose (ranger-solr was checked but
never brought up), and drop references to the missing OpenSearch compose
file on the 2.10 branch.
Maven install:install-file does not expand globs; resolve the downloaded
artifact path with find before installing to the local repository.
Use docker-compose.ranger-audit-service.yml with the audit-store-opensearch
profile (matching RANGER-5680), copy audit ingestor/dispatcher tarballs, and
check ranger-opensearch plus the audit pipeline containers instead of Solr.
Remove external: true on rangernw so docker compose can create the network
when bringing up admin, audit-service, and PDP together.
Stage docker compose to wait for Ranger Admin before starting the audit
pipeline, give Kafka more healthcheck time for policy cache sync, and
install KMS from build-8 on the JDK 11 job (RangerMasterKeyTest fails on 11).
Use ranger-db (the compose service name) instead of ranger-postgres when
starting the core stack; ranger-postgres is only the container name.
Point PDP at the audit ingestor instead of Solr, restore ranger-pdp Kerberos keytabs dropped during the audit backport, and fix Hive schematool ordering and Kerberos HDFS access for plugins-docker CI.
Backport master ranger-hive.sh log4j2 and service readiness checks, create audit spool directories before enabling the plugin, and allow more time for HiveServer2 to start before the container health check.
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.

5 participants