Repository navigation
Add the egress proxy CA to the trust store of a box - #186
Merged
Merged
Conversation
The box setup wrote the deployment CA only to ~/.boxes/ca-bundle.crt, and a few environment variables pointed some tools to that file. Every other tool used the system trust store and failed TLS on the intercepted hosts, for example PHP with the curl extension. The root file system of a box is read-only, so the box image moves the system trust store to /etc/ssl/certs-system and makes /etc/ssl/certs a link to ~/.boxes/certs. In the image, that link points back to the system trust store, so build steps and update-ca-certificates in a custom image use it. The entrypoint writes the same link into a home that has none, so a login container and a new box have a working trust store before the setup. The setup copies the system trust store into the home, adds the CA to the bundle file and as a hash link, and points ~/.boxes/certs at the copy. ~/.boxes/ca-bundle.crt links to the bundle file of the copy, so the CA variables keep working for tools such as Node.
The docs said that only the tools that read the CA variables trusted the egress proxy CA. They now describe the trust store in the home, which /etc/ssl/certs links to, with a diagram of the links.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary: The egress proxy CA is now in the trust store that
/etc/ssl/certslinks to, so every tool that uses the system trust store accepts the certificates of the proxy. Before, only the tools that read one of the CA variables trusted the CA. Other tools, e.g., PHP with the curl extension, failed TLS on the intercepted hosts.Changes:
/etc/ssl/certs-systemand makes/etc/ssl/certsa link to~/.boxes/certs. In the image,~/.boxes/certslinks back to the system trust store, so build steps andupdate-ca-certificatesin a custom image use it.boxes-setupcopies the system trust store to~/.boxes/certs.<random>/, adds the CA to the bundle file and as a hash link, and points~/.boxes/certsat the copy.~/.boxes/ca-bundle.crtlinks to the bundle file of the copy, so the CA variables andnix.confkeep working.egress.md, with a diagram, and updateboxes.mdandcustom-images.md.Tests: the base image test makes a test CA, runs the setup, and checks the CA with
openssl verifyonce with only the bundle file and once with only the hash links. I ran the setup step outside of an image with changed paths. I could not build the image or start a box, because Docker is not available here.