VergShip
Sealed secrets: env files no one else can read
Each server that allows operations makes its own age key. Values are sealed to that key on your own computer (the verg CLI) or in your browser, before they are sent, so the console stores sealed text and nothing else: no value, no key that could open one. The server opens a version only when a request signed with an operator key names its exact SHA-256 and the server's own key, and writes it for the app.
Turn it on
- On the server, as root, install age (it is in Ubuntu and Debian). The agent makes the machine's age key within a minute, and signs it with the machine's own key.
sudo apt install age - Allow the secret verbs. They change files, so a server never allows them by default.
sudo verg-agent allow operations --operator owner-mac ed25519:... --verbs "inventory.scan app.status secret.apply secret.send" - The app needs its system group,
verg-app-APP, which VergShip makes when it creates the app. The env file belongs to root and that group. - From your computer, seal and apply:
verg secret push web-1 suddengone --env-file .env verg secret push web-1 suddengone --file tls.key=./tls.key
What the server writes
| What | Where | Owner and mode |
|---|---|---|
| The env file | /etc/verg/apps/APP/env | root, group verg-app-APP, 0640 |
| A secret file | /etc/verg/apps/APP/files/NAME | root, group verg-app-APP, 0640 |
| Sealed copies, for a rollback | /etc/verg/apps/APP/sealed/SHA-256.age | root, 0600; the ones in use and the last 20 others are kept |
| The age key | /etc/verg/ops/age.key | root, 0600; never leaves the machine |
Each file is written whole and then renamed into place, so an app never reads half of one. Every change is a new version, numbered by the console; verg secret apply NODE APP --version N applies an older one from the sealed copy the server kept, without fetching anything.
Moving an app to another server
verg secret send old-server new-server APP asks the old server to read the app's env file itself and seal it to the new server's age key. The signed request names that key's fingerprint, which your CLI checked and remembered; the old server compares it with the key the console hands over and refuses if they differ. The new version is then applied on the new server. The value never leaves either machine unsealed.
For an app that ran before VergShip, root on the old server names its existing env file once: sudo verg-agent ops secret-source APP /opt/APP/.env. The console cannot name a file; secret.send reads only that one, or the app's own env file and secret files.
Keys you can check
The CLI accepts a server's age key only when the server's own key signed it, and remembers it the first time (and says so, with the fingerprint sudo verg-agent ops status prints on the machine). From then on, a console that reports another key is refused before anything is sealed. The browser page checks the same signature where the browser can, and remembers the key on that device.
What a stolen session or a taken console can and cannot do
| Someone with | Can | Cannot |
|---|---|---|
| A stolen console session or API key | See which versions exist, their sizes and SHA-256s. Store a new sealed version. | Read a value: there is none in the console. Apply a version: that needs a signature from an operator key, which lives on someone's computer. |
| The console itself | Hold back a version. Show a page that is not true. Send this browser other page code, which could read what is typed there from then on: for the values that matter most, seal with the CLI. | Open a version: each is sealed to a key made on its server. Get the CLI or a server to seal to a key it controls: the CLI checks the server signed its key, and the server checks the fingerprint the operator signed. Change what a version holds: the server checks its SHA-256 and that it was sealed for that app and item. |
| Root on one server | Read that server's own apps' values. | Read another server's: those are sealed to that server's key. |
The age library
The CLI and the page seal with the age library by the age authors (typage), version 0.3.1, bundled once into one file the console serves. Its SHA-256 is written in the CLI, which checks it before it uses it, and in the page's script tag, which the browser checks. Nothing comes from a CDN. On the server, the agent uses the age command from the system's own packages.
The API
GET /v1/ship/secrets?node=&app= lists versions; GET /v1/ship/secrets/{id} returns one with its sealed bytes; POST /v1/ship/secrets with {"node", "app", "item", "sealed", "recipient", "digest"} stores one, and refuses anything that is not sealed with age to the key the node reports; POST /v1/ship/secrets/{id}/pin pins a version to a release. Applying is a signed operation (secret.apply), like every other.