Keys are saved in your shell history (‹path›)
What this means
‹path› contains ‹secrets found› key(s) typed as part of a command (‹secret kinds›; ‹secret lines›). Your shell saved the whole line, so the key now sits in a plain file that backups, sync tools and any program running as you can read. History files are one of the first places credential-stealing malware looks.
How to fix it
Treat each key as leaked: replace it first, then clean up.
- Revoke the key where it was issued and create a new one.
- Remove the lines from ‹path› with a text editor (close other terminals first, or they will write the old history back).
- To stop it happening again, do not put keys on the command line. Read them from your keychain or password manager when needed, for example
export GITHUB_TOKEN=$(gh auth token)orop run -- <command>. - As a safety net, make the shell skip lines that start with a space:
HISTCONTROL=ignorespacefor bash,setopt HIST_IGNORE_SPACEfor zsh.
Check it yourself
Run a scan and look for BLWK-CRED-010 in the results:
sh
bulwark scanInstalled the standalone CLI package instead of the app? The command is bulwarkctl.
How Bulwark decides
Bulwark reads credential_stores and reports this check when:
text
kind == "shell_history" and secrets_found > 0If a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.
References
Related checks
- A long-lived AWS access key is stored on disk ·
BLWK-CRED-001 - Git stores passwords and tokens in plain text (‹path›) ·
BLWK-CRED-002 - Docker registry logins are stored in the config file ·
BLWK-CRED-003 - A credential file can be read by other users ·
BLWK-CRED-004 - Secrets are written into a shell startup file (‹path›) ·
BLWK-CRED-005 - An npm token is stored in plain text (‹path›) ·
BLWK-CRED-006