SSH private key can be read by other accounts: ‹path›
What this means
‹path› is a private SSH key with permissions ‹mode›, so other accounts on this computer, including services that run under their own account, can open it. ssh refuses to use a key in this state, and anyone who copies it can sign in wherever the key is accepted.
How to fix it
Make the key readable by you alone.
- Run
chmod 600 ‹path›, andchmod 700 ~/.sshfor the folder.
bulwark fix ssh-perms --apply does both for every file in ~/.ssh and only ever removes access.
- If other people use this computer, or the key was open for a while, replace it: create a new key
with ssh-keygen -t ed25519, add its public key where the old one is accepted, then remove the old one.
Bulwark can do this for you
In the app, open the issue and use “Fix automatically”, or “Fix now” for every safe fix. From a terminal: bulwarkctl fix ssh-perms (preview), then bulwarkctl fix ssh-perms --apply.
Check it yourself
Run a scan and look for BLWK-SSH-015 in the results:
bulwark scanInstalled the standalone CLI package instead of the app? The command is bulwarkctl.
How Bulwark decides
Bulwark reads ssh_private_keys and reports this check when:
open_to_others == trueIf 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