Skip to content

[improve][broker] PIP-485: Configurable mTLS principal mapping (SAN sources and DN mapping rules)#26021

Open
PavelZeger wants to merge 6 commits into
apache:masterfrom
PavelZeger:pip-484-mtls
Open

[improve][broker] PIP-485: Configurable mTLS principal mapping (SAN sources and DN mapping rules)#26021
PavelZeger wants to merge 6 commits into
apache:masterfrom
PavelZeger:pip-484-mtls

Conversation

@PavelZeger

@PavelZeger PavelZeger commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Motivation

Pulsar's built-in TLS auth provider (AuthenticationProviderTls, in pulsar-broker-common) derives a client's role only from the certificate's first Common Name (CN), and the extraction is hardcoded; if the CN is empty or missing, authentication fails outright. That is a poor fit for two increasingly common
deployments:

  • Enterprise PKI, where identity lives in another DN field (an OU, emailAddress, or the full DN) and re-issuing certificates just to populate the CN isn't practical.
  • SPIFFE/SPIRE and service meshes, where workload identity is a URI SAN (spiffe://...) and the CN is intentionally empty — those certificates are rejected today even though they carry a valid, cryptographically-bound identity.

Apache Kafka solves this declaratively with ssl.principal.mapping.rules (KIP-371). Pulsar has no equivalent for its built-in provider, and writing a custom AuthenticationProvider is a high bar for what should be a few lines of config.

Modifications

This PR adds the PIP-484 design document (pip/pip-484.md) for community discussion and vote. It contains no code changes.

The proposal describes two backward-compatible config options for AuthenticationProviderTls:

  • tlsCertIdentitySource — choose the raw identity: CN (default), DN, or SAN:URI|DNS|EMAIL.
  • tlsAuthPrincipalMappingRules — an ordered list of Kafka-style RULE:/DEFAULT mapping rules.

With both unset, behavior is identical to today (first CN, fail on empty CN). The document also covers the proxy config plumbing, new auth-failure error codes, security considerations, and upgrade/rollback compatibility.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Documentation only: this PR adds the PIP-484 proposal markdown file and contains
no production code. Implementation (with tests) will follow in separate PRs that
reference this PIP, after the proposal is accepted.

Does this pull request potentially affect one of the following parts:

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

@github-actions github-actions Bot added the PIP label Jun 13, 2026
…ces and DN mapping rules)

Add a PIP proposing configurable identity extraction (CN/DN/SAN) and
Kafka-style declarative mapping rules in AuthenticationProviderTls,
keeping today's CN-only behavior as the default.
@PavelZeger PavelZeger changed the title [improve][broker] PIP-484: Configurable mTLS principal mapping (SAN sources and DN mapping rules) [improve][broker] PIP-485: Configurable mTLS principal mapping (SAN sources and DN mapping rules) Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant