Skip to content
New issue

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

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

Already on GitHub? # to your account

Add format version flag & rework payload creation #1098

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Nov 25, 2024

Changes

NOTE: All of the following changes pertain to the cert_check plugin and associated dependencies.

Primary changes:

  • create certificate metadata payload (if requested) regardless of successful certificate chain validation attempt
    • e.g., even if the connection attempt times out or DNS resolution fails
  • add payload-format flag to allow explicitly specifying which certificate metadata payload format version will be used when generating the payload for inclusion in plugin output
    • this is intended to provide stability when updating the cert-payload dependency as it "locks-in" the format version instead of just always using the latest format and creating a conflict with reporting tools that expect to work with specific formats
  • enable full go-nagios dependency debug logging if debug logging is requested plugin
  • heavily refactor addCertChainPayload function
    • to outsource bulk of certificate metadata payload generation to the cert-payload project
    • to record the resolved IP Address used to retrieve the certificate chain
    • add warning if (unstable) certificate metadata payload format 0 is chosen
      • while format version 1 is not yet stable (and serves mostly as a stub entry to test against), the plan is to stabilize it fairly soon
    • emit "pretty printed" JSON payload if debug or trace logging levels is requested

Additional changes:

  • misordered certificate chain detection is now performed by the cert-payload project and recorded in the certificate metadata payload
    • the check_cert plugin is not (yet) flagging the service check as passing/failing based on this criteria; misordered chain validation is to be added in a future project release

References

CHANGES

NOTE: All of the following changes pertain to the `cert_check` plugin
and associated dependencies.

Primary changes:

- create certificate metadata payload (if requested) regardless of
  successful certificate chain validation attempt
  - e.g., even if the connection attempt times out or DNS resolution
    fails
- add `payload-format` flag to allow explicitly specifying which
  certificate metadata payload format version will be used when
  generating the payload for inclusion in plugin output
  - this is intended to provide stability when updating the
    `cert-payload` dependency as it "locks-in" the format version
    instead of just always using the latest format and creating a
    conflict with reporting tools that expect to work with specific
    formats
- enable full `go-nagios` dependency debug logging *if* debug logging
  is requested plugin
- *heavily* refactor `addCertChainPayload` function
  - to outsource bulk of certificate metadata payload generation to
    the `cert-payload` project
  - to record the resolved IP Address used to retrieve the certificate
    chain
  - add warning if (unstable) certificate metadata payload format 0 is
    chosen
    - while format version 1 is not *yet* stable (and serves mostly as
      a stub entry to test against), the plan is to stabilize it
      fairly soon
  - emit "pretty printed" JSON payload if debug or trace logging
    levels is requested

Additional changes:

- misordered certificate chain detection is now performed by the
  cert-payload project and recorded in the certificate metadata
  payload
  - the `check_cert` plugin is not (yet) flagging the service check as
    passing/failing based on this criteria; misordered chain
    validation is to be added in a future project release

REFERENCES

- atc0005/cert-payload#19
- atc0005/cert-payload#31
- atc0005/cert-payload#46
- #1004
@atc0005 atc0005 added documentation Improvements or additions to documentation enhancement New feature or request config dependencies plugin/check_cert output/logging refactor breaking Breaking change in behavior from a previous release output/payload Encoded certificate metadata payload labels Nov 25, 2024
@atc0005 atc0005 added this to the v0.23.0 milestone Nov 25, 2024
@atc0005 atc0005 self-assigned this Nov 25, 2024
@atc0005 atc0005 merged commit d64a672 into master Nov 25, 2024
30 of 31 checks passed
@atc0005 atc0005 deleted the refactor-cert-payload-generation branch November 25, 2024 11:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
breaking Breaking change in behavior from a previous release config dependencies documentation Improvements or additions to documentation enhancement New feature or request output/logging output/payload Encoded certificate metadata payload plugin/check_cert refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant