Go + راز (secret)
Secrets that stay encrypted. No server required.
goraz is a Go library and command-line tool that keeps API tokens, secrets and passwords in an encrypted file. Each production service gets its own file holding only what it needs.
Store
Put secrets in an encrypted vault from a hidden prompt or a pipe, never from arguments.
Split
Give each service its own file with only its items, and its key separately.
Read
Open the file from Go, or let goraz run pass values to any program.
All metadata is encrypted
Names, usernames and URLs are invisible in the file, not only the values.
Tampering is detected
Changed, swapped, removed or older data is refused, with documented limits.
Limits come from encryption
A service's file holds only its own secrets, so there is nothing else to leak.
Off the command line
Secrets are never read from arguments or environment variables, so they stay out of history.
Audit by default
A read fails if it can't be logged, and the log holds no names or values.
Few dependencies
Only Go's standard library and golang.org/x modules, with a published file format.
Documentation
Start
Install goraz and use it on your own machine.
- Get startedInstall goraz, create an encrypted vault, store a secret and pass it to a program without putting it in a file or shell history.
- Replace a .env fileMove secrets out of a plaintext .env file into an encrypted vault, and commit a file of references instead of real values.
- Passwords and one-time codesUse goraz as an offline command-line password manager with password generation, TOTP codes, an automatically cleared clipboard and breach checks.
Production
Give services only the secrets they need.
- Tokens in a Go serviceKeep third-party API tokens encrypted at rest in a production Go service, without a secrets server, and update them without a restart.
- Issue API tokensGenerate secure opaque API tokens in Go with expiry, scopes, revocation and rotation, while storing only a keyed hash in your database.
- DockerRun a container with encrypted secrets and a read-only filesystem using goraz and Docker secrets, and avoid putting tokens in environment files or images.
- KubernetesKeep application tokens encrypted in a Kubernetes pod using goraz, with the key in a Kubernetes Secret and no secret values in environment variables.
- systemdGive a systemd service its encrypted secrets using LoadCredential and goraz, without Environment= lines or plaintext files in unit configuration.
- CI pipelinesGive a CI job only the secrets it needs, using an encrypted goraz file in the repository and one key stored in GitHub Actions or another CI system.
Plan and respond
Decide whether it fits, and fix problems.
- Compared with othersWhen to use goraz and when a secrets server, SOPS, age, gopass or KeePassXC is the better choice, with an honest comparison of features and maturity.
- Limits and performanceFile size limits, supported platforms and measured performance of goraz, and how they should affect the way you use it.
- A secret has leakedStep-by-step response when an API token, service key, vault passphrase or recovery code is exposed, including what rotation does and does not undo.
- TroubleshootingWhat each goraz error means and how to fix it, including rollback, fork, audit log, key file permission and wrong credential errors.
Reference
Every command, guarantee and byte.
- Command referenceEvery goraz command and flag for vaults, tokens, passwords, services and audit logs.
- Threat modelWhat goraz defends against, what it does not, and the limits of its rollback detection, audit log and service mode.
- Security designThe cryptography, key hierarchy, file format, token design and memory limits of goraz, written to serve as its format specification.
- Feature matrixWhich features from Vault, SOPS, Bitwarden and other projects goraz includes, defers or rejects, and why.
- ResearchStrengths, threat models, encryption design, licenses and security incidents of Vault, OpenBao, Infisical, SOPS, age, gopass, Bitwarden, KeePassXC and others.