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

Initial implementation of chain order validation #1183

Merged

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Dec 18, 2024

Overview

This set of changes applies to both the check_cert plugin and the lscert CLI tool. While the primary focus is adding a prototype implementation of "chain order" validation logic, other ergonomic and display changes have been applied to the lscert tool. Some of those changes are likely to be refined further in near future releases as additional validation checks are applied.

Changes

  • update check_cert plugin
    • add new Chain Order validation type
      • assert that leaf certificate is first in chain, followed by the intermediate which signed it, a potential second intermediate which signed the former and so on
      • current implementation objects to a single leaf cert in a chain, though this behavior may be moved to a separate validation check specific to intermediates
      • current implementation notes the presence of a root certificate and cautions that some platforms will object to this, though this behavior may be moved to a separate validation check in the future
      • offers advice for replacing a certificate chain when specific CA vendors are matched
        • currently only Sectigo/InCommon is supported, though the plan is to support multiple CAs once further feedback is gathered
    • add new performance data metrics
      • certs_ordered
      • certs_misordered
    • extend tests to cover new validation type
  • update lscert
    • incorporate new validation check
    • rework summary display to use emoji status indicators (pass/neutral/warn/crit)
    • rename headers to emphasize "cert chain" over just "certs"
    • incorporate the same "advice" output that the check_cert plugin now emits for Chain Order validation problems

Credit

The following LLM sources were used for inspiration or starting code samples for some of the included changes:

  • ChatGPT, OpenAI
  • Google Gemini
  • Claude (Anthropic AI assistant)

In particular, I used all of these sources for assistance with logic for certificate chain ordering, signature validation and misc other tasks. While none provided solutions I could use as-is, all were helpful in pointing me in the right direction when I needed it.

References

OVERVIEW

This set of changes applies to both the `check_cert` plugin and the
`lscert` CLI tool. While the primary focus is adding a prototype
implementation of "chain order" validation logic, other ergonomic and
display changes have been applied to the `lscert` tool. Some of those
changes are likely to be refined further in near future releases as
additional validation checks are applied.

CHANGES

- update `check_cert` plugin
  - add new `Chain Order` validation type
    - assert that leaf certificate is first in chain, followed by the
      intermediate which signed it, a potential second intermediate
      which signed the former and so on
    - current implementation objects to a single leaf cert in a chain,
      though this behavior may be moved to a separate validation check
      specific to intermediates
    - current implementation notes the presence of a root certificate
      and cautions that some platforms will object to this, though
      this behavior may be moved to a separate validation check in the
      future
    - offers advice for replacing a certificate chain when specific CA
      vendors are matched
      - currently only Sectigo/InCommon is supported, though the plan
        is to support multiple CAs once further feedback is gathered
  - add new performance data metrics
    - `certs_ordered`
    - `certs_misordered`
  - extend tests to cover new validation type
- update `lscert`
  - incorporate new validation check
  - rework summary display to use emoji status indicators
    (pass/neutral/warn/crit)
  - rename headers to emphasize "cert chain" over just "certs"
  - incorporate the same "advice" output that the `check_cert` plugin
    now emits for `Chain Order` validation problems

CREDIT

The following LLM sources were used for inspiration or starting code
samples for some of the included changes:

- ChatGPT, OpenAI
- Google Gemini
- Claude (Anthropic AI assistant)

In particular, I used all of these sources for assistance with logic
for certificate chain ordering, signature validation and misc other
tasks. While none provided solutions I could use as-is, all were
helpful in pointing me in the right direction when I needed it.

REFERENCES

- GH-1004
- GH-364
- GH-365
- GH-219
@atc0005 atc0005 added documentation Improvements or additions to documentation enhancement New feature or request config plugin/check_cert output/logging app/lscert tests output/perfdata Service Perf Data (aka, "performance data") output/summary Service Output (aka, "one-line-summary") output/extended Long Service Output (aka, "extended" or "detailed") labels Dec 18, 2024
@atc0005 atc0005 added this to the v0.26.0-alpha.3 milestone Dec 18, 2024
@atc0005 atc0005 self-assigned this Dec 18, 2024
@atc0005 atc0005 merged commit 20ea90d into development Dec 18, 2024
28 of 29 checks passed
@atc0005 atc0005 deleted the i1004-add-support-for-misordered-chain-validation branch December 18, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/lscert config documentation Improvements or additions to documentation enhancement New feature or request output/extended Long Service Output (aka, "extended" or "detailed") output/logging output/perfdata Service Perf Data (aka, "performance data") output/summary Service Output (aka, "one-line-summary") plugin/check_cert tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant