Repository navigation
feat(broker): refuse variable names that make programs print or run the value - #66
Merged
Merged
Conversation
…he value A shared deny list for nodkey run --secret VAR=NAME, checked by the broker before anything else and by the client first. Closes #57
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.
What
In
nodkey run --secret VAR=NAME, the variable name decides what the command does with the value. Some names make common programs print, store or run the value:ld.soprints a badLD_PRELOAD, the JVM printsJAVA_TOOL_OPTIONS, apinMAKEFLAGSmakesmakeprint every variable,GOFLAGSmakesgoprint the value,NPM_CONFIG_SCRIPT_SHELLis run bynpm run, and so on.api.DeniedVar, 119 names and 7 prefixes:LD_,DYLD_,GCONV_,LC_,RESOLV_,GIT_,NPM_CONFIG_).requestanddenied:not_allowed; a rate-limited log line names only the matched rule.nodkey runrefuses it first, with a usage error (exit 64), before it asks anyone.GH_TOKEN,DOCKER_PASSWORD,NPM_TOKEN,GOPROXY,HTTPS_PROXY,LDAP_PASSWORD(LDAP_is notLD_).Docs
DESIGN.md sections 5 and 10; THREAT-MODEL.md T15 and T28; the security-reviewer checklist mentions the deny list.
Review
Three rounds with the security-reviewer agent; the last said "ready to commit" after
MANPAGERwas added. The check runs before anything else, cannot be bypassed, and leaks no value.Left for later issues: #65 (allow lower-case letters in variable names, for Terraform's
TF_VAR_*andTF_TOKEN_*).Closes #57