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

Add support for embedding an encoded JSON payload #1017

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Nov 7, 2024

Primary changes

  • add optional support for embedding an encoded certificate metadata payload
    • disabled by default to retain existing plugin behavior
    • the intent is to "shuttle" a payload of certificate metadata in structured format from the plugin, to the monitoring system and to downstream tools (e.g., via API call) so that the payload can be retrieved, decoded, & unmarshalled to a supported data structure for further certificate evaluation
  • add optional support for embedding an encoded certificate metadata payload with the original certificate chain included in PEM encoded format
    • this is not enabled by default due to the significant increase in plugin output size
  • add logging of plugin output size calculations when debug logging is enabled
  • update README with new features

Related/indirect changes

  • doc comments cleanup
    • e.g., ExpirationValidationResult.ageWarningThreshold field
  • add ExpirationValidationResult.AgeWarningThreshold method
  • add ExpirationValidationResult.AgeCriticalThreshold method
  • add atc0005/cert-payload dependency
  • extend Config type, constants, flags, etc. to handle new flags
  • add certs.ExpiresInDaysPrecise function
  • add certs.ExpiresInHours function
  • add certs.SANsEntriesLine function

References

Primary changes:

- add optional support for embedding an encoded certificate metadata
  payload
  - disabled by default to retain existing plugin behavior
  - the intent is to "shuttle" a payload of certificate metadata in
    structured format from the plugin, to the monitoring system and to
    downstream tools (e.g., via API call) so that the payload can be
    retrieved, decoded, & unmarshalled to a supported data structure
    for further certificate evaluation
    - see also the <https://github.com/atc0005/cert-payload> and
      <https://github.com/atc0005/go-nagios> projects for the data
      structures and supporting logic used in the encoding/decoding
      process
- add optional support for embedding an encoded certificate metadata
    payload *with the original certificate chain included* in PEM
    encoded format
  - this is not enabled by default due to the significant increase in
    plugin output size
- add logging of plugin output size calculations when debug logging is
  enabled
- update README with new features

Related/indirect changes:

- doc comments cleanup
  - e.g., `ExpirationValidationResult.ageWarningThreshold` field
- add `ExpirationValidationResult.AgeWarningThreshold` method
- add `ExpirationValidationResult.AgeCriticalThreshold` method
- add `atc0005/cert-payload` dependency
- extend `Config` type, constants, flags, etc. to handle new flags
- add `certs.ExpiresInDaysPrecise` function
- add `certs.ExpiresInHours` function
- add `certs.SANsEntriesLine` function

refs GH-960
@atc0005 atc0005 added documentation Improvements or additions to documentation enhancement New feature or request config dependencies plugin/check_cert output/logging output/extended Long Service Output (aka, "extended" or "detailed") labels Nov 7, 2024
@atc0005 atc0005 added this to the v0.20.0 milestone Nov 7, 2024
@atc0005 atc0005 self-assigned this Nov 7, 2024
@atc0005 atc0005 merged commit 9cdd6a1 into master Nov 7, 2024
27 of 31 checks passed
@atc0005 atc0005 deleted the i960-add-encoded-payload-support branch November 7, 2024 11:35
@atc0005 atc0005 added the output/payload Encoded certificate metadata payload label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config dependencies documentation Improvements or additions to documentation enhancement New feature or request output/extended Long Service Output (aka, "extended" or "detailed") output/logging output/payload Encoded certificate metadata payload plugin/check_cert
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for embedding an encoded JSON payload at tail end of LongServiceOutput content
1 participant