Sanchit crdb 58929 san rpc#162582
Draft
sanchit-CRL wants to merge 3 commits intocockroachdb:masterfrom
Draft
Conversation
* 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
Contributor
|
Merging to
|
|
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. |
Member
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.
No description provided.