Skip to content

Sanchit crdb 58929 san rpc#162582

Draft
sanchit-CRL wants to merge 3 commits intocockroachdb:masterfrom
sanchit-CRL:sanchit_CRDB_58929_san_rpc
Draft

Sanchit crdb 58929 san rpc#162582
sanchit-CRL wants to merge 3 commits intocockroachdb:masterfrom
sanchit-CRL:sanchit_CRDB_58929_san_rpc

Conversation

@sanchit-CRL
Copy link
Collaborator

No description provided.

* authCert initially didn't have provision to
handle multiple system identites such as SAN.
This PR adds the functionality within the
authCert function to extract and set SAN
attrubutes from the cert in the order
URI, IP and DNS.
* Enhance the AuthBehavior struct containing
all identity related information with the
SAN attributes and the newly introduced
role mapper for SAN. Each of these attributes
include thier getter ans setter functions.
* Based on the cluster setting for SAN enabled
the mapper is set.
* If the cluster setting is enabled, then the
SAN identioties are extracted from the cert
and added to the AuthBehavior struct.

Release note: None

Epic: CRDB-58374
* Client cert auth only validated the
Subject Distinguished Name (DN) and Common Name (CN)
* Modern certificate-based authN uses SANs instead of
or in addition to Subject DNs or CN
* Multiple SAN entries in a certificate should be
mappable to database users through identity mapping rules
* This PR implements SAN extraction from client
certificates in standardized format (SAN:TYPE:value)
* Uses subset validation for root and node users: configured
SANs in the start-up flag must all be present in the certificate.
* Implements OR logic between SAN and
Subject DN validation when both are enabled as per the PRD and
does not fallback to CN in case SAN is enabled.
* For NON-root/node users, SANs are used only
for identity mapping, not validation.

Release note: None

Epic: CRDB-58375
* Previously, RPC authentication for root and node users
relied solely on Distinguished Name (DN) validation
when configured, falling back to username and
tenant scope checks from the certificate's
Common Name and SAN fields.
* This approach did not leverage Subject Alternative Name
identities for authenticating these privileged
system users, even when the client_cert_san_required
cluster setting was enabled.
* To address this, this patch adds SAN-based authentication
support for root and node users in RPC authentication.
When client_cert_san_required is enabled, the
validateRootOrNodeClientCert function now:
1. First attempts SAN validation using CheckCertSANMatchesRootOrNodeSAN
2. Falls back to DN validation if SAN validation fails
3. Does NOT fall back to the legacy scope-based validation
     (checkRootOrNodeInScope) when SAN is explicitly enabled.

Release note: None

Epic: CRDB-58929
@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 6, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@blathers-crl
Copy link

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
Member

This change is Reviewable

@cockroach-teamcity cockroach-teamcity added the X-perf-gain Microbenchmarks CI: Added if a performance gain is detected label Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

X-perf-gain Microbenchmarks CI: Added if a performance gain is detected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants