Run a command with vault secrets
Reference for safeguard vault exec, which runs a command with vault secrets set as environment variables and never prints them. Coming soon.
Run a command with vault secrets
Coming soon.
safeguard vault execis not released yet. This page records the planned behavior and will be updated with the final flags when it ships.
safeguard vault exec checks a credential out of the vault, starts your command with the value in its environment, and checks the credential back in when the command ends. The value is never printed, never placed on the command line and never written to a log.
Planned shape
safeguard vault exec --env PGPASSWORD=sgvault://prod-pg -- psql -c 'select 1'| Flag | Meaning |
|---|---|
--env NAME=ref | Set an environment variable from a vault reference. Repeat for more |
--redact-output | Replace any secret value in the command's output with [redacted] |
Planned behavior
- You need the USE grant on the credential. Without it the command does not start and the exit code is 3 with
NOT_GRANTED. - The lease is checked in when the command exits, when you press Ctrl-C and when the command crashes.
- Other users on the machine cannot see the value in the process list, because it is not on the command line.
- When your organization asks for an MFA confirmation, you enter your authenticator code in the terminal once for the run. A person running the command behind a wrapper that has no terminal can set
SAFEGUARD_STEP_UP_CODEto a current code. It is not for CI: in CI, use a credential with an access policy and a USE grant, or agent-token mode.
Vault and privileged access status
What the Safeguard vault does today for privileged access, and what is coming soon. Use this page to see which controls are available and which are not yet.
Choosing a key manager for a self-hosted install
Pick the key manager that protects the Credential Vault on your own Safeguard deployment: AWS KMS, Azure Key Vault, Google Cloud KMS, HashiCorp Vault Transit, a PKCS#11 HSM, or a local master-key file. Configuration, switching, and what happens when it is down.