Secrets are written into a shell startup file (‹path›)
What this means
‹path› sets ‹exported secrets› secret-looking variable(s) to a literal value (‹secret names›). Every program you start inherits them, dotfile backups and sync tools copy them, and anything that can read your home folder, including a malicious package's install script, can read them.
How to fix it
Keep the value in a secrets store and fetch it when it is needed, not in the file.
- Rotate each key listed above: it has been sitting in a plain file.
- Store the new value in your system keychain or password manager (for example
secret-tool store,security add-generic-password, 1Password CLIop readorpass). - Replace the line with a lookup that runs only when needed, or use a per-project tool such as direnv with a keychain-backed value.
- For AWS, prefer short-lived sessions (
aws configure ssoor AWS Vault) to exporting keys at all.
Check it yourself
Run a scan and look for BLWK-CRED-005 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_startup" and exported_secrets > 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 - An npm token is stored in plain text (‹path›) ·
BLWK-CRED-006 - A PyPI password or token is stored in plain text (‹path›) ·
BLWK-CRED-007