Secrets reference
Where secrets are kept, how they are named, which hosts they reach, and the rules for typing a value.
Kinds of secret
| Kind | Name in the tree | Set with | Chat default |
|---|---|---|---|
| an extension's credential | secret/ext/<extension>/<credential> | Set token on the extension, nocturn secret set <extension>[/<credential>] | off: only the extension's own code uses it |
| an entry of nocturn's vault | secret/vault/<name> | nocturn secret set vault/<name> --host … | ask |
| an SSH key | secret/vault/<name> | Add an SSH key, nocturn secret set vault/<name> --ssh-user … | ask |
| a mirrored source item | secret/<alias> | a connected source | ask |
| the mailbox | mail/imap, mail/smtp | Set up the mailbox, nocturn mail setup | used by the mail tools only |
Every secret names exact hosts it may go to. Sending it anywhere else, or nowhere, is off. A secret without a host is listed with no destination · cannot be used.
Sources
| Setting | Flag | Default | Notes |
|---|---|---|---|
| Server | --url | https://; http:// only to the daemon's own machine | |
| Collection | --collection | name or id | |
| Organisation | --organization | when the collection name is not unique | |
| Name | --name | from server and collection, e.g. vault-home | lower-case letters, digits, -, at most 32; not vault or ext |
| Sync | --sync | 5m | at least 30s |
| Credentials | stdin, one per line | API key client ID, client secret, account email, master password |
Supported type: bitwarden (Vaultwarden or Bitwarden). Several sources per workspace are allowed. An item whose name another source uses already gets the source's name after it: router-office.
Files
| File | Holds |
|---|---|
nocturn-data/master.salt | the salt and check value of the master passphrase |
workspaces/<name>/vault.enc | the workspace's secrets, AES-256-GCM |
workspaces/<name>/secrets.json | sources and where each vault entry may go; no values |
workspaces/<name>/secret-aliases.json | the alias of each mirrored item |
workspaces/<name>/extensions/<ext>/secrets.enc | an extension's own encrypted credentials |
A workspace's key is derived from the passphrase, the salt and the workspace's name. Renaming or moving the folder breaks its encrypted files.
The passphrase
NOCTURN_MASTER_PASSPHRASE unlocks every workspace's vault. The first start with it writes master.salt. Without it, the vaults stay locked and nocturn runs without credentials. A wrong one leaves them locked and logs secret: master locked. There is no recovery.
Typing a value
The daemon accepts a value (a token, a password, a source's credentials, an SSH key) only over a private connection:
| Connection | Private |
|---|---|
| from the daemon's own machine, without forwarding headers | yes |
from a proxy on the daemon's machine that sends X-Forwarded-Proto: https | yes |
from a private address (10.x, 172.16–31.x, 192.168.x, IPv6 ULA) or link-local, without forwarding headers | yes |
| through a proxy on another machine or in another container | no |
from a public address, or 100.64.0.0/10 | no |
Elsewhere the app disables the field and shows the command to run on the machine. A value is never sent back to a device.
Scans
| When | What | On a match |
|---|---|---|
| before a request leaves | URL, body and the caller's headers: every stored value of 6 characters or more, in common encodings, and known token shapes (a gitleaks-derived rule set) | the request is blocked: secret leak blocked |
| when an answer comes back | the body, line by line for a stream, up to 10 MiB | the value is replaced with [REDACTED] |
Redirects are checked again at every hop, at most 10. A request that carries a named secret may not leave its host.
Commands
| Command | Does |
|---|---|
nocturn secret ls | names of stored secrets |
nocturn secret set <target> | stores a value from stdin |
nocturn secret set <extension>/<credential> --ref <source>:<item> | points a credential at an item |
nocturn secret rm <target> | removes one |
nocturn secret source add|set|remove|show | manages sources |
All flags: CLI.