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 Intermediates validation check option #123

Open
atc0005 opened this issue Jun 27, 2022 · 6 comments
Open

Add Intermediates validation check option #123

atc0005 opened this issue Jun 27, 2022 · 6 comments
Assignees
Labels
config documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Jun 27, 2022

I should also lookup current best practices and add a reference link both here in the documentation. This validation check would look for a minimum of 1 intermediate certificate in the chain. It might be useful to add an additional flag to specify a required number, but that could come later once sufficient testing has been performed.

It may be best to have this validation check set as ignored by default, depending on the severity of the language used in best practices documentation.

See also:

@atc0005 atc0005 added documentation Improvements or additions to documentation enhancement New feature or request config labels Jun 27, 2022
@atc0005 atc0005 added this to the Future milestone Jun 27, 2022
@atc0005 atc0005 self-assigned this Jun 27, 2022
@atc0005 atc0005 modified the milestones: Future, v0.26.0 Dec 14, 2024
@atc0005 atc0005 changed the title Add missing intermediates validation check option Add Intermediates validation check option Dec 20, 2024
@atc0005
Copy link
Owner Author

atc0005 commented Dec 20, 2024

Opting for Intermediates as the check name to match the intent behind Root as a check name for #124.

@atc0005 atc0005 modified the milestones: v0.26.0, v0.27.0 Dec 20, 2024
@atc0005 atc0005 pinned this issue Dec 20, 2024
@atc0005
Copy link
Owner Author

atc0005 commented Dec 22, 2024

The OP needs a refresh.

The checks applied would consider:

  • 0 certs in the chain as critical
  • no intermediate certs as ?
  • invalid intermediate certs as critical

This would be the initial implementation.

@atc0005
Copy link
Owner Author

atc0005 commented Dec 22, 2024

A later implementation requires some further thinking. The whiteboard items below are from scratch planning for evaluating how complete a certificate chain is (determining which intermediate certs are missing).

A cert's metadata indicates where the issuer (CA) cert can be downloaded. To do this at any scale, we need a way to cache the download, or cache the result of downloading & parsing the certificate so that we don't "thundering herd" an intermediate certificate when performing several hundred cert checks in a short timeframe.

One idea that comes to mind is to have each execution of the plugin attempt to find the CA cert in a file-based cache (e.g., SQLite db in WAL mode) and use it if present (and if cache entry is recent enough), otherwise download & parse & store the result for use by another execution of the plugin. This should work, but may be more brittle. The upside is that it does not require another app to query. Downside include CGO (bigger app, longer compile times) unless we use a newer sqlite3 library which doesn't have that requirement.

Another option is to setup a separate proxy process that does no more than cache the CA cert download and have the plugin reprocess it on each execution, skipping any cache management responsibility for the plugin.

Yet another option is to setup a certificate cache service that accepts requests for CA certs. The response could include just the cert, or the cert as part of a metadata payload.

Another option is to use an external datastore like Redis to cache content.

@atc0005
Copy link
Owner Author

atc0005 commented Dec 22, 2024

Another option is to setup a separate proxy process that does no more than cache the CA cert download and have the plugin reprocess it on each execution, skipping any cache management responsibility for the plugin.

I think using Squid or similar will be the way forward for this. We can use the same thinking when implementing CRL-based revocation checking. It keeps the initial implementation simpler, more manageable.

@atc0005
Copy link
Owner Author

atc0005 commented Jan 2, 2025

I think using Squid or similar will be the way forward for this.

I need to check the applicable RFCs to be sure of this, but it appears that Issuer Certificate URLs (Authority Information Access)1 are provided via plantext HTTP.

That should be easy enough to have Squid cache them.

Footnotes

  1. http://www.pkiglobe.org/auth_info_access.html

@atc0005
Copy link
Owner Author

atc0005 commented Jan 3, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant