Skip to content
HighSecrets & credentialsBLWK-CRED-005

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.

  1. Rotate each key listed above: it has been sitting in a plain file.
  2. Store the new value in your system keychain or password manager (for example secret-tool store, security add-generic-password, 1Password CLI op read or pass).
  3. 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.
  4. For AWS, prefer short-lived sessions (aws configure sso or AWS Vault) to exporting keys at all.

Check it yourself ​

Run a scan and look for BLWK-CRED-005 in the results:

sh
bulwark scan

Installed 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 > 0

If a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.

References ​

Released under the Apache License 2.0.