Developers · Privileged access (PAM)
The authguard-secrets command-line tool (CI and applications)
Not available yet
This article describes a feature in development. You cannot use it yet; the article is here to help you plan.
authguard-secrets fetches short-lived application secrets from AuthGuard's vault for a CI job, a container or a server, using the identity the platform already gives the job. The tool is built; the server endpoints it calls (/v1/workload/token and /v1/workload/secrets:batchGet) arrive with the application secrets API, so it cannot be used against a live organization yet.
Which commands are there?
| Command | What it does |
|---|---|
get NAME[#FIELD] | Writes one secret to --out FILE, or to the terminal only with --reveal |
env SPEC... | Prints POSIX export lines, to a pipe or a file; it refuses a terminal |
exec SPEC... -- PROGRAM [ARGS] | Runs the program with the secrets in its environment (alias run) |
keygen --out FILE | Creates a workload key (ML-DSA-65 by default; --alg ed25519 or es256) and prints its public JWK and thumbprint |
A SPEC is [VAR=]name[#field]. A key-value secret without a field becomes one variable per key, with the prefix you give. Two specs may not set the same variable.
Which options does it need?
| Option | Environment variable |
|---|---|
--url (the organization's https origin) | AUTHGUARD_URL |
--workload (the workload's UUID) | AUTHGUARD_WORKLOAD_ID |
--identity auto, github, gitlab, kubernetes, key | AUTHGUARD_IDENTITY |
--key-file, --key-id (key workloads) | AUTHGUARD_KEY_FILE, AUTHGUARD_KEY_ID |
--token-file (Kubernetes, default /var/run/secrets/authguard/token) | AUTHGUARD_TOKEN_FILE |
--token-env (GitLab, default AUTHGUARD_ID_TOKEN) | AUTHGUARD_TOKEN_ENV |
--ttl SECONDS (60 to 43200) | — |
With auto, the tool detects GitHub Actions, GitLab CI or Kubernetes from the job's environment.
Example: GitHub Actions
permissions:
id-token: write # lets the job request its identity token
contents: read
steps:
- run: authguard-secrets exec DB_PASSWORD=billing-db -- ./deploy.sh
env:
AUTHGUARD_URL: https://acme.example.pt
AUTHGUARD_WORKLOAD_ID: 00000000-0000-0000-0000-000000000000What does the tool guarantee?
- HTTPS only, no redirects, and a 1 MiB limit on answers.
- The access token lasts 5 minutes and is bound to an ephemeral key (DPoP) created for the run.
- Each secret arrives sealed to that key; nothing is cached on disk.
- Files are created with mode 0600 and never overwritten without
--force. - Errors print fixed text or an error code, never a secret or a server description.
Exit code 2 means a usage error. See API authentication for the other machine credentials.
Was this page helpful?
Thank you. Your answer stays in this browser; nothing is sent.
Sorry about that. Try:
- searching for the exact text of the message or the error code
- the error code index
- asking your organization's administrator