Skip to content

Support for managing revoked certs #18982

Open

Description

@stensonb

Authenticating users via x509 certs is important, but the project seems to be missing a mechanism to revoke certs (without throwing the entire chain away and regenerating ALL certs for all users).

It would be great to be able to declare which certs are invalid, and have the kube-apiserver, kubelets, and all other cert-dependent services deny service for requests with the now-invalid cert.

https://en.wikipedia.org/wiki/OCSP_stapling appears to be one way to solve this.

FYI - this is the same idea as the issue with CoreOS: etcd-io/etcd#4034

Activity

  1. roberthbailey commented on Jan 4, 2016

    @roberthbailey
    Contributor

    @stensonb That is a good observation.

    /cc @ncdc @stephenR

  2. ncdc commented on Jan 4, 2016

    @ncdc
    Member
  3. added
    sig/authCategorizes an issue or PR as relevant to SIG Auth.
    and removed on Apr 12, 2016
  4. jimmycuadra commented on May 26, 2016

    @jimmycuadra
    Contributor

    Somewhat related, a better story around managing the lifecycle of TLS certs/keys in general. See https://github.com/kubernetes/kubernetes/issues/25379.

  5. tmegow commented on Sep 20, 2017

    @tmegow

    +1

  6. fejta-bot commented on Jan 6, 2018

    @fejta-bot

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.

    Prevent issues from auto-closing with an /lifecycle frozen comment.

    If this issue is safe to close now please do so with /close.

    Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
    /lifecycle stale

  7. 54 remaining items

  8. k8s-ci-robot commented on Mar 22, 2026

    @k8s-ci-robot
    Contributor

    @smarticu5: The label(s) /label wg/security-audit cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor, ci-short, ci-extended, ci-full, official-cve-feed. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

    Details

    In response to this:

    I'm labelling this finding as wg/security-audit as #81111 was a duplicate of this issue.

    /label wg/security-audit

    @liggitt if this isn't a planned feature, should we add the triage/unplanned label?

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

  9. smarticu5 commented on Mar 22, 2026

    @smarticu5

    /wg security-audit

  10. lentzi90 commented on Apr 24, 2026

    @lentzi90
    Contributor

    I just wanted to highlight that the issue description mentions OCSP stapling (https://en.wikipedia.org/wiki/OCSP_stapling) but the current discussion seem to be only about CRL. Has there been any investigations or discussions in this direction?

    As I see it, OCSP stapling would address the concerns of 1 (availability, complexity and runtime cost) by pushing the cost on the clients instead. Server side verification would be straight forward. Any thoughts about this?

  11. remram44 commented on Apr 24, 2026

    @remram44

    Having to run an OCSP server and handle many requests to it just to handle the couple of certificates that I will ever revoke... We lost the plot.

  12. XANi commented on Apr 24, 2026

    @XANi

    Exactly. CRL works just fine in small controlled environments and requires zero changes on client side or spinning up new servers and distributing single CRL file to a bunch of k8s servers is trivial for any org with any half decent configuration management setup

  13. lentzi90 commented on Apr 27, 2026

    @lentzi90
    Contributor

    Having to run an OCSP server and handle many requests to it just to handle the couple of certificates that I will ever revoke...

    I can understand this perspective as well. For an operator, the OCSP alternative probably means more work. However, I think the main concern here is around Kubernetes as a project. I would be interested to know if someone has looked into the feasibility of it. Perhaps it would be easier, even though it might mean more operational overhead outside of Kubernetes.

    Exactly. CRL works just fine in small controlled environments and requires zero changes on client side or spinning up new servers and distributing single CRL file to a bunch of k8s servers is trivial for any org with any half decent configuration management setup

    What about larger, complex and dynamic environments? Bare metal, air-gapped deployments with external CA? I am not saying CRL is a no-go, just that "small controlled environments" may not be where this is needed.

  14. StephanX commented on Apr 27, 2026

    @StephanX

    What about larger, complex and dynamic environments?

    Make a ball park guess at how many revoked certificates might be in a large, complex, dynamic environment? Dozens? Maybe even a couple hundred? Like, say, less than a kilobyte worth of data? A trivial amount of data to reference and propagate?

    That's the frustration with this nine year old issue; solving the problem seems ridiculously easy, but the scope around how to approach it has ballooned to a point where it doesn't seem like it will ever be seriously addressed.

  15. raesene commented on Apr 27, 2026

    @raesene

    One interesting point here is that the Kubernetes project already has a pattern for effective revocation of credentials, which is having another object which is referenced from the credential and when the referenced object is removed, the credential is invalidated. This pattern works in Service account tokens and pod certificates.

    One option might have been extending that pattern to have a referenced object for all issued certificated (e.g. a certificate object) and just allow admins to delete the object for certs that are to be revoked. This would have the side benefit of allowing for credential review/auditing, which would be nice.

  16. lentzi90 commented on Apr 27, 2026

    @lentzi90
    Contributor

    I looked around regarding OCSP and it seems it has very limited support in go. Found these two issues related to it:

    So that is out then for the foreseeable future I guess.

  17. remram44 commented on Apr 27, 2026

    @remram44

    One interesting point here is that the Kubernetes project already has a pattern for effective revocation of credentials, which is having another object which is referenced from the credential and when the referenced object is removed, the credential is invalidated. This pattern works in Service account tokens and pod certificates.

    This is interesting! Indeed, if I could just delete the Node to lock out a kubelet, that would solve the entire problem for me. Unfortunately what actually happens now is the kubelet holding a valid certificate can recreate its Node and re-join.

  18. XANi commented on Apr 27, 2026

    @XANi

    @lentzi90

    What about larger, complex and dynamic environments? Bare metal, air-gapped deployments with external CA? I am not saying CRL is a no-go, just that "small controlled environments" may not be where this is needed.

    Even at scale of 10k developers (let's assume they all use same cluster and you use good practice of short lived certs) you'd still have maybe 1k certs on the list at any given time, that's few tens of kb and an amortized O(1) lookup in a hash

  19. lentzi90 commented on Jun 17, 2026

    @lentzi90
    Contributor

    Broadly, I see ~3 possible approaches:

    1. Implement CRL lookups based on content of presented certificates. When this was discussed in the past, the complexity, availability risk, and runtime cost of letting presented certificates drive remote lookups server-side was considered a non-starter

    2. Design an administrator-configured way of revoking / blocking use of certificates (static CRL, or bespoke list of disallowed certificate serial numbers or subjects or fingerprints, etc). This would be a decent amount of effort that would only enable a very narrow capability. I wouldn't be in favor of this approach.

    3. A general way for admins to validate the output of the authentication layer. We already have this for JWT authentication (search for userValidationRules examples in the documentation), and there has been discussion (2025-09-10 sig-auth) of expanding this capability to be able to see / verify authentications from any source, including x509 authentication. Since x509 authentication makes information about the client certificate visible in the authenticated user (as an authentication.k8s.io/credential-id field set to X509SHA256=<SHA256-hash-of-certificate>), this could be used to revoke particular certificates. This would seem the most promising direction to me, putting effort into a capability that would allow for blocking use of specific certificates along with many other use cases.

    I have tried to explore alternative 3 from @liggitt 's comment above, in #139812. So far it seems to work well for me and I have gotten encouraging feedback internally also.
    It is obviously just exploratory work and hence pushed as a draft. I would be very interested in your thoughts though.
    Does the approach look valid? Is this something we could move forward with? Do we need a KEP in that case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/backlogHigher priority than priority/awaiting-more-evidence.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.sig/authCategorizes an issue or PR as relevant to SIG Auth.sig/securityCategorizes an issue or PR as relevant to SIG Security.wg/security-auditCategorizes an issue or PR as relevant to WG Security Audit.

    Type

    No type

    Projects

    • Status
      Needs KEP

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions