sbkeys: accept --ca-bundle as a parameter#4482
Draft
cbgbt wants to merge 2 commits intobottlerocket-os:developfrom
Draft
sbkeys: accept --ca-bundle as a parameter#4482cbgbt wants to merge 2 commits intobottlerocket-os:developfrom
cbgbt wants to merge 2 commits intobottlerocket-os:developfrom
Conversation
This can be useful if your host's native trust store does not have the appropriate CA certificates to establish trust with AWS APIs.
The script self-invokes in either a docker container or by creating a new bash subprocess, so all variables need to be exported to that sub-process on creation.
Contributor
Author
|
I've noticed that this doesn't help with certs needed to communicate with KMS via GPG. Putting back into draft. |
| cleanup() { | ||
| rm -f "${SBKEYS_SCRIPT}" "${AWS_KMS_PKCS11_CONF}" | ||
| if [ -n "${CA_BUNDLE:-}" ] ; then | ||
| rm -f "${CA_BUNDLE}" |
Contributor
There was a problem hiding this comment.
While reading the code, I initially thought that we were removing the user inputted CA_BUNDLE which a user running the command with sufficient privileges would cause it to be removed. But I then noticed the set CA_BUNDLE="${CA_BUNDLE_FILE}" a bit earlier in execution. This is more of a readability thing, but should we use a different variable name to avoid confusing the CA_BUNDLE_FILE from the input CA_BUNDLE variable?
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.
Description of changes:
Testing done:
Ran the script with
--ca-bundle blahblahblahand it failed with SSL errorsUsed a custom CA bundle inside a docker container
Created a new secureboot signing profile
Ran the script with
--ca-bundleset to my hosts CA bundle, which caused it to succeedTerms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.