fix(terraform-vault): a missing CA bundle is empty, not the string "null" - #180
Merged
Merged
Conversation
…ull" #178 made vault_ca_bundle conditional on the file being non-empty. It still went out, because the file is never empty: on a MISSING key `jq -r` prints the four-character string "null", not nothing. So /tmp/vault_ca_bundle contained "null", the -s test saw a non-empty file, and "null" was passed to terraform as the CA bundle -- reproducing the exact error #178 set out to fix. `// empty` makes a missing key yield nothing, which is what every caller here already assumed it did. Also guards the mask: ::add-mask:: on an empty value is a no-op warning, and on the old path it registered the word "null" as a secret to redact from every log line. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K2rfvVDXWjWZAKMcpwvgLG
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.
#178 made
vault_ca_bundleconditional on the file being non-empty. It still went out, because the file is never empty:CA=$(jq -r '.vault_ca_bundle' /tmp/rendered-secrets.json)On a missing key
jq -rprints the four-character stringnull, not nothing. So/tmp/vault_ca_bundlecontainsnull, every emptiness test sees a non-empty file, andnullgets passed to terraform as the CA bundle — reproducing the exact error #178 set out to fix:Demonstrated rather than assumed:
Also guards the mask:
::add-mask::on an empty value is a no-op warning, and on the old path it was registering the word "null" as a secret to redact from every log line.🤖 Generated with Claude Code
https://claude.ai/code/session_01K2rfvVDXWjWZAKMcpwvgLG