GithubHelp home page GithubHelp logo

isabella232 / letsencrypt-caa-bug-checker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jetstack/letsencrypt-caa-bug-checker

0.0 0.0 0.0 34 KB

Tool to check your Kubernetes cluster for certificates affected by Let's Encrypt's CAA rechecking bug

License: MIT License

Go 100.00%

letsencrypt-caa-bug-checker's Introduction

letsencrypt-caa-bug-checker

This tool will check all cert-manager Certificate resources installed in your cluster to ensure they are not affected by the Let's Encrypt CAA Rechecking Bug.

It will:

  1. Query your Kubernetes cluster for all Certificate resources
  2. Find all Secret resources managed by Certificate resources
  3. Check the serial number of each certificate against the publicly available list of serial numbers that will be revoked
  4. Trigger cert-manager to renew any certificates that are affected by the bug

Pre-requisites

This tool only works with cert-manager v0.11 onwards, as it depends on the v1alpha2 API. If you are running an older version of cert-manager, please upgrade by following the upgrade guide.

Your Kubernetes user account will need the following permissions:

  • Certificate resources (cert-manager.io/v1alpha2): LIST
  • CertificateRequest resources (cert-manager.io/v1alpha2): LIST, DELETE
  • Secret resources (core/v1): LIST, UPDATE

Fetching the list of revoked serials

This tool requires a copy of the full list of serial numbers that Let's Encrypt have notified for revocation.

Use the snippet below to download and extract the file. Decompressed, the file is approximately 1.2GB, so please ensure you have sufficient free space for extraction.

wget -c https://d4twhgtvn0ff5.cloudfront.net/caa-rechecking-incident-affected-serials.txt.gz
zcat < caa-rechecking-incident-affected-serials.txt.gz > serials.txt

This snippet is based on the script in the prepare-lecaa file in the hannob/lecaa repository, with minor modifications.

Checking for affected certificates

First, download or build a copy of the letsencrypt-caa-bug-checker tool from this GitHub repository.

First, perform a check of all the Certificates in your cluster to see if any are affected:

./letsencrypt-caa-bug-checker --affected-serials-file serials.txt

You should see the tool check all resources in your cluster, and after a few seconds it should print something like:

...
2020/03/04 16:13:06 +++ Checking Secret resource for Certificate example/demo-prod
2020/03/04 16:13:13 Finished analyzing certificates, results:
2020/03/04 16:13:13   Skipped/unable to check: 0
2020/03/04 16:13:13   Unaffected certificates: 16
2020/03/04 16:13:13   Affected certificates: 3

By default, the tool will NOT automatically trigger renewals, and will ONLY print out analysis information.

Triggering a renewal

To actually trigger a renewal of these affected certificates, you must add the --renew flag to your command invocation:

./letsencrypt-caa-bug-checker --affected-serials-file serials.txt --renew

A number of warnings will be printed, giving you the opportunity to cancel in case you have accidentally invoked the command incorrectly.

The tool will now go through and manually trigger a renewal for each affected Certificate resource.

It does this by changing the cert-manager.io/issuer-name annotation on the Secret resource for each certificate, causing cert-manager to re-request a new certificate.

letsencrypt-caa-bug-checker's People

Contributors

munnerz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.