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

Configuration

This page lists every table and key of Iron Vault’s configuration file. For each key it gives the type, whether the key is required, its default, the rule it must meet and the refusal you get when it doesn’t. The iron-vault-policy crate checks the config, and every refusal below is copied from its code. Terms follow the glossary, and the specification is the source of the rules.

Check a config first

To catch mistakes before you approve, check the file. This needs no running service, no vault and no sudo:

iron-vault config check my-config.toml

It prints Config ok and exits 0 when the file parses and its sections agree with each other. Otherwise it exits 1 and prints why, with the line and column; a file that cannot be read, or is longer than 61440 bytes, exits 2.

The check is advisory. It does not look at the vault or the host, so it cannot tell whether each route’s credential exists, permits the route’s host and fits its slot, whether a caller’s account exists, or whether the upstream TLS and log destination settings work. config approve checks all of those, and can still refuse a file that passed.

How approval works

You never edit the config the service runs. You edit your own copy, anywhere you like, and approve it:

iron-vault config approve my-config.toml

The CLI sends the file’s bytes to the service. The service then:

  1. writes them beside the active config as config.toml.pending, and checks them as described on this page;
  2. shows its own approval summary of what changes, and asks you to type yes;
  3. asks for the approval passphrase;
  4. reserves the next approval version, signs the config with it, and commits it to the vault;
  5. publishes the config as config.toml, with its signature config.toml.sig, in the config directory, and puts it into force without a restart.

The config directory is /etc/iron-vault in a protected install and $XDG_CONFIG_HOME/iron-vault-dev in development. config-approval.md describes the transaction step by step.

Never edit the published copy. The signature covers every byte, comments and whitespace included. On SIGHUP the service reloads the published pair, and only from Ready. A published config that doesn’t match its signature is refused: the service stops proxying and reports policy invalid until you approve a config again. To change anything, edit your own copy and approve it again.

A config that fails a check uses up no approval version, and the active config doesn’t change. The CLI refuses a file longer than 61440 bytes before sending it:

the config file {path} is longer than 61440 bytes

Reading a refusal

A refused config ends config approve with one line on stderr:

iron-vault: the service answered error 7 (config-invalid): the proposed config is invalid: <detail>

The checks run in four stages, and the detail depends on which stage refused the config.

  1. Parsing reads each table and checks each key on its own: its type, its value, and that no key is unknown. The detail gives only the position of the first fault, because the parser’s message may quote a value from your file:

    config is invalid at line 12, column 7
    

    Look at that line and check it against the rules below. The parser’s own message for each rule is listed in this page’s tables so that you can tell which rule a value breaks. Two parse faults are named in the detail:

    config has no schema_version at line 1, column 1
    config schema_version 2 is unsupported at line 1, column 18
    
  2. Validation checks the tables against each other, for example that every route a caller is granted is defined. It reports every fault it finds, joined by ; , in full.

  3. Activation checks the config against the vault and the host: that each credential exists and permits the route’s upstream, and that each peer caller’s account exists. It also reports every fault in full.

  4. Serving checks run last. The service builds the upstream HTTP clients the routes need and, when the config moves the log, checks the new log destination. A failure here gives one fixed phrase, such as the upstream HTTP client could not be built or the log directory does not exist, and never a path.

The example

This config uses every table, and every kind of listener, caller and slot. A test in iron-vault-policy parses and validates this exact file, so it stays valid as the schema changes. To approve it you would still need the credentials in your vault and the accounts on your host.

# An annotated Iron Vault configuration.
#
# It uses every table and every kind of listener, caller and slot. A test in the iron-vault-policy crate parses and
# validates this file, so it stays valid as the schema changes. Before approving a copy of it, make the names, hashes,
# accounts, files and credentials match your own installation.

schema_version = 1

# --- Listeners: where callers connect ---------------------------------------------------------------------------

# A Unix socket. Any local account may connect; the account the kernel reports for the connecting process decides
# which caller it is.
[listeners.local]
unix_socket = "/run/iron-vault/proxy.sock"

# Plain HTTP on loopback. TCP reports no account, so every caller here presents a caller token. This listener reads
# the token from its own header instead of `Proxy-Authorization: Bearer <token>`.
[listeners.loopback]
address = "127.0.0.1:7878"
token_header = "X-Iron-Vault-Token"

# An address on one container network. It is not loopback, so TLS is required.
[listeners.backoffice]
address = "10.20.0.2:7878"
tls_certificate = "/etc/iron-vault/tls/server.crt"
tls_key = "/etc/iron-vault/tls/server.key"

# --- Callers: who may use which routes --------------------------------------------------------------------------

# Identified by OS account. The account must exist on the host, and must not be root, the service account or the
# overflow uid (`nobody`).
[callers.fx-mcp]
listener = "local"
auth = "peer"
user = "fx-mcp"
routes = ["fx"]

# A second peer caller on the same socket, as a different account.
[callers.code]
listener = "local"
auth = "peer"
user = "code"
routes = ["github"]

# A limit for this caller alone, applied on top of the route's own. It may be stricter, never looser.
[callers.code.rate_limits]
github = { requests = 30, per_seconds = 60, burst = 5 }

# Identified by caller token; `auth = "token"` is the default. Put the line `iron-vault caller-token` printed here.
[callers.brave-cli]
listener = "loopback"
token_hash = "blake2b:0123456789abcdef00112233445566778899aabbccddeeff0f1e2d3c4b5a6978"
routes = ["brave", "venice"]

# Identified by the listener it arrives on: it must be that listener's only caller.
[callers.backoffice]
listener = "backoffice"
auth = "isolated-network"
routes = ["venice", "tickets"]

# --- Routes: where requests go, and with which credential -------------------------------------------------------

# A query slot: the key is sent as `?app_id=<key>`. OpenExchangeRates serves one file per date, so `/historical/*`
# matches one segment such as `2026-11-01.json`. Its plans have monthly quotas, so the rate limit is low. The free
# plan serves rates against USD only, so a request should not set `base`.
[routes.fx]
prefix = "/fx"
upstream = "https://openexchangerates.org/api"
credential = "fx_key"
slot = { query = "app_id" }
methods = ["GET"]
paths = ["/latest.json", "/historical/*", "/currencies.json", "/usage.json"]
rate_limit = { requests = 10, per_seconds = 60, burst = 2 }

# A header slot with a format. The upstream has a base path, which `paths` leaves out: a request for
# /venice/chat/completions is sent to /api/v1/chat/completions.
[routes.venice]
prefix = "/venice"
upstream = "https://api.venice.ai/api/v1"
credential = "venice"
slot = { header = "Authorization", format = "Bearer {}" }
methods = ["POST"]
paths = ["/chat/completions"]
rate_limit = { requests = 120, per_seconds = 60, burst = 20 }

# A header slot without a format: the header holds the key alone.
[routes.brave]
prefix = "/brave"
upstream = "https://api.search.brave.com"
credential = "brave"
slot = { header = "X-Subscription-Token" }
methods = ["GET"]
paths = ["/res/v1/web/search"]
rate_limit = { requests = 60, per_seconds = 60, burst = 10 }

# `*` matches exactly one path segment: here the owner and the repository.
[routes.github]
prefix = "/github"
upstream = "https://api.github.com"
credential = "github"
slot = { header = "Authorization", format = "Bearer {}" }
methods = ["GET", "POST"]
paths = ["/user/repos", "/repos/*/*/issues"]
rate_limit = { requests = 60, per_seconds = 60, burst = 10 }
confirm = "none"

# A Basic slot, for a credential added with a username and password. The upstream is self-hosted, so the route trusts
# an administrator-installed CA instead of the built-in roots.
[routes.tickets]
prefix = "/tickets"
upstream = "https://tickets.internal.example/rest/api/2"
credential = "tickets"
slot = "basic"
methods = ["GET", "POST", "PUT"]
paths = ["/issue", "/issue/*", "/search"]
rate_limit = { requests = 20, per_seconds = 60, burst = 5 }
ca_file = "/etc/iron-vault/ca/tickets.pem"

# --- Service-wide settings --------------------------------------------------------------------------------------

# Overrides for some operational limits; the rest keep their defaults.
[limits]
max_request_body_bytes = 1048576
request_timeout_secs = 120
upstream_timeout_secs = 60

# Where the log goes. This is the protected install's default, written out.
[logging]
destination = "/var/log/iron-vault"

# Remind the owner to check the recovery key every 30 days instead of every 90.
[recovery]
reminder_days = 30

The file

The config is one TOML file in UTF-8. Its top level holds schema_version and these tables:

TableRequiredWhat it holds
[listeners.<name>]nowhere callers connect
[callers.<name>]nowho may connect, how they are identified, which routes
[routes.<name>]nowhere requests go, and with which credential
[limits]nooperational limits for the whole service
[logging]nowhere the log goes
[recovery]nohow often to remind you to check the recovery key

An empty config with only schema_version = 1 is valid: init approves one as version 1. It opens no listener.

Unknown keys are refused in every table, so a misspelt key is an error rather than a silently ignored setting:

unknown field `backlog`, expected one of `unix_socket`, `address`, `tls_certificate`, `tls_key`, `token_header`

Names. Listener, caller, route and credential names are 1 to 64 bytes of a-z, 0-9, _ and -, starting with a lowercase letter. A caller’s routes and a route’s credential refer to these names.

invalid listener name: must start with a lowercase ASCII letter, found 'L'

Paths. Every file or socket path (unix_socket, tls_certificate, tls_key, ca_file) must be absolute, with no .. component and no NUL byte:

path "run/a.sock" must be absolute
path "/run/../a.sock" must not contain a '..' component

schema_version

TypeRequiredDefaultRule
integeryesnonemust be 1 this release

The version of the config’s format, and the only top-level key that is not a table. (The glossary’s schema version is the field of the same name in a log record; it is a different number.)

schema_version = 1
FaultParser message
missingconfiguration has no schema_version at line 1, column 1; expected schema_version = 1
any other valueunsupported schema version 2 at line 1, column 18; this release reads schema_version = 1

[listeners.<name>]

A listener is one socket or address where callers connect. Each caller names the listener it arrives on.

KeyTypeRequiredDefault
unix_socketpathexactly one of unix_socket and addressnone
addressstringexactly one of unix_socket and addressnone
tls_certificatepathwith tls_key; required off loopbacknone (plain HTTP)
tls_keypathwith tls_certificatenone
token_headerstringnoProxy-Authorization
[listeners.local]
unix_socket = "/run/iron-vault/proxy.sock"

[listeners.backoffice]
address = "10.20.0.2:7878"
tls_certificate = "/etc/iron-vault/tls/server.crt"
tls_key = "/etc/iron-vault/tls/server.key"

address is an IP address and port, 127.0.0.1:7878 or [::1]:7878. A host name is refused, and so is port 0.

TLS off loopback. A listener on any address outside loopback must have tls_certificate and tls_key, so that caller tokens never cross a network in clear. Loopback means 127.0.0.0/8 or ::1. ::ffff:127.0.0.1 is not loopback. A Unix socket never takes TLS. Approval refuses a listener without them and names it: listener public on 192.0.2.10:8443 needs tls_certificate and tls_key: plain HTTP is allowed only on loopback.

Socket activation. In a protected install, systemd opens TCP listeners and passes them to the service. Adding an address listener there also needs a systemd socket unit: see Add a TCP listener.

token_header is the header from which callers on this listener send their caller token:

  • Not set, or set to Proxy-Authorization: the caller sends Proxy-Authorization: Bearer <token>. The scheme may be in any case, followed by exactly one space.
  • Any other header, such as X-Iron-Vault-Token: the whole header value is the token, and Proxy-Authorization is not read. Use this for a client that can add a fixed header but can’t send Proxy-Authorization.

