Skip to content

Proposal: configure the TLS subject builder via the Kubernetes Operator - #146

Merged
k-wall merged 3 commits into
kroxylicious:mainfrom
AdityaThakur1998:proposal-tls-subject-builder-crd
Oct 27, 2026
Merged

k-wall merged 3 commits into
kroxylicious:mainfrom
AdityaThakur1998:proposal-tls-subject-builder-crd

Conversation

@AdityaThakur1998

@AdityaThakur1998 AdityaThakur1998 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Design proposal for kroxylicious/kroxylicious#3032 — configuring the TLS subject builder through the Kubernetes Operator.

What it proposes

An optional tlsSubjectBuilder field on VirtualKafkaCluster, with a type and a configTemplate, matching the shape of the proxy's existing virtual cluster subjectBuilder. As with KafkaProtocolFilter, configTemplate can refer to Secrets and ConfigMaps, which the Operator resolves before writing the result into the generated proxy configuration. When the field is unset, behaviour is the same as today, so the change is purely additive.

The proxy already supports subject builders; the Operator just has no way to set one. The proposal exposes an existing capability rather than adding a new one, and needs no proxy changes.

Why it matters

Authorization decides what a client may do based on its principal. Clients that authenticate with SASL get a principal from the SASL filters. Clients that authenticate with a TLS client certificate need a subject builder to turn the certificate into a principal, and under the Operator there's no way to configure one. Operator users who rely on certificates therefore can't use Authorization at all.

Points reviewers may want to weigh in on

  • The field name. tlsSubjectBuilder was chosen over subjectBuilder, because the SASL filters already use subjectBuilder for something different. The cost is that the name differs from the proxy's own config key.
  • Validation. Following filters, the Operator checks that referenced Secrets and ConfigMaps exist but passes the rest of configTemplate through unchecked, and the proxy rejects invalid config at startup. One proxy serves all its virtual clusters, so one cluster's mistake stops the proxy for all of them. Operator-side validation is listed as future work, covering all plugin config.
  • Inline rather than a shared resource. A separate resource would let rules be shared, and locked down with Kubernetes permissions separately from the cluster. It's rejected here as too much machinery for a few lines of rules. Feedback is welcome on whether anyone needs separate ownership.
  • Scope. SASL subject builders are out of scope. So is sidecar mode, because the app-to-sidecar connection is plaintext over localhost, so there's no client certificate.

Assisted-by: Claude Sonnet 4.6 noreply@anthropic.com

…erator

Co-Assisted-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: AdityaThakur1998 <adthakur@redhat.com>

@tombentley tombentley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AdityaThakur1998 thanks for pushing this forward, it would be nice to support for sure. Mostly this is a good proposal, but I feel the need to push back a bit on what you're saying about the need for secret interpolation.

Comment thread proposals/146-tls-subject-builder-crd.md
Comment thread proposals/000-tls-subject-builder-crd.md Outdated
Comment thread proposals/000-tls-subject-builder-crd.md Outdated
AdityaThakur1998 added a commit to AdityaThakur1998/design that referenced this pull request Oct 22, 2026
…us#146)

Use configTemplate with the same Secret and ConfigMap references as
KafkaProtocolFilter, so custom subject builders can take credentials
without them appearing in the clear. Clarify that SASL subject builders
are out of scope, and that certificate fields can map to any principals.

Co-Assisted-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: AdityaThakur1998 <adthakur@redhat.com>
AdityaThakur1998 added a commit to AdityaThakur1998/design that referenced this pull request Oct 22, 2026
…us#146)

Use configTemplate with the same Secret and ConfigMap references as
KafkaProtocolFilter, so custom subject builders can take credentials
without them appearing in the clear. Clarify that SASL subject builders
are out of scope, and that certificate fields can map to any principals.

Co-Assisted-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: AdityaThakur1998 <adthakur@redhat.com>
@AdityaThakur1998
AdityaThakur1998 force-pushed the proposal-tls-subject-builder-crd branch from eb66025 to d9fc504 Compare October 22, 2026 13:57
…us#146)

Use configTemplate with the same Secret and ConfigMap references as
KafkaProtocolFilter, so custom subject builders can take credentials
without them appearing in the clear. Clarify that SASL subject builders
are out of scope, and that certificate fields can map to any principals.

Co-Assisted-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: AdityaThakur1998 <adthakur@redhat.com>
@AdityaThakur1998
AdityaThakur1998 force-pushed the proposal-tls-subject-builder-crd branch from d9fc504 to b83921d Compare October 22, 2026 14:46
@AdityaThakur1998
AdityaThakur1998 marked this pull request as ready for review October 22, 2026 14:47
@AdityaThakur1998
AdityaThakur1998 requested a review from a team as a code owner October 22, 2026 14:47

@tombentley tombentley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AdityaThakur1998 this LGTM

@k-wall k-wall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nits and comments, but LGTM

Comment thread proposals/146-tls-subject-builder-crd.md
Comment thread proposals/146-tls-subject-builder-crd.md Outdated
Comment thread proposals/146-tls-subject-builder-crd.md
Clarify that the proxy falls back to anonymous when no subject builder
is configured. Move the per-ingress alternative from rejected to future
work, noting it needs proxy changes and is deferred until requested.

Co-Assisted-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: AdityaThakur1998 <adthakur@redhat.com>
@k-wall
k-wall merged commit 2850616 into kroxylicious:main Oct 27, 2026
2 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.

3 participants