Skip to content

observer: add CCADB CRL prober#8644

Open
jsha wants to merge 3 commits intomainfrom
crl-fetch-observer
Open

observer: add CCADB CRL prober#8644
jsha wants to merge 3 commits intomainfrom
crl-fetch-observer

Conversation

@jsha
Copy link
Contributor

@jsha jsha commented Feb 24, 2026

Prior work: letsencrypt/crl-monitor#88

Fixes #8618

@jsha jsha marked this pull request as ready for review February 24, 2026 06:38
@jsha jsha requested a review from a team as a code owner February 24, 2026 06:38
@jsha jsha requested a review from aarongable February 24, 2026 06:38
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

I have a few minor comments about the code, but nothing big.

My major concern is that this simply doesn't feel like a prober. It's doing so much work, and has so many opportunities for failure, all of which get wrapped up in big accumulated errors. In my mind, the ideal prober is short, simple, only emits metrics (not meaningful logs), and we have alerts for every single metric it exposes. I understand that it is useful for this to live within boulder-observer, so we don't have to deploy and monitor Yet Another Component, but I'm registering my moderate discomfort with the complexity here.

@beautifulentropy beautifulentropy self-requested a review February 27, 2026 15:33
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.

Overall, the structure of this change looks good to me. I do have a few comments, mostly concerning some places where we could panic. I also noticed there isn't a corresponding update to cmd/boulder-observer/README.md.

}

if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("http status %d for %q: %s", resp.StatusCode, url, string(body[:400]))
Copy link
Member

Choose a reason for hiding this comment

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

body[:400] could possibly panic slice bounds out of range for shorter error messages.

return nil, err
}

pemIndex := slices.Index(header, "X.509 Certificate (PEM)")
Copy link
Member

@beautifulentropy beautifulentropy Feb 27, 2026

Choose a reason for hiding this comment

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

The comment for slices.Index() says:

Index returns the index of the first occurrence of v in s, or -1 if not present.

We should guard against a missing column name here by checking for -1. It would also be useful for the error to mention something about contents being malformed.

Comment on lines +325 to +328
ownerIndex := slices.Index(header, "CA Owner")
crlIndex := slices.Index(header, "JSON Array of Partitioned CRLs")
skidIndex := slices.Index(header, "Subject Key Identifier")
certificateNameIndex := slices.Index(header, "Certificate Name")
Copy link
Member

Choose a reason for hiding this comment

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

Similar issue with index possibly being -1 here as well.

crlAgeLimit: ageLimitDuration,
crlRegexp: re,

crlsSuccess: crlsSuccess,
Copy link
Member

Choose a reason for hiding this comment

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

I see this being initialized but I don't see it being used.

Comment on lines +43 to +49
body, err = getBody(ctx, url)
if err == nil {
return body, nil
}
time.Sleep(time.Duration(backoff) * time.Millisecond)
}
return nil, err
Copy link
Member

Choose a reason for hiding this comment

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

This appears to sleep even if the context is done/canceled. We could add a small check and an early return to avoid that:

if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
	return nil, err
}

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.

boulder-observer: add tool to fetch all CRLs from CCADB

3 participants