Skip to content

Check OCSP as part of determining if the certificate is due for renewal #1028

Closed

Description

@bmw

There is logic in certbot/storage.py to say that a certificate needs to renewed if it has been revoked, but the storage.py function that determines if a certificate revoked always returns False. We have code in certbot/ocsp.py to obtain the OCSP status of the certificate and we should make use of it.

I think we should be careful here to only say that a certificate needs to be renewed if we can verify that the certificate is revoked. If we fail to obtain/validate the OCSP response for example, we should not say the certificate needs to be renewed. We probably also do not want to crash Certbot in this case.

Activity

  1. modified the milestones: 0.3.0, Feature: renewer on Dec 15, 2015
  2. modified the milestones: 0.5.0, 0.4.0 on Jan 28, 2016
  3. pde commented on Jan 28, 2016

    @pde
    Member

    Suggestion: at revocation time, ask a question about deleting the renewal conf.

  4. modified the milestones: 0.5.0, 0.4.0 on Jan 28, 2016
  5. modified the milestones: 0.6.0, 0.5.0 on Feb 18, 2016
  6. 56 remaining items

  7. changed the title [-]Revocation and the renewer[/-] [+]Check OCSP as part of determining if the certificate is due for renewal[/+] on Jun 12, 2019
  8. tdelmas commented on Mar 3, 2020

    @tdelmas

    I worry that we could find ourselves in the future scrambling to implement this in response to mass revocation CA side and wishing we would have done it sooner

    The time has come. https://community.letsencrypt.org/t/revoking-certain-certificates-on-march-4/114864/15

  9. Chaz6 commented on Mar 3, 2020

    @Chaz6

    Please consider adding this soon!

  10. tdelmas commented on Mar 3, 2020

    @tdelmas

    @bmw Any opinion about an ACME entry point to check if the certificate needs to be renewed? It could solve the problem of the OCSP cache and allow the renewals before the effective revocation.

  11. pgporada commented on Mar 3, 2020

    @pgporada

    There is the possibility that sidestepping the cache and hitting our origin directly will cause massive service degradation. The OCSP cache offload is ~90% - 95% of the traffic (depending on month) at our CDN which equates to hundreds of terabytes that don't hit our loadbalancers. There was an incident back in May of 2017 where the OCSP cache was purged and we had quite the painful incident.

  12. tdelmas commented on Mar 3, 2020

    @tdelmas

    (sorry for the off-topic) Also, fetching OCSP for stapling may help: https://twitter.com/caddyserver/status/1234874273724084226 that way, when an OCSP response fetched says "revoked" there is still time to renew the cerficate until the previous OCSP response is expired, so no downtime!

  13. bmw commented on Mar 3, 2020

    @bmw
    MemberAuthor

    I worry that we could find ourselves in the future scrambling to implement this in response to mass revocation CA side and wishing we would have done it sooner

    The time has come. https://community.letsencrypt.org/t/revoking-certain-certificates-on-march-4/114864/15

    Yeah. I spent this morning doing more scrambling than I wish I would have had to, but I have a PR to add this feature at #7829.

    @bmw Any opinion about an ACME entry point to check if the certificate needs to be renewed? It could solve the problem of the OCSP cache and allow the renewals before the effective revocation.

    Because of the reasons mentioned by Phil and because I believe it would require hardcoding some URLs that are not generalizable and could change in the future, I personally don't think we should bypass the cache in our code.

    We could maybe provide code snippets on https://community.letsencrypt.org to help people here if people have ideas beyond what Let's Encrypt wrote at https://community.letsencrypt.org/t/revoking-certain-certificates-on-march-4/114864, but since changing Certbot code is often difficult because it gets entombed in various Linux distros, I personally don't think we should do anything dramatic or specific for this issue in Certbot itself.

    (sorry for the off-topic) Also, fetching OCSP for stapling may help: https://twitter.com/caddyserver/status/1234874273724084226 that way, when an OCSP response fetched says "revoked" there is still time to renew the cerficate until the previous OCSP response is expired, so no downtime!

    Good idea! I think between my PR and #7649, we may have this pretty soon in Certbot as well at least for Apache users who enable OCSP prefetching.

  14. jsha commented on Mar 3, 2020

    @jsha
    Contributor

    tdelmas> Any opinion about an ACME entry point to check if the certificate needs to be renewed? It could solve the problem of the OCSP cache and allow the renewals before the effective revocation.
    phil> There is the possibility that sidestepping the cache and hitting our origin directly will cause massive service degradation.

    I think you two are talking about different things. I believe tdelmas is talking about specifying, and implementing, a new request type that can be used to tell clients in advance of revocation that they need to renew. I think this is a great idea.

    I think Phil is talking about making requests directly to our OCSP origins, which I think we are all in agreement is not a good idea.

  15. tdelmas commented on Mar 3, 2020

    @tdelmas

    I believe tdelmas is talking about specifying, and implementing, a new request type that can be used to tell clients in advance of revocation that they need to renew.

    @jsha Yes, in advance (or not, during the cache period): I think the cost is inferior to an OCSP response. I'm too against the bypass of the OCSP cache. #7649 will reduce the problem but to fully avoid downtime, clever OCSP stapling or that API is needed in my opinion.

  16. added a commit that references this issue on Mar 3, 2020
    3147026
  17. modified the milestones: Important, 1.3.0 on Mar 5, 2020
  18. added a commit that references this issue on Apr 3, 2020
    2df9050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions