Skip to content

security: make SAN authN cluster setting publicly available#162583

Merged
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
sanchit-CRL:sanchit_CRDB_58928_cluster_setting
Mar 17, 2026
Merged

security: make SAN authN cluster setting publicly available#162583
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
sanchit-CRL:sanchit_CRDB_58928_cluster_setting

Conversation

@sanchit-CRL
Copy link
Copy Markdown
Collaborator

@sanchit-CRL sanchit-CRL commented Feb 6, 2026

  • Previously, the security.client_cert.san_required.enabled cluster setting was marked as reserved (internal-only) while the SAN-based authentication feature was being developed and tested.
  • This also changes WithReportable(false) → WithReportable(true), which means the setting value will now be included in diagnostic reports.

Epic: CRDB-58928

Resolves: #164136

Release note (security update):
The new cluster setting
security.client_cert.san_required.enabled enables Subject Alternative Name (SAN) based authentication for client certificates. When enabled, CockroachDB validates client identities using SAN attributes (URIs, DNS names, or IP addresses) from X.509 certificates instead of or in addition to the certificate's Common Name field.

Key capabilities include:

  • For privileged users (root and node): SAN identities are validated against values configured via the --root-cert-san and --node-cert-san startup flags, with automatic fallback to Distinguished Name validation when both methods are configured.

  • For database users: SAN identities are extracted from client certificates and mapped to database usernames using Host-Based Authentication (HBA) identity mapping rules, allowing a single certificate with multiple SAN entries to authenticate as different database users based on context.

  • Multiple identity attributes: A single certificate can contain multiple SAN entries (e.g., URI for service identity, DNS for hostname, IP for network location), providing flexible authentication options.

This authentication method works across both SQL client connections and internal RPC communication between cluster nodes, ensuring consistent identity verification throughout the system. Organizations using modern certificate management systems and service identity frameworks can now leverage their existing infrastructure for database authentication without requiring certificate reissuance or CN-based naming conventions.

@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented Feb 6, 2026

😎 Merged successfully - details.

@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented Feb 6, 2026

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@sanchit-CRL sanchit-CRL force-pushed the sanchit_CRDB_58928_cluster_setting branch 2 times, most recently from 9cced5c to 803a165 Compare February 24, 2026 10:31
@sanchit-CRL sanchit-CRL changed the title Sanchit crdb 58928 cluster setting security: make SAN authN cluster setting publicly available Feb 24, 2026
@sanchit-CRL sanchit-CRL force-pushed the sanchit_CRDB_58928_cluster_setting branch from 803a165 to 7afd13b Compare March 13, 2026 03:48
@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented Mar 13, 2026

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@sanchit-CRL sanchit-CRL marked this pull request as ready for review March 13, 2026 03:48
@sanchit-CRL sanchit-CRL requested review from a team as code owners March 13, 2026 03:48
@sanchit-CRL sanchit-CRL requested a review from souravcrl March 13, 2026 03:48
Copy link
Copy Markdown
Contributor

@souravcrl souravcrl left a comment

Choose a reason for hiding this comment

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

LGTM. Two minor suggestions:

  1. Release note style: The release note is thorough but quite long for a settings doc. Consider tightening the opening to lead with the user action rather than the implementation detail:

    Release note (security update): The new cluster setting
    `security.client_cert.san_required.enabled` enables Subject Alternative
    Name (SAN) based authentication for client certificates. When enabled,
    CockroachDB validates client identities using SAN attributes (URIs, DNS
    names, or IP addresses) from X.509 certificates instead of or in addition
    to the certificate's Common Name field.
    

    The key capabilities list is good — just the intro could be more direct.

  2. PR description: Worth mentioning that this also changes WithReportable(false)WithReportable(true), which means the setting value will now be included in diagnostic reports. This is a minor but distinct behavior change from just making it public.

* Previously, the security.client_cert.san_required.enabled
cluster setting was marked as reserved (internal-only)
while the SAN-based authentication feature was
being developed and tested.

Epic: CRDB-58928

Resolves: cockroachdb#164136

Release note (security update): The new cluster setting
`security.client_cert.san_required.enabled` enables Subject
Alternative Name (SAN) based authentication for client
certificates. When enabled, CockroachDB validates client
identities using SAN attributes (URIs, DNS names, or
IP addresses) from X.509 certificates instead of or in
addition to the certificate's Common Name field.

Key capabilities include:

- For privileged users (root and node): SAN identities
are validated against values configured via the
--root-cert-san and --node-cert-san startup flags,
with automatic fallback to Distinguished Name
validation when both methods are configured.

- For database users: SAN identities are extracted from
client certificates and mapped to database usernames
using Host-Based Authentication (HBA) identity mapping
rules, allowing a single certificate with multiple SAN
entries to authenticate as different database users
based on context.

- Multiple identity attributes: A single certificate can
contain multiple SAN entries (e.g., URI for service
identity, DNS for hostname, IP for network location),
providing flexible authentication options.

This authentication method works across both SQL client
connections and internal RPC communication between
cluster nodes, ensuring consistent identity verification
throughout the system. Organizations using modern
certificate management systems and service identity
frameworks can now leverage their existing infrastructure
for database authentication without requiring certificate
reissuance or CN-based naming conventions.
@sanchit-CRL sanchit-CRL force-pushed the sanchit_CRDB_58928_cluster_setting branch from 7afd13b to 23ad59d Compare March 16, 2026 16:32
@sanchit-CRL
Copy link
Copy Markdown
Collaborator Author

/trunk merge

@trunk-io trunk-io Bot merged commit 1f3efb7 into cockroachdb:master Mar 17, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: make SAN authN cluster setting publicly available

3 participants