-
-
Notifications
You must be signed in to change notification settings - Fork 633
Add AIA certificate prober to boulder-observer #8594
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
base: main
Are you sure you want to change the base?
Conversation
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 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" |
Fixes test failure where AIA kind was not recognized in the oneof validation tag. Co-authored-by: mcpherrinm <47425+mcpherrinm@users.noreply.github.com>
Fixed in e9291c5. Added "AIA" to the Kind validation tag in |
|
@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 |
- 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>
Implemented in 1cad83f. Added:
|
|
@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 |
- 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>
Implemented in 7202d58:
|
|
|
||
| req, err := http.NewRequestWithContext(ctx, "GET", p.url, nil) | ||
| if err != nil { | ||
| log.Printf("AIA probe %s: failed to create request: %v", p.url, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the other individual probers have log lines like this (though the higher-level obvserver and monitor do). A line printed through the stdlib log package won't respect our configured log level or log formatting.
| ctx, cancel := context.WithTimeout(context.Background(), timeout) | ||
| defer cancel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed that we're not actually using the timeout in all our other probers. Filed a bug for that: #8598
| colls := conf.Instrument() | ||
| prober, err := conf.MakeProber(colls) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and same below:
| colls := conf.Instrument() | |
| prober, err := conf.MakeProber(colls) | |
| prober, err := conf.MakeProber(conf.Instrument()) |
| test.AssertNotError(t, err, "gathering metrics") | ||
|
|
||
| // Verify we have the expected metrics | ||
| test.AssertEquals(t, len(metricFamilies), 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This checks that we have metrics, but doesn't check that they have sensical values. We have test.AssertMetricWithLabelEquals as a helper for this, if you want to use that.
aarongable
left a comment
There was a problem hiding this 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.
Summary
All implementation tasks have been completed successfully. The AIA certificate prober:
ExpectCommonNameconfig fieldConfiguration
The AIA prober requires the following configuration options:
url(required): URL to fetch the AIA certificate fromexpectCommonName(required): Expected CommonName (CN) of the certificate for validationExample:
Debug Logging
The prober includes detailed log messages for all failure scenarios:
These log messages help with debugging and include the URL and relevant details for each failure case.
Original prompt