R294 Pass a credential to a program only through the environment or a file
Superseded by R295 Pass a credential to a program only through the environment, a file or the secret manager's injection.
Let a credential’s value reach a program only through an environment variable or a file.
Reason
A credential is protected strictly and kept from leaking (Art. II §1). A command line can be seen by other processes on the machine and is kept in shell history and logs, so a value passed as an argument leaks.
Verification
Splitting, trimming or otherwise changing the value happens inside the program that uses it, not in the shell. Keeping the value out of every message, log and output is rule 291.
Violated when a credential’s value reaches a program by any route other than an environment variable or a file, such as a command-line argument, or is split or trimmed in the shell.