Audit log
The log is JSON Lines: one flat JSON object per line, in one file, iron-vault.log
(where it is). A line is one of three things:
- a request event,
request.completed: one per request the service received, served or refused; - an audit event: an administrative or security fact, such as an approval, a lock transition or a damaged record;
- a diagnostic record: anything else, for a developer. It has no
eventfield.
No record holds a secret, a caller token, a passphrase, a header value, a request or response body, a raw query string or a library error’s text (§18).
This page lists what the records hold. The log operations guide covers rotation, permissions, Docker, collectors and more queries; Investigate with the audit log walks through an investigation. The design is audit-logging.md.
Record envelope
Every record has these fields:
| Field | Type | Value |
|---|---|---|
timestamp | string | RFC 3339 in UTC with fractional seconds, such as 2026-11-05T10:15:30.123456Z |
level | string | ERROR, WARN, INFO, DEBUG or TRACE |
target | string | iron-vault.request for the request event, iron-vault.audit for audit events, a module path for a diagnostic record |
service | string | always iron-vault |
service_version | string | the release version |
schema_version | number | 1. It rises when a field or event is renamed or removed, or a label changes meaning; additions do not change it |
deployment_profile | string | protected, development or container |
message | string | a short fixed phrase; values are in fields, never in the message |
event | string | the event name; request and audit events only |
Request and audit events are always written, at any level set for diagnostic records, so no setting can turn
the audit log off. A field with no value is left out, never written as null or "". Fixed labels are snake_case
(policy_invalid, wrong_passphrase); event names are kebab-case after the dot. A list is one string with its items
separated by ,.
Shared fields
These mean the same, with the same type, in every event that has them:
| Field | Type | Meaning |
|---|---|---|
request_id | string | A random UUID per request; joins request.completed to response.scrubbed and request.defect |
caller, route, credential | string | Configured names |
record_id | string | A credential record’s ID |
token_host | string | The host of the token endpoint an OAuth client record’s provider definition names |
approver_id | string | The approver that was asked for the approval passphrase, or that signed: its ID, a hyphenated UUID |
approver_label | string | That approver’s label, escaped; init labels the approval passphrase’s approver approval passphrase |
version | number | An approval version |
committed_version | number | The committed approval version; absent when none is committed |
config_digest | string | blake2b: and 64 hex digits |
file | string | A state or config file name, never a path |
step | string | A fixed step label |
refusal | string | Why something was refused: a fixed label |
unavailable_reason | string | locked, policy_invalid, checking or recovery_needed |
detail | string | A check failure’s detail: fixed phrases with versions and configured names only |
error_kind | string | A library error’s fixed kind label, never its text |
remediation | string | A fixed phrase saying what to do |
log_destination | string | stdout, or the log directory’s absolute path |
The request event
request.completed, at INFO, target iron-vault.request. It is written when the service has finished with the
request: when the response body ends, fails or is dropped, or at once for a fixed refusal.
| Field | Type | Present | Meaning |
|---|---|---|---|
request_id | string | always | The request ID |
listener | string | always | The listener it arrived on |
http_method | string | always | The method as received, escaped |
caller | string | once the caller is identified | The caller’s name |
route | string | once a route is selected | The route’s name |
credential | string | once a route is selected | The route’s credential |
upstream_host | string | once a route is selected, unless the answer was replaced | The upstream host; never the port, path or query |
status | number | once a response existed | The HTTP status sent |
request_bytes | number | always | Body bytes read from the caller |
response_bytes | number | always | Body bytes sent to the caller, after scrubbing |
duration_ms | number | always | Whole milliseconds from receipt to the end of the response body |
scrubbed | boolean | once a relayed response was sent | Whether a scrub pattern matched |
outcome | string | always | success (an upstream response was relayed in full, with any status) or failure |
reason | string | when outcome is failure | The reason code. The errors reference lists every one with its status |
Audit events
Every audit event has the target iron-vault.audit. The fields are those beyond the envelope.
Service and lock state
| Event | Level | When | Fields |
|---|---|---|---|
service.started | INFO | The log is open, before the admin socket is bound | log_destination, core_dumps (disabled or not_disabled), memory_protection (locked, unavailable or unsupported) |
service.hardening-incomplete | ERROR | At startup, when core dumps are not disabled or memory is not locked | core_dumps, memory_protection, remediation |
service.log-destination-changed | INFO | An approved config moved the log; written to both the old and the new destination | log_destination, previous_log_destination, version |
service.lock-transition | INFO | Locked to Checking on an unlock, or Starting to Checking on a host unlock, the check’s outcome, and Ready or Unavailable to Locked | from_state, to_state (starting, locked, checking, ready, unavailable or stopped); unavailable_reason when to_state is unavailable |
vault.unlock-refused | WARN | An unlock was refused, or init or the host unlock at startup was refused for unprotected memory (memory_unprotected) | refusal: wrong_passphrase, rate_limited, memory_unprotected, wrong_state, state_read, passphrase_envelope, identity_envelope, initialization_unfinished, import_unfinished, reset_unfinished, not_initialized, unrecognized_files, state_unreadable or interrupted; memory_protection for memory_unprotected; retry_after (whole seconds) for rate_limited |
vault.host-unlock | INFO when unlocked, absent or owner_locked, WARN when refused or unseal_failed | A Protected or Container service tried the unlock handoff at startup, or skipped it because an earlier lock left the owner-lock file; a Development service never writes it | host_unlock_outcome (unlocked, absent, unseal_failed, owner_locked or refused); unseal_failed means no handoff and the handoff unit left its unseal-failure file, as after a firmware dbx or KEK update; refusal when refused: memory_unprotected, untrusted, unreadable, not_an_identity, not_initialized or not_a_recipient. Never the handoff’s bytes or its recipient key. A memory_unprotected refusal also writes vault.unlock-refused. |
vault.foreign-file | WARN | unlock found a file beside the manifest that the vault does not use; the file is never read, and the unlock goes on | file, escaped |
vault.presence-refused | WARN | The approval passphrase or TPM approval PIN for replace, rm, recipient remove or approver add was refused, or the TPM was locked out; nothing was written | refusal (wrong_passphrase, key_mismatch, wrong_pin or tpm_refused), tpm_status (a TPM approver only, and only for an answer the TPM signing helper was asked about, so never for one that was empty, not UTF-8 or shorter than an enrolled PIN: wrong_pin, locked_out, not_this_tpm, key_mismatch, weak_da_settings, refused_message, tpm_error, malformed, unreachable or bad_signature), approver_id, approver_label |
vault.lock-incomplete | WARN | A lock finished while a request still held a snapshot or the vault identity | snapshots_held (number), identity_held (boolean) |
Admin commands and caller tokens
| Event | Level | When | Fields |
|---|---|---|---|
admin.command | INFO | An admin principal’s command was read | command (config_approve, caller_token, unlock and so on), principal_uid |
admin.refused | WARN | An admin connection or request was refused before any command ran | refusal: not_admin_principal, peer_unreadable, busy, unsupported_version, malformed_frame, unknown_command or unexpected_frame; peer_uid and peer_pid when known; peer_pid is absent when the peer is in another PID namespace, such as the host CLI in the Container profile |
caller.token-issued | INFO | A caller token was issued | none; the token is never logged |
caller.token-failed | ERROR | No caller token could be issued | error_kind |
A command refused after it was read, such as init in the wrong state, records only admin.command.
Config approvals and checks
| Event | Level | When | Fields |
|---|---|---|---|
config.approval-refused | WARN | The approval passphrase or TPM approval PIN was wrong, opened the wrong key, or the TPM was locked out; nothing was reserved | refusal (wrong_passphrase, key_mismatch, wrong_pin or tpm_refused), tpm_status (a TPM approver only; as for vault.presence-refused), config_digest, approver_id, approver_label |
config.version-reserved | INFO | A version was reserved, before signing | version, config_digest, approver_id, approver_label |
config.approval-failed | WARN | The approval failed after its reservation and before its commit; the version is used up | version, config_digest, step, error_kind |
config.commit-uncertain | WARN | The commit’s rename landed but its directory fsync failed | version, error_kind |
config.approval-completed | INFO | The commit is durable | version, config_digest, summary (the approval summary’s text, or initial config for version 1), approver_id, approver_label |
config.activation-failed | WARN | The config check after a committed approval failed | version, unavailable_reason, detail |
config.check-failed | WARN | Any config check failed | unavailable_reason, failure (a fixed label), detail; log_destination when the log destination failed |
config.reload-failed | WARN | The config check of a SIGHUP reload failed | committed_version, unavailable_reason, detail |
config.recovery-published | WARN | A config check finished publishing a committed approval | version, renames |
config.recovery-discarded | INFO | A config check removed an uncommitted file | file; signed_for for a staged approval whose version is known |
config.conflicting-approval-discarded | ERROR | A staged approval for the committed version but another config was found and discarded. Only a second signature or a file the service did not write can cause it | version |
A reserved version is never a completed approval: look for config.approval-completed.
Credentials and vault writes
| Event | Level | When | Fields |
|---|---|---|---|
credential.added | INFO | An add committed, of any kind but an OAuth client | credential, record_id, kind, origins |
credential.oauth-client-added | INFO | An add --kind oauth-client committed | credential, token_host |
credential.login | INFO | A login wrote its account record; a config check that then fails is reported separately | credential, client, display_name (the verified account), outcome (added) |
credential.login-refused | WARN | A login ended without writing | credential and client when they are valid names, reason: the error code’s name, or cancelled when the connection closed or the paste prompt timed out |
credential.replaced | INFO | A replace committed | credential, old_record_id, record_id, kind, origins; old_kind and old_origins when the old record was healthy |
credential.removed | INFO | An rm committed | credential, record_id |
credential.short-secret | WARN | A record just written has a short secret, which the scrubber may also match in innocent text | credential, secret_field, len |
credential.refreshed | INFO, or WARN | A refresh put a new access token in an OAuth account’s token slot. WARN when the provider sent a new refresh token that could not be written to the vault yet, so a restart goes back to the stored one | credential, client, rotated |
credential.refresh-failed | WARN | A refresh gave no access token, and the account does not need login. The next refresh is tried after the provider’s minimum retry interval | credential, client, failure; provider_status when the provider answered |
credential.refresh-write-failed | ERROR | A refresh of an account whose provider rotates refresh tokens, such as a GitHub App, succeeded, but the new refresh token could not be written to the vault. The account’s routes answer token_unavailable until the next request’s retried write stores it; a restart before then finds the account needs login | credential, client, error_kind |
credential.needs-login | WARN | An OAuth account needs a new login | credential, client, cause |
credential.revoked | INFO | The provider revoked the grant of an OAuth account that rm removed, or that a login moved to another account or client or ended without writing | credential; client when the vault still holds the client record |
credential.revoke-failed | WARN | That revocation was not sent, or the provider refused it, so the service told you to revoke the app’s access at the provider. The command still succeeded. A client whose provider has no revocation endpoint gets that notice only, with no event | credential, failure; client when the vault still holds the client record; provider_status when the provider answered |
vault.unindexed-removed | WARN | A vault write first removed a record file the manifest does not list | file |
vault.superseded-left | WARN | A write committed but could not remove the file it replaced; the next write removes it | file, error_kind |
vault.commit-uncertain | ERROR | A state file was replaced but the directory fsync failed, so the change may not survive power loss | file, error_kind |
vault.record-upgraded | INFO | Opening the vault rewrote a credential record written by 0.6.0-alpha in the current format, with no owner action | credential, record_id, from_version (1), to_version (2) |
vault.record-upgrade-failed | WARN | That rewrite failed. The credential keeps serving, and the next unlock or reload tries again | credential, record_id, error_kind |
kind is static or basic. origins lists https://host:port values.
For the OAuth events, credential is the account and client is the OAuth client record it names. failure is
request_check (the request broke the provider definition, so nothing was sent), not_delivered, maybe_delivered,
server_error, unparseable or provider_error (the provider refused with another error code, such as
invalid_client). For credential.revoke-failed, failure is not_serving (the service was not serving, so
nothing was sent; this includes a change that was written but whose config check then failed), client_unreadable,
request_check, not_delivered, maybe_delivered, server_error, unparseable or refused (an error answer, or
a status other than 2xx). cause is refused (the provider refused the refresh token) or uncertain (a rotating
refresh may have reached the provider). No event carries a token, the client secret or the provider’s answer.
Corruption
Each of these also has remediation.
| Event | Level | When | Fields |
|---|---|---|---|
vault.record-damaged | ERROR | A listed record is damaged and was not loaded; its routes answer 503 | credential, record_id, file, damage (missing, substituted or unreadable); error_kind when a read failed |
vault.unindexed-file | WARN | Opening the vault found a record file the manifest does not list; it was not loaded | file |
vault.approval-state-unrecorded | WARN | The approval state exists but the manifest does not record it | none beyond remediation |
vault.shared-state-damaged | ERROR | The vault’s shared state is damaged | file, damage |
vault.state-dir-unreadable | ERROR | The state directory cannot be listed | error_kind |
Initialization
| Event | Level | When | Fields |
|---|---|---|---|
vault.init-discarded | WARN | An unfinished initialization was discarded | files |
vault.initialized | INFO | init’s last step is durable | vault_id, recipients (the enrolled roles’ names, such as operational,recovery) |
vault.init-failed | WARN | An init step failed | step, error_kind |
A reset writes three more, all at WARN:
| Event | Level | When | Fields |
|---|---|---|---|
vault.reset-confirmed | WARN | You confirmed; written before the reset marker | vault_id (an Initialized vault only), verified, initialization, from_state, resumes |
vault.reset | WARN | The vault is discarded | vault_id, files, foreign (escaped names), finish_uncertain |
vault.reset-failed | WARN | Writing the marker or a removal failed | step (begin, remove or finish), file, error_kind, removed |
init also writes config.version-reserved and config.approval-completed for version 1.
Routes and responses
| Event | Level | When | Fields |
|---|---|---|---|
route.pinned-ca-unavailable | WARN | A route’s pinned CA could not be loaded, so the route is unavailable | route, config_field (ca_file) |
response.scrubbed | WARN | A relayed response had a scrub pattern match in its headers or body | request_id, route, credential, matches |
request.defect | ERROR | A request was refused by a service defect (reason service_defect) | request_id, route, credential, defect (the label of the check that failed) |
Recovery
| Event | Level | When | Fields |
|---|---|---|---|
recovery.checked | INFO when the key opened the vault, WARN otherwise | recovery check finished | recovery_outcome: opened with vault_id and recorded (and error_kind when the record was not written); failed with recovery_failure (not_a_recipient or identity_unverified); invalid; or unavailable with file and error_kind |
recovery.reminder | INFO | A recovery check is due | recovery_record (checked with last_checked, never_checked with reminders_since, unusable with error_kind), reminder_days, remediation |
vault.recovery-unlock | INFO | A recovery unlock finished its writes, and the new vault passphrase is in force | vault_id, recipient (the new operational recipient key, which is public), retired (the operational recipients retired), recorded; error_kind when the recovery check record was not written |
vault.recovery-unlock-refused | WARN | A recovery unlock was refused before its first write; the service stays Locked | refusal: rate_limited, invalid_key, passphrase_rejected, not_a_recipient, identity_unverified, not_recovery_role, unavailable, inventory_damaged or set_invalid; retry_after (whole seconds) for rate_limited; file and error_kind for unavailable; inventory_damage for inventory_damaged. A refusal for the state, initialization or memory writes vault.unlock-refused instead |
vault.recovery-unlock-failed | WARN | A recovery unlock’s write step failed; the service stays Locked | step (open, enroll, passphrase or retire), error_kind, vault_passphrase (which passphrase opens the vault now: old, either or new); committed for enroll and retire |
Recipients
Every recipient command, recipient list included, first runs an inventory check, which may write
recipient.inventory-damaged or recipient.change-recovered; neither carries a recipient key or label. recipient add
and recipient remove write recipient.added, recipient.removed and recipient.change-failed, which name the public
recipient key; the first two also carry the label, escaped. forget-machine writes recipient.forget-checked.
| Event | Level | When | Fields |
|---|---|---|---|
recipient.added | INFO | A recipient add committed | recipient, recipient_role (added, recovery for recipient add --recovery, or host-unlock for recipient add --host-unlock), recipient_label (escaped), recipients (the count after the change) |
recipient.inventory-damaged | WARN | The inventory check found the recipient inventory missing or damaged, and wrote nothing | inventory_damage: envelope_unreadable, missing, unreadable, mac, malformed, unknown_role, other_vault, envelope_mismatch or count_mismatch |
recipient.change-recovered | WARN | The inventory check finished a committed recipient change or removed a staged inventory | recovery: completed or discarded |
recipient.removed | INFO | A removal committed | recipient, recipient_role, recipient_label, recipients (the count after the removal) |
recipient.change-failed | WARN | An add or a removal was refused because the key is already enrolled, is not enrolled or would break the independence rule, or it failed while written | change (add or remove), recipient, failure: already_enrolled, unknown_recipient, set_invalid or write_failed; for write_failed also step, error_kind and committed (no, unknown or yes) |
recipient.forget-checked | INFO when the key is not a recipient, the independence rule holds and the recovery path is verified (a check ran, no reminder due), else WARN | forget-machine checked a key | recipient, forget_outcome (forgotten or still_enrolled), recipient_role (still_enrolled only), independence (holds or broken) and recovery (verified or unverified; forgotten only) |
Approvers
approver add and approver remove write these. They name approvers by their public approver ID and label (escaped);
no passphrase or key file byte is logged.
| Event | Level | When | Fields |
|---|---|---|---|
approver.enrolled | INFO | An approver add committed | approver_id, approver_label, signer_kind (software or tpm), approvers (the count after the change), authorizing_approver_id and authorizing_approver_label (the approver whose passphrase authorized it) |
approver.removed | INFO | An approver remove committed | as approver.enrolled, for the approver removed, and key_file: removed, or left when the key file could not be deleted (the next approver command removes it) |
approver.change-failed | WARN | An approver add or approver remove was refused (16 approvers pinned, the new passphrase broke a rule, no such approver, the last approver or the active approval’s signer), the approval state did not read back, or the change failed | change (add or remove), failure: set_invalid, passphrase_rejected, unknown_approver, in_use or write_failed; approver_id when known; for write_failed also step (read_back, tpm_helper, key_file, key_check or approval_state), error_kind and committed (no or unknown) |
approver.orphan-removed | WARN | Before its prompts, approver add or approver remove removed a key file no pinned approver has, left by an enrollment that failed or a removal that could not delete it | approver_id, the ID in the file’s name |
Migration authorization
recipient add and export write these events: they come from the authorization step the two share.
| Event | Level | When | Fields |
|---|---|---|---|
migration.challenge-issued | INFO | A migration challenge was issued | operation (export or add_recipient), method (the method asked first: vault_passphrase or tpm_pin); destination_recipient for add_recipient |
migration.authorized | INFO | The owner proved the challenge | operation, method (the method that proved it); approver_id for tpm_pin; destination_recipient for add_recipient |
migration.authorization-refused | WARN | The challenge was refused or cancelled, or the authorization was refused when used | operation, method (the method answered, or the one asked first), refusal (including wrong_pin and tpm_locked_out for tpm_pin); approver_id for tpm_pin; destination_recipient for add_recipient; retry_after for rate_limited |
Migration bundle
export writes the first two; import writes the last four. A refused authorization or a rejected export passphrase
writes neither: the authorization’s own records say what happened. None of these carries a passphrase, a key or a byte
of a credential record.
| Event | Level | When | Fields |
|---|---|---|---|
migration.exported | INFO | The whole bundle was sent | vault_id, records (the credentials it carries), approvers (the approvers it carries), committed_version, highest_reserved (the highest reserved approval version) |
migration.export-failed | WARN | The snapshot check before the prompts failed, or the export failed after its authorization was used | step (check, snapshot, seal or transfer), error_kind (locked for a lock, deadline for a missed deadline); file when a file failed |
migration.import-refused | WARN | An import was refused after the bundle arrived and before anything was written | refusal (bundle_invalid or wrong_passphrase); detail, the fixed name of the failed rule or check, for bundle_invalid |
migration.import-discarded | WARN | An unfinished import was discarded by import or init | files: the names removed, config.toml among them when the import wrote one |
migration.imported | INFO | The import’s last write is durable | vault_id, records, approvers, committed_version, highest_reserved, recipients (the enrolled roles’ names) |
migration.import-failed | WARN | A write of the import failed | step (the import’s step number), error_kind |
jq recipes
These run against a development log (tee of serve --log-to-stdout). In a protected install set
LOG=/var/log/iron-vault/iron-vault.log and run them with sudo. Investigate with the audit
log works through more.
LOG=~/iron-vault-dev.log
# one line per request: who asked, which route, and what happened
jq -c 'select(.event == "request.completed")
| {caller, route, http_method, status, outcome, reason, scrubbed, duration_ms}' $LOG
# refusals, counted by reason: unauthenticated, method_not_allowed, rate_limited, ...
jq -r 'select(.event == "request.completed" and .outcome == "failure") | .reason' $LOG | sort | uniq -c
# the administrative trail: commands, credential changes and config approvals (the strings filter handles null values)
jq -c 'select(.event | strings | test("^(admin|credential|config|caller)\\."))
| {timestamp, event, command, credential, version}' $LOG
# responses the scrubber had to clean, and how many matches it removed
jq -c 'select(.event == "response.scrubbed") | {request_id, route, credential, matches}' $LOG
# the test secret from getting started never reaches the log: this prints 0
grep -c -F 'not-a-real-key-123' $LOG
The log operations guide has more, and the queries for Loki and Elastic.