Enable containers to add CAs to the trust store on start up #2929
+35
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes two improvements to our container images.
The primary improvement is to
entrypoint.sh, which now scans/certsfor certificates (*.crtfiles) and adds them to the container's trust store, assuming theirextendedKeyUsageincludesserverAuth(see also: OpenSSL's documentation). During development and testing, this should help minimize, if not eliminate, the need to resort toTLSSkipVerify: trueor similar, especially for those programs that might not be aware of Pelican's configuration (e.g.,curl).Note
There is hypothetically a backwards compatibility concern given that I chose to scan
/certsbased on where We™ currently seem to bind mount certificates into containers. That said, I would find it passing strange for a container to mount a certificate it doesn't trust but presumably expects the rest of the world to trust.The secondary improvements are to the container image build process (the Dockerfile), which are intended to facilitate repeated image builds by improving layer caching and not building unnecessary binaries.