Repository navigation
RANGER-5827: Add shared Kafka client authentication module with support for both SASL/OAUTHBEARER and SASL/GSSAPI - #1297
Merged
Conversation
kumaab
marked this pull request as draft
October 8, 2026 01:55
kumaab
force-pushed
the
kafka-client-auth
branch
3 times, most recently
from
October 12, 2026 23:50
d5b56be to
d87d99c
Compare
…s the default mechanism
- new module agents-audit/kafka-client-auth (ranger-kafka-client-auth)
- RangerKafkaClientSecurityConfig builds security.protocol / sasl.* keys
from <prefix>.kafka.* properties for producers, consumers and admin clients
- RangerKafkaOAuthBearerLoginCallbackHandler presents a JWT read from a
file:// URL and re-reads it on every login so rotated tokens are picked up
- audit-ingestor, audit-dispatcher (all backends) and the topic bootstrap now
call the helper instead of building a Kerberos-only JAAS string each
- audit-ingestor also loads the site XML given by -Daudit.config after the
packaged classpath copy, so an explicit config file wins
- tagsync: TAG_SOURCE_ATLAS_KAFKA_SASL_MECHANISM and
TAG_SOURCE_ATLAS_KAFKA_OAUTH_TOKEN_URL install properties rendered into
atlas-application.properties; module added to the tagsync distribution
- ranger-docker: broker accepts GSSAPI and OAUTHBEARER; ranger-kafka mints and
rotates dev tokens into a shared volume; KAFKA_SASL_MECHANISM in .env selects
OAUTHBEARER (default) or GSSAPI for the ingestor, dispatchers and tagsync
- behaviour change: with a SASL protocol the default sasl.mechanism is now
OAUTHBEARER and GSSAPI must be set explicitly; no sasl.* keys are set for
PLAINTEXT/SSL
kumaab
force-pushed
the
kafka-client-auth
branch
from
October 13, 2026 00:03
d87d99c to
746c8df
Compare
kumaab
marked this pull request as ready for review
October 13, 2026 01:11
ramackri
reviewed
Oct 14, 2026
mneethiraj
reviewed
Oct 15, 2026
mneethiraj
reviewed
Oct 15, 2026
mneethiraj
reviewed
Oct 15, 2026
mneethiraj
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Ranger's Kafka clients (audit-ingestor, audit-dispatchers, tagsync) each assemble their own SASL settings and only support Kerberos keytabs. Kafka's bundled
OAUTHBEARERhandler reads a file:// token once and caches it, so rotated platform tokens, such as Kubernetes projected service-account tokens, leave the client presenting an expired token.kafka.sasl.jaas.loginModuleName,kafka.sasl.jaas.loginModuleControlFlagand anykafka.sasl.jaas.option.<name>, so Krb5LoginModule options such asuseTicketCacheare configuration, not code.<prefix>.kafka.sasl.*and<prefix>.kafka.ssl.*pass through and override.RangerKafkaOAuthBearerLoginCallbackHandlerpresents a JWT read from a file:// URL. It re-reads the file on every login and refresh, so the client always presents the current token after rotation. http(s):// endpoints use Kafka’s own client-credentials handler.TAG_SOURCE_ATLAS_KAFKA_SASL_MECHANISMandTAG_SOURCE_ATLAS_KAFKA_OAUTH_TOKEN_URLrendered into atlas-application.properties; module added to the tagsync distribution.GSSAPIandOAUTHBEARER; ranger-kafka mints and rotates dev tokens into a shared volume;Upgrade note for GSSAPI deployments: the
Krb5LoginModuleoptionsuseKeyTab,storeKeyanduseTicketCacheare no longer hardcoded. The shipped site XML templates set them as<prefix>.kafka.sasl.jaas.option.*; an existingranger-audit-ingestor-site.xmlorranger-audit-dispatcher-*-site.xmlneeds those three properties added.How was this patch tested?
KERBEROS_ENABLED=true, OpenSearch profile), fresh build and cold start, with the broker acceptingGSSAPIandOAUTHBEARER:OAUTHBEARER(shipped default): audit-ingestor, audit-dispatcher-opensearch and tagsync logged in through RangerKafkaOAuthBearerLoginCallbackHandler; denied Kafka accesses by a test user were audited end to end into OpenSearch; all three re-logged in with the rotated token at Kafka’s scheduled refresh.GSSAPI(mechanism set to GSSAPI in the ingestor YAML, dispatcher XML and tagsync install properties): all three authenticated with their keytabs and audits flowed end to end.Ingestor Logs