Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting started in development mode

Checked with iron-vault 0.2.0-alpha (features: dev-mode), built from main at cc59b80.

Run Iron Vault as your own user with one credential and one route to httpbin.org, and send a request through it.

Development mode gives no isolation from malware running as you. Use it to learn Iron Vault, never to protect real secrets. For that, use the protected Linux install.

Prerequisites

  • Linux, with XDG_RUNTIME_DIR set, as it is in a normal desktop or SSH login.
  • A Rust toolchain, curl and network access to httpbin.org.
  • About 15 minutes.

Steps

1. Build and install

cargo install --path crates/iron-vault --features dev-mode --root ~/.local/iron-vault-dev
chmod -R go-w ~/.local/iron-vault-dev
export PATH="$HOME/.local/iron-vault-dev/bin:$PATH"
iron-vault --version
iron-vault 0.2.0-alpha (features: dev-mode)

The chmod matters: the service refuses to run a binary that another account could replace.

2. Start the service

In a terminal of its own:

iron-vault serve --log-to-stdout | tee -a ~/iron-vault-dev.log

Expect service started, process hardening is incomplete (ERROR, unless you raised RLIMIT_MEMLOCK) and the development-mode warning:

{"service":"iron-vault","service_version":"0.2.0-alpha","schema_version":1,"deployment_profile":"development","level":"WARN","message":"development mode: no isolation from malware running as alice","target":"iron_vault"}

In a second terminal, check the service:

iron-vault ping
iron-vault status
the service is running: development profile, admin protocol version 1
service: locked
profile: development — no isolation from malware running as alice
vault: not initialized (run iron-vault init)
vault id: unknown
approval committed: unknown while the vault is locked
approval highest reserved: unknown while the vault is locked
memory protection: NOT protected, swap protection unavailable (RLIMIT_MEMLOCK soft limit is 8315834368 bytes, not unlimited)
recovery last checked: unknown (the vault is not initialized)
credentials: unknown while the vault is locked

status exits with 4 while the service is not Ready, as here.

3. Create the vault

iron-vault init

init asks for two passphrases, each twice, at least 12 characters and different from each other:

  • the vault passphrase unlocks the vault each time the service starts;
  • the approval passphrase approves config changes and confirms replace and rm.

It then shows the recovery key once, as text and as a QR code. Save it somewhere offline, then type yes:

Vault passphrase:
Repeat the vault passphrase:
Approval passphrase:
Repeat the approval passphrase:
The recovery key follows. It is shown this once, and the service keeps no copy.
It is the second way into the vault if the vault passphrase or this machine is lost.
Store it in an independent password manager or on paper, never beside the vault.
You may also keep it in a passphrase-encrypted file of your own.
AGE-SECRET-KEY-1…
(QR code)
Type yes once you have saved the recovery key: yes
initialized vault 4b3faa85-…: approval version 1 committed
run iron-vault unlock to start serving

init needs a controlling terminal. The service stays Locked.

4. Unlock

iron-vault unlock
Vault passphrase:
the vault is unlocked: the service is Ready
iron-vault status
service: ready
profile: development — no isolation from malware running as alice
vault: unlocked
vault id: 4b3faa85-…
approval committed: 1
approval highest reserved: 1
memory protection: NOT protected, swap protection unavailable (RLIMIT_MEMLOCK soft limit is 8315834368 bytes, not unlimited)
recovery last checked: never (reminders counting since 2026-11-07)
credentials: none

Run unlock again each time you restart the service.

5. Check the recovery key

Prove that the key you saved opens the vault:

iron-vault recovery check
Recovery key:
the recovery key opens vault 4b3faa85-…: checked 2026-11-07T09:43:48Z

status then shows the time under recovery last checked.

6. Store a credential

add takes the credential’s name and the origins it may be sent to, and prompts for the secret. httpbin checks no keys, so type a test value such as not-a-real-key-123:

iron-vault add httpbin_key --origin httpbin.org
iron-vault list
Secret for httpbin_key:
added httpbin_key (static) as record 531d79af-…
httpbin_key  static  httpbin.org:443  healthy

For a real secret, pipe it in so it stays out of your shell history: pass show brave | iron-vault add brave --origin api.search.brave.com.

7. Issue a caller token

Keep tokens in a directory only you can read:

mkdir -m 700 -p ~/.iron-vault-tokens
iron-vault caller-token > ~/.iron-vault-tokens/me

The token goes to the file. The terminal shows the line the config needs:

token_hash = "blake2b:…"
This token is shown once and the service keeps no copy of it.
Put the token_hash line on the caller's [callers.<name>] table and run `iron-vault config approve <file>`.
The token works only once that config is approved and active; the caller's old token, if any, keeps working until then.

Anyone who can read the token file can use its routes.

8. Write and approve a config

Save this as dev-config.toml, anywhere you like, with your own token_hash line:

schema_version = 1