A missing token, an unknown one, or the header sent more than once is refused with 401. The service strips the token header before forwarding, so the upstream never sees it. The header must not be a reserved header, apart from Proxy-Authorization and X-Iron-Vault-Token, and must not be the slot header of a route that this listener’s callers can use. A caller token sent in any other header is forwarded upstream as an ordinary header; see Reserved headers.

FaultParser message
neither unix_socket nor addresslistener needs exactly one of unix_socket or address; neither is set
bothlistener needs exactly one of unix_socket or address; both are set
not an IP address and portlistener address "localhost:7878" is not an IP address and port such as 127.0.0.1:7878 or [::1]:7878
port 0listener address 127.0.0.1:0 uses port 0
one TLS filelistener sets only one of tls_certificate and tls_key; set both or neither
TLS on a Unix sockettls_certificate and tls_key apply only to an address listener, not a unix_socket
reserved token_headertoken_header X-Forwarded-Token is a reserved header; choose a dedicated header such as X-Iron-Vault-Token
malformed header nameheader name "X Token" contains ' ', which is not allowed in an HTTP token

One validation refusal, shown in full:

listener loopback token_header x-key is the credential slot of route brave, which its callers can use

[callers.<name>]

A caller is one program, or one group of programs, that Iron Vault recognises and grants routes to.

KeyTypeRequiredDefault
listenerlistener nameyesnone
authstringno"token"
token_hashstringwith auth = "token" onlynone
useraccount namewith auth = "peer" onlynone
routesarray of namesyes, at least onenone
rate_limitstablenonone
[callers.brave-cli]
listener = "loopback"
token_hash = "blake2b:0123456789abcdef00112233445566778899aabbccddeeff0f1e2d3c4b5a6978"
routes = ["brave", "venice"]

How a caller is identified: auth

auth is one of three values. Each listener uses one of them for all its callers.

"token", the default. The caller sends a caller token, and token_hash holds its hash. iron-vault caller-token makes a token, writes it to stdout and prints the token_hash = "blake2b:..." line for the config. The service keeps only the hash. A token is ivt_ followed by 43 base64url characters, and its hash is blake2b: followed by 64 lowercase hex digits. Anyone who can read the token can use the caller’s routes, so keep it in a file only the caller’s account can read. To rotate it, put the new hash in the config and approve: the old token stops working at that moment. Token callers on one listener must have different hashes.

"peer". The caller is recognised by the OS account of the connecting process, which the kernel reports on a Unix socket. There is no token to steal. user names the account: a-z or _, then a-z, 0-9, _ or -, with an optional trailing $, at most 32 bytes. Peer callers need a unix_socket listener, and every caller on that listener must be a peer caller with a different account. Activation checks the account on the host: it must exist, and must not be root, the service account or the overflow uid, and no two peer callers on one listener may resolve to the same uid. The service reads /etc/passwd afresh at each activation (an unlock, a reload, a config approve), so an account you create while it runs can be named at once, without a restart. A peer account you delete fails the next activation: a reload or unlock leaves the service Unavailable with reason policy invalid until you approve a config without that caller. Accounts only a directory service such as LDAP or SSSD knows are not in /etc/passwd, so they are unknown. Development mode runs the service as your own account, which is never a peer account, so peer callers are for a protected install.

"isolated-network". The caller is recognised by the listener alone: it is the only caller on a TLS address listener bound to an address only it can reach, such as its own container network. The address must be dedicated, so neither loopback nor a wildcard address such as 0.0.0.0.

[callers.fx-mcp]
listener = "local"
auth = "peer"
user = "fx-mcp"
routes = ["fx"]

[callers.backoffice]
listener = "backoffice"
auth = "isolated-network"
routes = ["venice", "tickets"]

routes and rate_limits

routes lists the routes the caller may use. It must not be empty or repeat a route, and every route it names must be defined.

rate_limits sets a rate limit for this caller on one of its routes. It applies on top of the route’s own limit, which all the route’s callers share. It may be stricter than the route’s limit but never looser, in rate or in burst.

[callers.code.rate_limits]
github = { requests = 30, per_seconds = 60, burst = 5 }

Refusals

Parser messages:

FaultParser message
token caller without token_hashcaller uses token authentication but has no token_hash
hash without the prefixtoken hash must start with "blake2b:"
hash of the wrong lengthtoken hash digest is 3 characters long; it must be 64 lowercase hex digits
hash with another charactertoken hash digest has a character other than 0-9 or a-f at byte 10
peer caller without usercaller uses auth = "peer" but has no user
token_hash on a peer callercaller sets token_hash but uses auth = "peer"; token_hash applies only to auth = "token"
user on a token callercaller sets user but uses auth = "token"; user applies only to auth = "peer"
unknown authunknown variant `password`, expected one of `token`, `isolated-network`, `peer`
empty routescaller must be granted at least one route
repeated routecaller lists route fx more than once
limit for a route not grantedcaller sets a rate limit for route brave, which is not in its routes
malformed accountinvalid account name "Alice": must be a-z or '_', then a-z, 0-9, '_' or '-', with an optional trailing '$'

Validation messages, shown in full:

caller code is granted route gitlab, which is not defined
caller code names listener lan, which is not defined
caller code rate limit for route github allows a higher request rate than the route's own limit
caller code rate limit for route github allows a larger burst than the route's own limit
caller fx-mcp uses auth = "peer", which needs a unix_socket listener; listener loopback is not one
caller backoffice uses auth = "isolated-network", which needs an address listener with TLS; listener local is not one
caller backoffice needs listener backoffice to bind a dedicated address
caller backoffice uses auth = "isolated-network", so it must be the only caller on listener backoffice, which brave-cli also use; callers that share a TCP listener must use tokens
listener local has peer callers, so every caller on it must use auth = "peer"; brave-cli do not
callers code, fx-mcp on listener local share user alice, so one account would identify more than one caller
callers brave-cli, chat on listener loopback share a token_hash, so one token would identify more than one caller

Activation messages:

caller fx-mcp names user fx-mcp, which is not an account on this host
caller fx-mcp names user root, which is root or the service account; neither may be a peer account
caller fx-mcp names user nobody, the overflow uid; the kernel reports this uid for processes outside this user namespace
callers code, fx-mcp on listener local name accounts with uid 1001, so one account would identify more than one caller
the host's account list cannot be read: permission denied

[routes.<name>]

A route maps requests under a path prefix to one upstream, with one credential in one slot.

KeyTypeRequiredDefault
prefixstringyesnone
upstreamstringyesnone
credentialcredential nameyesnone
slotstring or tableyesnone
methodsarray of stringsyesnone
pathsarray of stringsyesnone
rate_limittableyesnone
confirmstringno"none"
ca_filepathnonone
[routes.venice]
prefix = "/venice"
upstream = "https://api.venice.ai/api/v1"
credential = "venice"
slot = { header = "Authorization", format = "Bearer {}" }
methods = ["POST"]
paths = ["/chat/completions"]
rate_limit = { requests = 120, per_seconds = 60, burst = 20 }

prefix

The path under which the caller sends requests for this route. The service takes the prefix off and sends the rest of the path to the upstream. A prefix matches whole segments: /fx matches /fx and /fx/latest, never /fx.evil or /fxx. No two routes’ prefixes may overlap, so /fx and /fx/v2 can’t both be used.

A prefix is made of literal segments, with the same characters as a path pattern. It must not be /, contain a wildcard, end in a slash or contain %.

FaultParser message
/route prefix must not be "/"; it would match every request path
trailing slashroute prefix breaks a path-pattern literal rule: path pattern "/r/" contains an empty segment or trailing slash
wildcardroute prefix "/r/*" must not contain a wildcard segment
overlap (a validation message)route fx prefix overlaps route fx-v2 prefix

upstream

The HTTPS URL that requests are sent to, with an optional base path. It must start with https:// in lowercase, and has no user-info, query or fragment. An IP address host must be written in its canonical form, and the base path has no dot segments. A trailing slash is dropped. The port defaults to 443.

FaultParser message
not HTTPSupstream URL must start with "https://"
user-infoupstream URL must not contain user-info
queryupstream URL must not contain a query
fragmentupstream URL must not contain a fragment
dot segmentupstream URL base path segment ".." is a dot segment
non-canonical IPupstream URL host is invalid: host denotes an IP address but is not written as a canonical IPv4 or bracketed IPv6 literal
port 0upstream URL port is invalid: port 0 is not allowed

credential, and where it may go

credential names a credential in the vault, which you stored with iron-vault add. The origins given to add are kept inside the encrypted credential record. Activation refuses a route whose upstream is not one of them, so a config change can never send an existing key to a new host. Only iron-vault replace changes the origins.

route venice uses credential venice, which the vault does not hold
route brave sends credential brave to an origin its record does not permit
route tickets uses credential tickets, of kind static, on a slot that kind cannot fill: a static key fills a header or query slot

methods

The HTTP methods the route allows: any of GET, HEAD, POST, PUT, PATCH, DELETE and OPTIONS, in upper case. CONNECT and TRACE are never allowed. The list must not be empty or repeat a method. A request with another method is refused before anything is sent.

FaultParser message
emptyroute must allow at least one method
repeatedroute lists method GET more than once
not supportedunsupported method "get"; expected one of GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS
never allowedmethod TRACE is never allowed

paths and the base path

The path patterns the route allows. A request whose path matches none of them is refused before anything is sent.

Patterns match the request path after the route prefix, which is the path the provider documents, without the upstream’s base path. The service adds the base path when it forwards the request. With upstream = "https://api.venice.ai/api/v1" and prefix = "/venice", paths = ["/chat/completions"] allows a request for /venice/chat/completions, which is sent to /api/v1/chat/completions. Patterns never see the query string.

caller sends     /venice/chat/completions
                 └─────┘└───────────────┘
                 prefix   matched against paths = ["/chat/completions"]

upstream gets    https://api.venice.ai/api/v1/chat/completions
                 └─── upstream, with its ───┘└───────────────┘
                      base path /api/v1       the same path

Brave Search documents /v1/web/search, and its API lives under /res, so the route’s upstream and paths are:

[routes.brave]
upstream = "https://api.search.brave.com/res"
paths = ["/v1/web/search"]

A pattern that repeats the base path, such as /res/v1/web/search, is legal but means /res/res/v1/web/search, so it matches nothing the provider serves.

