A stolen key that still works
Certificate revocation is how a CA says a certificate must not be trusted before its end date, for example after its key was stolen. It only helps if the client checks, and many clients do not.
Short lifetimes are the other answer: a certificate that ends soon stops being useful to a thief soon.
By the end of this lesson
Note
I can explain why a short certificate lifetime limits a stolen key better than revocation does.
Key words
| Word | What it means |
|---|---|
| Revocation | a CA saying a certificate must not be trusted |
| CRL | a certificate revocation list the CA publishes |
| OCSP | a service that answers whether one certificate is revoked |
| Soft fail | trusting a certificate when the revocation check cannot be made |
| Exposure | the days a stolen key can still be used |
| Short-lived certificate | one that lasts days, so revocation matters little |
The cells students fill in are left blank in this preview.
How a certificate is revoked
The holder of the key, or the CA, asks for revocation and gives a reason code, such as 1 for key compromise. ACME has a revokeCert address for this.
The CA then lists the serial number in its CRL, or answers "revoked" over OCSP. Nothing changes in the certificate itself. Every client has to ask.
Get a certificate to revoke
docker exec client step ca certificate client lost.crt lost.key --provisioner acme --standalone --forceShown here, not run. Press Start lab to type it into your own lab’s terminal.
Revoke it as if its key was lost
docker exec client step ca revoke --cert lost.crt --key lost.keyShown here, not run. Press Start lab to type it into your own lab’s terminal.
The CA says it is revoked
The Run printed Certificate with Serial Number and your own long number, then has been revoked. The step client proved it held the key by signing the request with it.
Now ask two questions. Does the certificate still check out? Will the CA renew it?
Does it still verify?
docker exec client step certificate verify lost.crt --roots /ca/certs/root_ca.crt --verboseShown here, not run. Press Start lab to type it into your own lab’s terminal.
Will the CA renew it?
docker exec client step ca renew lost.crt lost.key --forceShown here, not run. Press Start lab to type it into your own lab’s terminal.
What the two checks print
| Run | What it printed | What it means |
|---|---|---|
| verify | certificate validated against roots, then certficiate is valid (step's own spelling) | Signatures and dates still pass: nothing asked about revocation |
| renew | The request lacked necessary authorization to be completed | The CA remembers and refuses |
The cells students fill in are left blank in this preview.
A common mistake
Warning
Many people think a revoked certificate stops working everywhere at once. It stops only for clients that check, and many skip the check or trust the certificate when the check fails. Its end date stops every client.
Why browsers rarely check
A revocation check is a network request on every new connection. It is slow, it tells the CA which sites you visit, and it can be blocked.
So most clients soft fail: when they cannot get an answer, they trust the certificate anyway. A thief who can block the check is never stopped by it.
Count the days a stolen key works
docker exec python python3 steps/exposure.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Stolen on day 1, revoked on day 2
| Lifetime in days | If the client checks | If it does not |
|---|---|---|
| 398 | 1 | 397 |
| 200 | 1 | 199 |
| 100 | 1 | 99 |
| 47 | 1 | 46 |
| 6 | 1 | 5 |
The cells students fill in are left blank in this preview.
A short life does revocation's job
When nobody checks, only the end date limits the damage. Cut the lifetime from 398 days to 47 and a thief's window falls from 397 days to 46.
This is one reason the rules for public certificates now shrink lifetimes step by step. A certificate of a few days hardly needs revoking at all, as long as renewal is automatic.