Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crl-updater: query by explicit shard too #7973

Merged
merged 4 commits into from
Jan 27, 2025
Merged

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Jan 23, 2025

Add querying by explicit shard (SA.GetRevokedCertsByShard) in addition to querying by temporal shard (SA.GetRevokedCerts).

Merge results from both kinds of shard. De-duplicate by serial within a shard, because the same certificate could wind up in a temporal shard that matches its explicit shard.

When de-duplicating, validate that revocation reasons are the same or (very unlikely) represent a re-revocation based on demonstrating key compromise. This can happen because the two different SA queries occur at slightly different times.

Add unit testing that CRL entries make it through the whole pipeline from SA, to CA, to uploader.

Rename some types in the unittest to be more accessible.

Tweak a comment in SA.UpdateRevokedCertificate to make it clear that status and reason are critical for re-revocation.

Note: This GetRevokedCertsByShard code path will always return zero certificates right now, because nothing is writing to the revokedCertificates table. Writing to that table is gated on certificates having CRL URLs in them, which is not yet implemented (and will be config-gated).

Part of #7094

jsha added 3 commits January 23, 2025 14:19
Add querying by explicit shard (SA.GetRevokedCertsByShard) in addition to
querying by temporal shard (SA.GetRevokedCerts).

Merge results from both kinds of shard. De-duplicate by serial within a shard,
because the same certificate could wind up in a temporal shard that matches its
explicit shard.

When de-duplicating, validate that revocation reasons are the same or (very
unlikely) represent a re-revocation based on demonstrating key compromise. This
can happen because the two different SA queries occur at slightly different times.

Add unit testing that CRL entries make it through the whole pipeline from SA, to
CA, to uploader.

Rename some types in the unittest to be more accessible.
@jsha jsha marked this pull request as ready for review January 24, 2025 00:44
@jsha jsha requested a review from a team as a code owner January 24, 2025 00:44
@jsha jsha requested a review from beautifulentropy January 24, 2025 00:44
Copy link
Member

@beautifulentropy beautifulentropy left a comment

Choose a reason for hiding this comment

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

A small safety nit and a question.

crl/updater/updater.go Outdated Show resolved Hide resolved
crl/updater/updater.go Show resolved Hide resolved
Co-authored-by: Samantha Frank <[email protected]>
@jsha jsha requested review from a team and aarongable and removed request for a team January 24, 2025 22:06
@jsha jsha merged commit e0221b6 into main Jan 27, 2025
12 checks passed
@jsha jsha deleted the crl-updater-checks-two-things branch January 27, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants