RANGER-4676, RANGER-5615: Add OpenSearch Dispatcher to Ranger Audit Server#986
RANGER-4676, RANGER-5615: Add OpenSearch Dispatcher to Ranger Audit Server#986paras200 wants to merge 10 commits into
Conversation
dac9739 to
d58b01c
Compare
|
@paras200 |
188138d to
328cd6b
Compare
|
@ramackri The checkstyle violations are all The 80-character line limit is explicitly deprecated per the Apache Ranger Java Style Guide which sets the column limit at 512 characters. @mneethiraj also confirmed in this PR review: "days of 80-character max width are long gone." The The CI |
d50154b to
babe50b
Compare
ramackri
left a comment
There was a problem hiding this comment.
remove create-ranger-audit-topic.sh & e2e-audit-opensearch.sh from this PR
Done — both removed. The e2e test script will be contributed to ranger-tools as a generic audit dispatcher test that can validate solr/opensearch/hdfs dispatchers against the ranger-tools base images. |
| image: ranger-zk | ||
| container_name: ranger-zk | ||
| hostname: ranger-zk.rangernw | ||
| depends_on: |
There was a problem hiding this comment.
I'm trying to understand why should ZK depend on KDC?
There was a problem hiding this comment.
Sure, when KERBEROS_ENABLED=true, ranger-zk boots via zookeeper-with-kerberos.sh, which needs its keytab provisioned by the KDC before startup — without the depends_on: ranger-kdc: service_healthy gate, ZK races the KDC and fails to authenticate. It's a depends_on (ordering only), so in non-Kerberos runs it just waits for the KDC container to be healthy with no functional coupling.
This can be moved to the Kerberos-specific overlay if we want to keep it out of the base compose.
| audit_elasticsearch_password=$(get_prop 'audit_elasticsearch_password' $PROPFILE) | ||
| audit_elasticsearch_index=$(get_prop 'audit_elasticsearch_index' $PROPFILE) | ||
| audit_elasticsearch_bootstrap_enabled=$(get_prop 'audit_elasticsearch_bootstrap_enabled' $PROPFILE) | ||
| audit_opensearch_urls=$(get_prop 'audit_opensearch_urls' $PROPFILE) |
There was a problem hiding this comment.
Since these properties are already added in ranger-admin-site.xml, are they really need in this script ?
There was a problem hiding this comment.
Yes — these follow the same install-time substitution pattern as the existing audit_elasticsearch_* and audit_solr_* properties. setup.sh reads the operator-supplied values (lines 105–111) and writes them into ranger-admin-site.xml when audit_store=opensearch (see lines 877–904). The values shipped in ranger-admin-site.xml are just defaults/placeholders that setup.sh overwrites at install time, so removing them here would make the OpenSearch audit store non-configurable during install.
6407aee to
4e11bf2
Compare
afe6dcc to
d788260
Compare
…ted dispatcher module
Adds a complete OpenSearch audit destination to Apache Ranger — covering the write path (dispatcher), read path (Ranger Admin UI), and direct plugin writes — as an alternative to the Solr/Elasticsearch-based audit store.
OpenSearch Dispatcher (audit-server/audit-dispatcher/dispatcher-opensearch)
/_bulkAPI using the low-level RestClientaudit.eventIdas_idin bulk metadata, falls back to UUID when absentNative Ranger Admin Read Path (security-admin —
audit_store=opensearch)OpenSearchAuditDestinationSearchCriteria(bool/must, wildcard, match_phrase, query_string OR, range, negation, pagination, sorting); parses responses with JacksonAccessAuditsService, orchestrates search +populateViewBeanfield mapping toVXAccessAuditranger_auditsindex at Ranger Admin startup viaHEAD/PUTREST callsAssetMgr,XAuditMgr,RangerBizUtil(AUDIT_STORE_OPENSEARCH), andEmbeddedServerranger.audit.opensearch.*namespace inranger-admin-site.xml,install.properties, andsetup.shwith URL/port validationDirect Plugin Audit Destination (agents-audit/dest-os)
AuditDestination, provides direct plugin-to-OpenSearch writes using low-level RestClient +/_bulkAPIAuditProviderFactory(xasecure.audit.destination.opensearch=true)CONFIG_PREFIX,CONFIG_URLS, etc.) used byOpenSearchMgrdistro/pom.xmlalongsidedest-es,dest-solr, etc.Bug fix
ElasticSearchMgr.connect()to return the client on first connection (missingme = clientassignment)Docker infrastructure (dev-support/ranger-docker)
docker-compose.ranger-audit-dispatcher-opensearch.ymlfor the dispatcher containerranger-audit-dispatcher-opensearch-site.xmldispatcher configurationdepends_on: service_healthyto fix keytab provisioning race conditionranger-admin-install-postgres.propertiesupdated withaudit_store=opensearchoptionHow was this patch tested?
Unit tests (33 tests):
End-to-end validated locally (Docker):
audit_store=opensearch) → Audit Ingestor → OpenSearch Dispatcher/service/assets/accessAuditAPIDesign decisions
audit_store=opensearchconfig namespace — separate fromelasticsearch, no compatibility hacksranger-audit-dest-osmodule mirrorsdest-es/dest-solrarchitecture for plugin-direct writes