Wildcards stand for whole segments.

  • * matches exactly one segment: /repos/*/*/issues matches /repos/octo/demo/issues, not /repos/octo/issues. /historical/* matches /historical/2026-11-01.json.
  • ** matches zero or more segments: /files/** matches /files, /files/2024 and /files/2024/01/02.
  • / alone has no segments and matches only the root path.
  • ["/**"] allows every path. It must be written out; an empty list is refused.

A pattern starts with /, has no empty segment or trailing slash, and no dot segment. A wildcard must be the whole segment, so a* is refused. Literal segments may hold letters, digits and - . _ ~ ! $ & ' ( ) + , ; = : @; % and other characters are refused. Each pattern may be listed only once.

FaultParser message
empty listpath patterns must not be empty; use ["/**"] to allow every path explicitly
repeatedpath pattern "/v1" is listed more than once
no leading slashpath pattern "v1" must start with '/'
trailing slashpath pattern "/v1/" contains an empty segment or trailing slash
partial wildcardpath pattern "/v1/a*" has a partial wildcard segment "a*"
dot segmentpath pattern "/v1/../x" contains a dot segment
other characterpath pattern "/v1/a%20b" contains disallowed character '%'

slot: where the credential goes

The slot is the one place the service writes the credential. It first removes anything the caller sent there, so a placeholder key in the application is replaced, never forwarded. There are three kinds:

SlotCredential kindWhat the upstream gets
{ header = "X-Subscription-Token" }staticX-Subscription-Token: <key>
{ header = "Authorization", format = "Bearer {}" }staticAuthorization: Bearer <key>
{ query = "app_id" }static?app_id=<key>, added to the query
"basic"basicAuthorization: Basic <base64 of user:password>
{ header = "Authorization", format = "Bearer {}" }OAuth accountAuthorization: Bearer <access token>
  • header is an HTTP header name that is not a reserved header. Authorization is allowed.
  • format applies only to a header slot, and defaults to {}. It is printable ASCII with exactly one {}, where the key goes, and no other braces.
  • query is a parameter name made only of A-Z a-z 0-9 - . _ ~.
  • "basic" is for a credential added with a username and password.
  • An OAuth account record, which login makes, fills a header slot only, with the access token the service refreshes. An OAuth client record fills no slot, so no route may name it.
FaultParser message
reserved headerheader Host is reserved for caller authentication or transport control and cannot be a slot
format without {}slot format "Bearer" has no {} substitution point
format with two {}slot format "{} {}" must contain exactly one {} and no other braces
format not printable ASCIIslot format "B\u{e9} {}" contains '\u{e9}'; only printable ASCII is allowed
format on a query slot`format` applies only to header slots
both or neither of header, querya slot table must name exactly one of `header` or `query`
query name with another characterquery parameter name "api key" contains ' '; only A-Z a-z 0-9 - . _ ~ are allowed
empty query namequery parameter name is empty
any other stringinvalid value: string "bearer", expected "basic" or a table with `header` (and optional `format`) or `query`

rate_limit: the token bucket

Every route has a rate limit, written as three nonzero whole numbers:

rate_limit = { requests = 60, per_seconds = 60, burst = 10 }

The limit is a token bucket. The bucket holds at most burst tokens and refills at requests tokens every per_seconds seconds. Each request takes one token, and a request that finds the bucket empty gets 429. The example above allows one request a second on average, and up to 10 at once after a quiet spell.

Every bucket starts empty each time the service becomes Ready, and fills from there: after unlock, an approval, a SIGHUP reload, a repair, or a replace or rm. Each of these runs a config check, and every config check builds new buckets. A service that has just started is Locked, so in practice its buckets begin at unlock. Neither a restart nor a reload ever hands out a fresh burst. In the example, the first request is allowed one second after the service becomes Ready, and the full burst of 10 only after ten quiet seconds.

All the route’s callers share its bucket. A caller’s rate_limits entry adds a second bucket of its own, and a request needs a token from both. A route you don’t want limited still needs a limit: give it a generous one.

FaultParser message
zeroinvalid value: integer `0`, expected a nonzero u32
missing keymissing field `burst`

confirm

"none", the default and the only value v0 accepts. "touch" is reserved for a later phase, where a touch route will need confirmation on a security key for each request. No confirmation provider exists in v0, so a config that sets confirm = "touch" is refused when it is read, before any prompt, at the position of the value.

FaultParser message
"touch"confirm = "touch" is not yet available: v0 has no touch confirmation provider
any otherunknown variant `always`, expected `none`

ca_file

A PEM file of CA certificates that the route trusts instead of the built-in roots, for a self-hosted upstream with its own CA. Install it where only an administrator can write. If the file can’t be read or parsed, the config is still approved, but the routes that pin it are unavailable until it is fixed.

ca_file = "/etc/iron-vault/ca/tickets.pem"

Reserved headers

The service removes these headers from every request before forwarding, and controls Host itself. None of them may be a route’s slot, and none but Proxy-Authorization and X-Iron-Vault-Token may be a listener’s token_header. Names are compared without regard to case.

  • Hop-by-hop: Connection, Keep-Alive, Proxy-Connection, Proxy-Authenticate, Proxy-Authorization, TE, Trailer, Transfer-Encoding, Upgrade.
  • Transport and routing: Host, Content-Length, Forwarded, Via, X-Real-IP, True-Client-IP, X-Client-IP, CF-Connecting-IP, X-Host, X-Original-Host, X-HTTP-Host-Override.
  • Method override and URL rewrite: X-HTTP-Method-Override, X-Method-Override, X-HTTP-Method, X-Original-URL, X-Rewrite-URL.
  • Caller token: X-Iron-Vault-Token, the dedicated caller-token header. It is stripped on every listener, whether or not that listener reads its token from it, so a caller admitted by another means never sends a token upstream in it.
  • Any header starting with X-Forwarded-.

The service also strips the listener’s own token_header and any header that Connection names.

Iron Vault strips a caller token only from Proxy-Authorization, X-Iron-Vault-Token and the listener’s own token_header. A token a client sends in any other header, including another listener’s custom token_header, is forwarded upstream as an ordinary header. Configure each client to send its token only in its listener’s token header.

[limits]

Service-wide limits. Every key is optional; a key left out keeps its default. Zero is refused, and so is a value above the ceiling.

KeyTypeDefaultCeilingWhat it bounds
max_header_bytesinteger65536 (64 KiB)1048576 (1 MiB)a request line and headers, in bytes
max_header_countinteger1001000a request’s headers, in count
max_request_body_bytesinteger10485760 (10 MiB)1073741824 (1 GiB)a request body
max_decompressed_response_bytesinteger67108864 (64 MiB)4294967296 (4 GiB)a response body after decompression for scrubbing
max_decompression_ratiointeger10010000decompressed size over compressed size
request_timeout_secsinteger3003600a whole request, in seconds
upstream_timeout_secsinteger300600waiting for the upstream’s response headers; at most request_timeout_secs
max_connectionsinteger25665536concurrent caller connections
[limits]
max_request_body_bytes = 1048576
request_timeout_secs = 120
upstream_timeout_secs = 60
FaultParser message
zerolimits.max_connections must not be zero
above the ceilinglimits.max_connections is 70000; the maximum is 65536
timeouts crossedlimits.upstream_timeout_secs (400) must not exceed limits.request_timeout_secs (300)

[logging]

KeyTypeRequiredDefault
destinationstringnothe bootstrap destination

Where the log goes: "stdout", or an absolute directory in which the service writes iron-vault.log. When it is not set, the bootstrap destination applies: /var/log/iron-vault in a protected install, $XDG_STATE_HOME/iron-vault-dev-log in development, or stdout when serve has --log-to-stdout.

A directory must be absolute, with no control characters and no .., and outside the state and config directories. It must also pass the log directory’s trusted-path rule; the log operations guide gives the owner and modes. Create it before you approve. A development build creates its missing bootstrap log directory at 0700 when serve starts, but never a directory that a config names.

Checked at approval. When the config changes the destination, config approve checks the new one before it reserves a version: that the directory exists, resolves to a canonical path outside the state and config directories, and passes the trusted-path rule. It creates and writes nothing. A failure is config-invalid with a fixed phrase, for example:

the log directory is, or is inside, the state directory
the log directory does not exist
the log directory, or a directory above it, is writable by others
[logging]
destination = "/var/log/iron-vault"
log destination must be "stdout" or an absolute directory: path "logs" must be absolute

Switching. When the service becomes Ready with a config that moves the log, it checks the destination again, then switches to it. It writes service.log-destination-changed to the old destination and then to the new one, so each file records where the log went. Removing the key moves the log back to the bootstrap destination the same way. If the check fails at that point, the service stays Unavailable (policy invalid) and keeps writing where it was.

[recovery]

KeyTypeRequiredDefault
reminder_daysintegerno90

How many days may pass after the last iron-vault recovery check before the service reminds you to run another. It is a whole number from 7 to 365. It is part of the approved config, so silencing the reminders needs the approval passphrase. When the key is absent, the approval summary shows the interval as default.

[recovery]
reminder_days = 30
recovery.reminder_days must be a whole number of days from 7 to 365, not 3