Repository navigation
Allow restricting TLS clients to an allowlist of certificate identities - #817
Open
alessandro-verzicco wants to merge 1 commit into
Open
alessandro-verzicco wants to merge 1 commit into
alessandro-verzicco wants to merge 1 commit into
Conversation
With ClientAuth.REQUIRE any certificate signed by the configured CA is accepted, which is too broad when the CA also issues certificates for other services. The new repeatable --tlsallowedclient option (and the MGMT_API_TLS_ALLOWED_CLIENTS env var in the images, comma-separated) additionally requires the client certificate subject CN or one of its DNS/URI/email/IP subject alternative names to match an allowed value. When the option is not set, behaviour is unchanged. Fixes k8ssandra#174 Assisted-By: Claude Code (Claude Opus 5.5)
alessandro-verzicco
marked this pull request as ready for review
October 19, 2026 15:21
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.
Today, with TLS enabled, any client certificate signed by the configured CA is accepted. As described in #174 that is too broad when the CA is shared with other services (e.g. an internal CA issuing
clientAuthcertificates to everything).This adds an optional allowlist of client identities:
--tlsallowedclient <identity>(repeatable), andMGMT_API_TLS_ALLOWED_CLIENTS(comma-separated) in the Cassandra, Cassandra trunk and DSE images::1==0:0:0:0:0:0:0:1), CN / URI / email exactlycreateSSLContext()SslContextBuilder.trustManager(caFile)as before)Implementation is a small
X509ExtendedTrustManager(AllowedClientsTrustManager) that delegates chain validation to the JDK default trust manager built from the same CA file, then checks the identity.In the entrypoints the identities are passed as separate quoted arguments rather than through
MGMT_API_ARGS, so values with spaces (CN=Reaper Client) or glob characters are not split or expanded.Testing
NettyTlsClientAuthTest: allowed client accepted, CA-signed but not allowed client rejected, allowed CN with an untrusted chain rejected, and the allowlist applied throughCli(createSSLContext())AllowedClientsTrustManagerTest: matching rules (CN, multi-valued RDN, DNS case, IPv6 notation, URI/email, ignored SAN types) and rejection of a CA file without certificatesThis change was developed with AI assistance (Claude Code); I reviewed and tested it, and the commit carries an
Assisted-Bytrailer.Fixes #174