Environment variables and files
Read a scan credential from an environment variable or a local file on the machine that runs the scan, for CI jobs and for secrets another agent writes to disk.
Environment variables and files
Two references read a value from the machine that runs the scan, with no PAM call:
| Reference | Reads |
|---|---|
env://NAME | The environment variable NAME of the CLI or runner process. Not set is NOT_FOUND. |
file:///absolute/path | The file's content, with one trailing newline dropped. On Windows: file:///C:/safeguard/token.txt. A missing file is NOT_FOUND, an unreadable one FORBIDDEN. |
Use them when something else already puts the secret on the machine: a CI system's masked variable, a Vault agent or CyberArk Credential Provider that writes a file, a Kubernetes secret mounted as a file.
# CI: the token comes from the CI system's secret store
safeguard scan --repo https://gitlab.example.internal/payments/api.git --git-token env://CI_GIT_TOKEN
# A file a local agent keeps current
safeguard scan --repo https://gitlab.example.internal/payments/api.git --git-token file:///run/secrets/git-tokenWhere they are allowed
- On the CLI and the runner they are allowed unless the provider file sets
allow_env: falseorallow_file: false. - Safeguard's cloud scanner never reads them, because a scan must not read the scanner's own environment or files.
- A vault entry cannot point at an
env://orfile://reference (a PAM entry holds apam://orvault://reference). Use them directly in a CLI flag or scan option.
Hygiene
- Keep such files readable only by the runner's account (
chmod 600). - Values read this way are redacted from output and recorded in the audit trail like any other read (provider
envorfile, never the value).
REST connector
Read scan credentials from any PAM or secret store with an HTTP API by describing its sign-in and fetch requests in the provider file, with an example for ManageEngine PAM360 and a note on Delinea Secret Server.
Runner configuration
Every setting of the runner's secret-providers.yaml, the settings each provider type takes, the environment variables the runner reads, and how to run the runner as a service.