Skip to content

Add AIA certificate prober to boulder-observer#8594

Merged
jsha merged 13 commits intoobserver-ctxfrom
copilot/add-aia-certificate-prober
Feb 10, 2026
Merged

Add AIA certificate prober to boulder-observer#8594
jsha merged 13 commits intoobserver-ctxfrom
copilot/add-aia-certificate-prober

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 23, 2026

Add an AIA certificate prober to Boulder-observer, so we can verify the served certificates have the right Common Name (preventing mixups), content type and encoding. We export the certificate notBefore and notAfter for expiry monitoring purposes.

This PR was largely written by Copilot under my supervision, and is modelled after the CRL Prober.

Fixes #8593

Copilot AI changed the title [WIP] Add check for AIA certificates in boulder-observer Add AIA certificate prober to boulder-observer Jan 23, 2026
Copilot AI requested a review from mcpherrinm January 23, 2026 23:13
@mcpherrinm
Copy link
Copy Markdown
Contributor

@copilot test failure " main_test.go:68: Failed to validate config file "observer.yml": Key: 'ObsConf.MonConfs[11].Kind' Error:Field validation for 'Kind' failed on the 'oneof' tag"

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 23, 2026

@copilot test failure " main_test.go:68: Failed to validate config file "observer.yml": Key: 'ObsConf.MonConfs[11].Kind' Error:Field validation for 'Kind' failed on the 'oneof' tag"

Fixed in e9291c5. Added "AIA" to the Kind validation tag in observer/mon_conf.go so it's now recognized as a valid prober kind.

@mcpherrinm
Copy link
Copy Markdown
Contributor

@copilot Add a config field, ExpectCommonName, which the prober checks if the received certificate matches, to ensure the correct certificate was served. Check the recieved certificate is also a CA Cert

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 26, 2026

@copilot Add a config field, ExpectCommonName, which the prober checks if the received certificate matches, to ensure the correct certificate was served. Check the recieved certificate is also a CA Ce...

Implemented in 1cad83f. Added:

  • ExpectCommonName config field (optional) to verify the certificate's CN matches the expected value
  • CA certificate validation - the prober now checks that cert.IsCA is true
  • Tests for both new validations including matching/non-matching CN and non-CA certificates

@mcpherrinm
Copy link
Copy Markdown
Contributor

@copilot Don't make ExpectCommonName optional. It must be provided and checked.

Add log messages to the different failure cases in probing for debugging why something is gone wrong

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 26, 2026

@copilot Don't make ExpectCommonName optional. It must be provided and checked.

Add log messages to the different failure cases in probing for debugging why something is gone wrong

Implemented in 7202d58:

  • ExpectCommonName is now required - validation fails if not provided
  • Added debug log messages for all failure cases:
    • HTTP request creation failure
    • Certificate fetch failure
    • Incorrect Content-Type header
    • Response body read failure
    • Certificate parsing failure
    • Non-CA certificate detection
    • CommonName mismatch

@mcpherrinm mcpherrinm marked this pull request as ready for review January 26, 2026 17:57
@mcpherrinm mcpherrinm requested a review from a team as a code owner January 26, 2026 17:57
Comment thread observer/probers/aia/aia.go Outdated
Comment thread observer/probers/aia/aia.go Outdated
Comment thread observer/probers/aia/aia_test.go Outdated
Comment thread observer/probers/aia/aia_test.go Outdated
Copy link
Copy Markdown
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.

Also please update the PR description to be something a human would like to read in the git log.

@mcpherrinm mcpherrinm requested a review from aarongable February 2, 2026 23:26
Copilot AI and others added 5 commits February 3, 2026 17:04
Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
Copilot AI and others added 7 commits February 3, 2026 17:04
Fixes test failure where AIA kind was not recognized in the oneof validation tag.

Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
- Add optional ExpectCommonName config field to verify certificate CN
- Validate that received certificate is a CA certificate (IsCA=true)
- Update tests to use CA certificates and test new validations
- Update documentation with new config field and examples

Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
- Make ExpectCommonName a required field with validation
- Add log messages for all failure cases in probe:
  - HTTP request creation failure
  - Certificate fetch failure
  - Incorrect Content-Type
  - Response body read failure
  - Certificate parsing failure
  - Non-CA certificate
  - CommonName mismatch
- Update tests to always include ExpectCommonName
- Update documentation to reflect ExpectCommonName is required

Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
Use AssertMetricWithLabelEquals instead of a test registry
Comment thread observer/probers/aia/aia_test.go Outdated
Comment thread observer/probers/aia/aia_test.go Outdated
Comment thread observer/probers/aia/aia.go
@beautifulentropy beautifulentropy requested a review from jsha February 4, 2026 17:20
@aarongable aarongable force-pushed the copilot/add-aia-certificate-prober branch from 9251c86 to b069f1c Compare February 4, 2026 17:54
@aarongable
Copy link
Copy Markdown
Contributor

Apologies for the force-push, I've updated this PR to be based on top of #8619 to take advantage of the simpler Prober interface and to allow the tests to assert that the correct errors are being returned.

@aarongable aarongable changed the base branch from main to observer-ctx February 4, 2026 17:55
@mcpherrinm
Copy link
Copy Markdown
Contributor

nice! new prober interface looks great :)

@jsha jsha merged commit 25c69ff into observer-ctx Feb 10, 2026
17 checks passed
@jsha jsha deleted the copilot/add-aia-certificate-prober branch February 10, 2026 19:38
@jsha jsha restored the copilot/add-aia-certificate-prober branch February 10, 2026 19:56
beautifulentropy pushed a commit that referenced this pull request Feb 11, 2026
Add an AIA certificate prober to Boulder-observer, so we can verify the
served certificates have the right Common Name (preventing mixups),
content type and encoding. We export the certificate notBefore and
notAfter for expiry monitoring purposes.

This PR was largely written by Copilot under Matthew's supervision, and
is modelled after the CRL Prober.

Re-land of #8594, which was accidentally merged to a feature branch (due
to branch stacking).

Fixes #8593

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Matthew McPherrin <git@mcpherrin.ca>
Co-authored-by: Aaron Gable <aaron@letsencrypt.org>
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 a check for AIA certs

5 participants