[listeners.loopback]
address = "127.0.0.1:7878"

[callers.me]
listener = "loopback"
token_hash = "blake2b:<the 64 hex digits caller-token printed>"
routes = ["httpbin"]

[routes.httpbin]
prefix = "/httpbin"
upstream = "https://httpbin.org"
credential = "httpbin_key"
slot = { header = "Authorization", format = "Bearer {}" }
methods = ["GET"]
paths = ["/anything/**", "/headers"]
rate_limit = { requests = 30, per_seconds = 60, burst = 5 }

The configuration reference explains each table. Approve it:

iron-vault config approve dev-config.toml
Approval summary
vault: 4b3faa85-…
version to commit: 2
config digest: blake2b:f08dc490…
committed version: 1
callers:
  + me: listener loopback, auth token, rate limits none
route grants:
  + me: granted httpbin
routes:
  + httpbin: prefix /httpbin, upstream https://httpbin.org/, credential httpbin_key, slot header Authorization format "Bearer {}", ca file none, methods GET, paths /anything/**, /headers, rate limit 30 per 60s burst 5, confirm none
listeners:
  + loopback: endpoint tcp 127.0.0.1:7878, no tls, token header default
Approve this config as version 2? Type yes to approve: yes
Approval passphrase for "approval passphrase":
approved version 2 (blake2b:f08dc490…)
callers: 1 added; route grants: 1 added; routes: 1 added; listeners: 1 added; limits: none; logging: none; recovery: none

The listener opens without a restart. Keep editing dev-config.toml, never the service’s published copy in ~/.config/iron-vault-dev/config.toml.

9. Send a request

TOKEN=$(cat ~/.iron-vault-tokens/me)
curl -s -H "Proxy-Authorization: Bearer $TOKEN" http://127.0.0.1:7878/httpbin/headers
{
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, br",
    "Authorization": "Bearer [iron-vault:scrubbed]",
    "Host": "httpbin.org",
    "User-Agent": "curl/8.5.0"
  }
}

httpbin received the secret and echoed it back; Iron Vault scrubbed it from the response. There is no Proxy-Authorization in the echo: your caller token never left the machine.

The service’s log shows the request and the scrub (trimmed):

{"level":"INFO","message":"request completed","event":"request.completed","listener":"loopback","http_method":"GET","caller":"me","route":"httpbin","credential":"httpbin_key","upstream_host":"httpbin.org","status":200,"request_bytes":0,"response_bytes":199,"duration_ms":308,"scrubbed":true,"outcome":"success","target":"iron-vault.request"}
{"level":"WARN","message":"scrubbed a secret from a response","event":"response.scrubbed","route":"httpbin","credential":"httpbin_key","matches":1,"target":"iron-vault.audit"}

10. See the policy refuse

AUTH="Proxy-Authorization: Bearer $TOKEN"
curl -si http://127.0.0.1:7878/httpbin/headers                          # no token
curl -si -H "$AUTH" -X POST http://127.0.0.1:7878/httpbin/anything      # method not allowed
curl -si -H "$AUTH" http://127.0.0.1:7878/httpbin/ip                    # path not allowed
HTTP/1.1 401 Unauthorized
content-type: text/plain; charset=utf-8
content-length: 12

unauthorized
HTTP/1.1 403 Forbidden
content-type: text/plain; charset=utf-8
content-length: 9

forbidden
HTTP/1.1 403 Forbidden
content-type: text/plain; charset=utf-8
content-length: 9

forbidden

Nothing leaves the machine. The log’s reason field says why: unauthenticated, method_not_allowed and path_not_allowed.

What can go wrong

  • iron-vault: refusing to start: /home/alice/projects/iron-vault/target/debug/iron-vault is not trusted: /home/alice/projects is writable by group 1001; run `chmod g-w /home/alice/projects` . Run the binary from ~/.local, not from target/ in a group-writable checkout, and run the chmod in step 1.
  • iron-vault: refusing to start: … is not trusted: /tmp is a shared directory other users can write; move the state directory, config, TLS key or certificate out of /tmp rather than changing its permissions. Point XDG_CONFIG_HOME and XDG_STATE_HOME at directories in your home.
  • iron-vault: the Iron Vault service is not running: there is no admin socket at …. Start the service, with the same XDG_RUNTIME_DIR as the CLI.
  • iron-vault: the service answered error 14 (unlock-denied): wrong passphrase. After 5 wrong vault passphrases, unlock is refused for a cooldown that starts at 30 s and doubles up to 15 min.
  • iron-vault: the service answered error 20 (name-taken): credential httpbin_key already exists, healthy or damaged; `add` never overwrites. Use replace to change an existing credential.
  • 429 Too Many Requests on the first requests after an unlock or approval. The route’s bucket starts empty; wait a few seconds.
  • 503 from the proxy. The service is Locked: run iron-vault unlock.

Reference