Project setting: hush.config.json
A backend is the service where Hush! keeps your secrets. With a hush.config.json file, a project decides which backend holds which key. Every command reads it: push, pull, cat, grant, revoke and delete use the backend of the key you give them, and list shows all backends of the project.
You don't need this file. Without a hush.config.json, Hush! works as it always has: every key lives in the AWS Secrets Manager in eu-central-1, with the AWS profile from AWS_PROFILE.
Where the file lives
Hush! looks for hush.config.json in the directory you run it in, usually the root of your project, next to .hushrc.json. It doesn't look in parent directories. Commit the file: it holds no secrets, and everyone on the project should use the same backends.
Example
{
"backends": {
"frankfurt": { "type": "aws-secrets-manager" },
"ireland": { "type": "aws-secrets-manager", "region": "eu-west-1" }
},
"default": "frankfurt",
"keys": {
"shop-prod": "ireland"
}
}
With this file, hush push shop-prod .env stores the secret hush-shop-prod in eu-west-1. Every other key, for example hush push blog-prod .env, goes to the default backend frankfurt in eu-central-1.
Fields
Each backend type has its own fields besides type:
aws-secrets-manager
The AWS backend uses the profile from AWS_PROFILE, as without a project setting. Credentials never go into hush.config.json.
Every key has exactly one backend
A key belongs to the backend that keys names for it, otherwise to the default backend. Hush! never looks for a key in a second backend. If you move a key to another backend in keys, the secret doesn't move with it. To move it, for example shop-prod:
- With the previous setting, run
hush pull shop-prod .env, so your.envfile holds the newest version. - Move the key in
keysand runhush push shop-prod .env. This creates the secret in the new backend. - If you no longer need the old secret, delete it with the previous setting:
hush delete shop-prod.
.hushrc.json keeps the version of a key per store, so the old and the new secret don't share a version, and deleting one doesn't touch the version of the other. Keys in the default AWS store (eu-central-1) keep the entry name they had in Hush! 4.1.0, like hush-shop-dev. Keys in any other store get the store added, like hush-shop-prod@AWS eu-west-1. See Version control.
list with several backends
With more than one backend, hush list shows one table per backend, in the order of backends (names that are whole numbers, like 2024, come first, as in every JSON object read by JavaScript). Each table starts with a title row like Backend: ireland (AWS eu-west-1). A table shows every Hush! secret in that backend, also secrets that keys assigns to another backend.
If a backend can't be listed, for example because no AWS profile is selected, list shows the reason instead of its table, still lists the other backends and ends with exit code 1.
With a single backend, list looks as it does without a project setting.
Mistakes in the file
Hush! checks the file before every command and stops before it calls any backend. The message names the file and the field, for example:
Hush! 🤫 — Error: hush.config.json, field backends.ireland.region: must be a non-empty string.
- A file that isn't valid JSON, a missing
backendsordefault, an unknowntypeand a name indefaultorkeysthat isn't inbackendsare all mistakes. - A
regionthat doesn't have the shape of an AWS region (words and a number, likeeu-west-1,us-gov-west-1oreusc-de-east-1) is a mistake. Hush! checks the shape, not a list of regions, so a new AWS region works right away. - Every store has one name. Two backends that point to the same store, like two AWS backends in the same region, are a mistake; a backend without
regioncounts aseu-central-1. Otherwiselistwould show the same secrets twice. - Fields Hush! doesn't know are mistakes too, at the top level and in a backend. This keeps credentials out of the file: a field like
secretAccessKeyis refused, and Hush! doesn't repeat its value in the message. hush --helpstill works with a broken file, so you can look up the commands while you fix it.