Skip to content

Conversation

snorwin
Copy link
Member

@snorwin snorwin commented Sep 10, 2025

What type of PR is this?

/kind gep

What this PR does / why we need it:
What/Why/Who for enhancing Client Certificate Validation with Certificate Pinning.

Which issue(s) this PR fixes:

Fixes #4078

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/gep PRs related to Gateway Enhancement Proposal(GEP) labels Sep 10, 2025
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 10, 2025
@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 10, 2025
@snorwin
Copy link
Member Author

snorwin commented Sep 10, 2025

/cc @kflynn @rikatz @kl52752

Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@rikatz
Copy link
Member

rikatz commented Sep 10, 2025

/assign

# obsoletes indicates that a GEP makes the linked GEP obsolete, and completely
# replaces that GEP. The obsoleted GEP MUST have its obsoletedBy field
# set back to this GEP, and MUST be moved to Declined.
obsoletes: {}
Copy link
Member

Choose a reason for hiding this comment

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

fun fact, this is an array per GEP API definition, and setting it as "{}" will break people trying to programatically unmarshal/decode this (see me fighting and failing against it at #4075

So the right thing here is to set these fields as [] (empty array) and not as {} (empty object).

Take a look into my PR above, you will see me changing this on a lot of places :)

[RFC8174]: https://www.rfc-editor.org/rfc/rfc8174

## What
Enhance the existing Client Certificate Validation defined in [GEP-91](../gep-91/index.md) by introducing support for certificate pinning. This allows specifying one or more certificate or public key hashes (SPKI) that are considered valid for client connections. During TLS client authentication, the Gateway will validate not only against the configured CAs, but also against the pinned certificates or keys. This provides a mechanism to restrict allowed clients to a narrowly defined set of certificates, even if the CA trust domain is broad.
Copy link
Member

@rikatz rikatz Sep 10, 2025

Choose a reason for hiding this comment

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

not really important at this moment, but do we/should we care also about validating the certificate CN or some other field? see as a reference: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#client-certificate-authentication

Copy link
Member Author

@snorwin snorwin Sep 10, 2025

Choose a reason for hiding this comment

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

IMO CN and SAN validation for client certificates should be part of the Gateway API too, but I would prefer a dedicated GEP for it.

Copy link
Member

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

Choose a reason for hiding this comment

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

During TLS client authentication, the Gateway will validate not only against the configured CAs, but also against the pinned certificates or keys.

I think that we should allow configuring validation either with CAs or by certificate pinning. Combining two of them with AND does not make sense to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the GEP to make it clearer that certificate pinning is intended as an alternative to the existing CA-based validation of client certificates.

Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: snorwin
Once this PR has been reviewed and has the lgtm label, please assign danwinship for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/gep PRs related to Gateway Enhancement Proposal(GEP) release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GEP: Certificate Pinning for Client Certificate Validation
4 participants