Repository navigation
fix(gate): a path to a key file is not a credential on the command line (0.2.20) - #151
Merged
Merged
Conversation
…ne (0.2.20) credential-on-the-command-line fired on API_KEY_FILE=/path, --password-file=, SSH_PRIVATE_KEY_PATH= and GOOGLE_APPLICATION_CREDENTIALS=, including bouncer's own BOUNCER_LOCAL_API_KEY_FILE (#150). The name contains a keyword and the value is a location, which is how a key is kept off the command line. shell-assigned-secret is no longer reported for a name ending in _FILE, _PATH or _DIR, with either separator, or for GOOGLE_APPLICATION_CREDENTIALS. Read from the name: a secret can begin with a slash. Redaction is unchanged. One holdout case, refrozen. Closes #150. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
credential-on-the-command-linefired on an assignment whose value is a path to a key file. It stopped bouncer's own documentedBOUNCER_LOCAL_API_KEY_FILE=<path>inseatbeltduring a calibration run (#150), and 0.2.18's narrowing did not cover it: the name is all capitals with no space round the=.What changed
shell-assigned-secret, the kind the hard rule reads, is no longer reported when the name ends in_FILE,_PATHor_DIR(or the same with a dash), or isGOOGLE_APPLICATION_CREDENTIALS. The test is on the name and not the value, because a secret can begin with a slash. Redaction is unchanged, so the value is still replaced in what is sent and logged.API_KEY=… ./run.shAPI_KEY_FILE=/run/secrets/api-key ./run.shmysql --password=… prodmysql --password-file=/run/secrets/db prodAWS_SECRET_ACCESS_KEY=… aws s3 lsGOOGLE_APPLICATION_CREDENTIALS=/home/user/sa.json gcloud auth listSECRET_FILENAME=… ./run.shSSH_PRIVATE_KEY_PATH=/home/user/.ssh/deploy ./run.shWhat it gives up
A real secret assigned to a variable whose name ends in
_FILE,_PATHor_DIRis no longer stopped by the hard rule and is judged by thesecretsquestion instead.Checks
1709 tests pass. One holdout case added and
FROZENupdated in the same commit; the mock asks on it by keyword, and the friction list says so. The policy file is unchanged, soCACHE_VERSIONstays at 9. No new attack surface: it narrows a deny rule.A copied policy gets this only if it already names
shell-assigned-secret(0.2.18).Closes #150.
🤖 Generated with Claude Code