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

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 event field.

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:

FieldTypeValue
timestampstringRFC 3339 in UTC with fractional seconds, such as 2026-11-05T10:15:30.123456Z
levelstringERROR, WARN, INFO, DEBUG or TRACE
targetstringiron-vault.request for the request event, iron-vault.audit for audit events, a module path for a diagnostic record
servicestringalways iron-vault
service_versionstringthe release version
schema_versionnumber1. It rises when a field or event is renamed or removed, or a label changes meaning; additions do not change it
deployment_profilestringprotected, development or container
messagestringa short fixed phrase; values are in fields, never in the message
eventstringthe 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:

FieldTypeMeaning
request_idstringA random UUID per request; joins request.completed to response.scrubbed and request.defect
caller, route, credentialstringConfigured names
record_idstringA credential record’s ID
token_hoststringThe host of the token endpoint an OAuth client record’s provider definition names
approver_idstringThe approver that was asked for the approval passphrase, or that signed: its ID, a hyphenated UUID
approver_labelstringThat approver’s label, escaped; init labels the approval passphrase’s approver approval passphrase
versionnumberAn approval version
committed_versionnumberThe committed approval version; absent when none is committed
config_digeststringblake2b: and 64 hex digits
filestringA state or config file name, never a path
stepstringA fixed step label
refusalstringWhy something was refused: a fixed label
unavailable_reasonstringlocked, policy_invalid, checking or recovery_needed
detailstringA check failure’s detail: fixed phrases with versions and configured names only
error_kindstringA library error’s fixed kind label, never its text
remediationstringA fixed phrase saying what to do
log_destinationstringstdout, 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.

FieldTypePresentMeaning
request_idstringalwaysThe request ID
listenerstringalwaysThe listener it arrived on
http_methodstringalwaysThe method as received, escaped
callerstringonce the caller is identifiedThe caller’s name
routestringonce a route is selectedThe route’s name
credentialstringonce a route is selectedThe route’s credential
upstream_hoststringonce a route is selected, unless the answer was replacedThe upstream host; never the port, path or query
statusnumberonce a response existedThe HTTP status sent
request_bytesnumberalwaysBody bytes read from the caller
response_bytesnumberalwaysBody bytes sent to the caller, after scrubbing
duration_msnumberalwaysWhole milliseconds from receipt to the end of the response body
scrubbedbooleanonce a relayed response was sentWhether a scrub pattern matched
outcomestringalwayssuccess (an upstream response was relayed in full, with any status) or failure
reasonstringwhen outcome is failureThe 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

EventLevelWhenFields
service.startedINFOThe log is open, before the admin socket is boundlog_destination, core_dumps (disabled or not_disabled), memory_protection (locked, unavailable or unsupported)
service.hardening-incompleteERRORAt startup, when core dumps are not disabled or memory is not lockedcore_dumps, memory_protection, remediation
service.log-destination-changedINFOAn approved config moved the log; written to both the old and the new destinationlog_destination, previous_log_destination, version
service.lock-transitionINFOLocked to Checking on an unlock, or Starting to Checking on a host unlock, the check’s outcome, and Ready or Unavailable to Lockedfrom_state, to_state (starting, locked, checking, ready, unavailable or stopped); unavailable_reason when to_state is unavailable
vault.unlock-refusedWARNAn 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-unlockINFO when unlocked, absent or owner_locked, WARN when refused or unseal_failedA 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 ithost_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-fileWARNunlock found a file beside the manifest that the vault does not use; the file is never read, and the unlock goes onfile, escaped
vault.presence-refusedWARNThe approval passphrase or TPM approval PIN for replace, rm, recipient remove or approver add was refused, or the TPM was locked out; nothing was writtenrefusal (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-incompleteWARNA lock finished while a request still held a snapshot or the vault identitysnapshots_held (number), identity_held (boolean)

Admin commands and caller tokens

EventLevelWhenFields
admin.commandINFOAn admin principal’s command was readcommand (config_approve, caller_token, unlock and so on), principal_uid
admin.refusedWARNAn admin connection or request was refused before any command ranrefusal: 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-issuedINFOA caller token was issuednone; the token is never logged
caller.token-failedERRORNo caller token could be issuederror_kind

A command refused after it was read, such as init in the wrong state, records only admin.command.

Config approvals and checks

EventLevelWhenFields
config.approval-refusedWARNThe approval passphrase or TPM approval PIN was wrong, opened the wrong key, or the TPM was locked out; nothing was reservedrefusal (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-reservedINFOA version was reserved, before signingversion, config_digest, approver_id, approver_label
config.approval-failedWARNThe approval failed after its reservation and before its commit; the version is used upversion, config_digest, step, error_kind
config.commit-uncertainWARNThe commit’s rename landed but its directory fsync failedversion, error_kind
config.approval-completedINFOThe commit is durableversion, config_digest, summary (the approval summary’s text, or initial config for version 1), approver_id, approver_label
config.activation-failedWARNThe config check after a committed approval failedversion, unavailable_reason, detail
config.check-failedWARNAny config check failedunavailable_reason, failure (a fixed label), detail; log_destination when the log destination failed
config.reload-failedWARNThe config check of a SIGHUP reload failedcommitted_version, unavailable_reason, detail
config.recovery-publishedWARNA config check finished publishing a committed approvalversion, renames
config.recovery-discardedINFOA config check removed an uncommitted filefile; signed_for for a staged approval whose version is known
config.conflicting-approval-discardedERRORA 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 itversion

A reserved version is never a completed approval: look for config.approval-completed.

Credentials and vault writes

EventLevelWhenFields
credential.addedINFOAn add committed, of any kind but an OAuth clientcredential, record_id, kind, origins
credential.oauth-client-addedINFOAn add --kind oauth-client committedcredential, token_host
credential.loginINFOA login wrote its account record; a config check that then fails is reported separatelycredential, client, display_name (the verified account), outcome (added)
credential.login-refusedWARNA login ended without writingcredential 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.replacedINFOA replace committedcredential, old_record_id, record_id, kind, origins; old_kind and old_origins when the old record was healthy
credential.removedINFOAn rm committedcredential, record_id
credential.short-secretWARNA record just written has a short secret, which the scrubber may also match in innocent textcredential, secret_field, len
credential.refreshedINFO, or WARNA 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 onecredential, client, rotated
credential.refresh-failedWARNA refresh gave no access token, and the account does not need login. The next refresh is tried after the provider’s minimum retry intervalcredential, client, failure; provider_status when the provider answered
credential.refresh-write-failedERRORA 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 logincredential, client, error_kind
credential.needs-loginWARNAn OAuth account needs a new logincredential, client, cause
credential.revokedINFOThe provider revoked the grant of an OAuth account that rm removed, or that a login moved to another account or client or ended without writingcredential; client when the vault still holds the client record
credential.revoke-failedWARNThat 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 eventcredential, failure; client when the vault still holds the client record; provider_status when the provider answered
vault.unindexed-removedWARNA vault write first removed a record file the manifest does not listfile
vault.superseded-leftWARNA write committed but could not remove the file it replaced; the next write removes itfile, error_kind
vault.commit-uncertainERRORA state file was replaced but the directory fsync failed, so the change may not survive power lossfile, error_kind
vault.record-upgradedINFOOpening the vault rewrote a credential record written by 0.6.0-alpha in the current format, with no owner actioncredential, record_id, from_version (1), to_version (2)
vault.record-upgrade-failedWARNThat rewrite failed. The credential keeps serving, and the next unlock or reload tries againcredential, 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.

EventLevelWhenFields
vault.record-damagedERRORA listed record is damaged and was not loaded; its routes answer 503credential, record_id, file, damage (missing, substituted or unreadable); error_kind when a read failed
vault.unindexed-fileWARNOpening the vault found a record file the manifest does not list; it was not loadedfile
vault.approval-state-unrecordedWARNThe approval state exists but the manifest does not record itnone beyond remediation
vault.shared-state-damagedERRORThe vault’s shared state is damagedfile, damage
vault.state-dir-unreadableERRORThe state directory cannot be listederror_kind

Initialization

EventLevelWhenFields
vault.init-discardedWARNAn unfinished initialization was discardedfiles
vault.initializedINFOinit’s last step is durablevault_id, recipients (the enrolled roles’ names, such as operational,recovery)
vault.init-failedWARNAn init step failedstep, error_kind

A reset writes three more, all at WARN:

EventLevelWhenFields
vault.reset-confirmedWARNYou confirmed; written before the reset markervault_id (an Initialized vault only), verified, initialization, from_state, resumes
vault.resetWARNThe vault is discardedvault_id, files, foreign (escaped names), finish_uncertain
vault.reset-failedWARNWriting the marker or a removal failedstep (begin, remove or finish), file, error_kind, removed

init also writes config.version-reserved and config.approval-completed for version 1.

Routes and responses

EventLevelWhenFields
route.pinned-ca-unavailableWARNA route’s pinned CA could not be loaded, so the route is unavailableroute, config_field (ca_file)
response.scrubbedWARNA relayed response had a scrub pattern match in its headers or bodyrequest_id, route, credential, matches
request.defectERRORA request was refused by a service defect (reason service_defect)request_id, route, credential, defect (the label of the check that failed)

Recovery

EventLevelWhenFields
recovery.checkedINFO when the key opened the vault, WARN otherwiserecovery check finishedrecovery_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.reminderINFOA recovery check is duerecovery_record (checked with last_checked, never_checked with reminders_since, unusable with error_kind), reminder_days, remediation
vault.recovery-unlockINFOA recovery unlock finished its writes, and the new vault passphrase is in forcevault_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-refusedWARNA recovery unlock was refused before its first write; the service stays Lockedrefusal: 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-failedWARNA recovery unlock’s write step failed; the service stays Lockedstep (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.

EventLevelWhenFields
recipient.addedINFOA recipient add committedrecipient, 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-damagedWARNThe inventory check found the recipient inventory missing or damaged, and wrote nothinginventory_damage: envelope_unreadable, missing, unreadable, mac, malformed, unknown_role, other_vault, envelope_mismatch or count_mismatch
recipient.change-recoveredWARNThe inventory check finished a committed recipient change or removed a staged inventoryrecovery: completed or discarded
recipient.removedINFOA removal committedrecipient, recipient_role, recipient_label, recipients (the count after the removal)
recipient.change-failedWARNAn 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 writtenchange (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-checkedINFO when the key is not a recipient, the independence rule holds and the recovery path is verified (a check ran, no reminder due), else WARNforget-machine checked a keyrecipient, 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.

EventLevelWhenFields
approver.enrolledINFOAn approver add committedapprover_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.removedINFOAn approver remove committedas 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-failedWARNAn 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 failedchange (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-removedWARNBefore 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 itapprover_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.

EventLevelWhenFields
migration.challenge-issuedINFOA migration challenge was issuedoperation (export or add_recipient), method (the method asked first: vault_passphrase or tpm_pin); destination_recipient for add_recipient
migration.authorizedINFOThe owner proved the challengeoperation, method (the method that proved it); approver_id for tpm_pin; destination_recipient for add_recipient
migration.authorization-refusedWARNThe challenge was refused or cancelled, or the authorization was refused when usedoperation, 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.

EventLevelWhenFields
migration.exportedINFOThe whole bundle was sentvault_id, records (the credentials it carries), approvers (the approvers it carries), committed_version, highest_reserved (the highest reserved approval version)
migration.export-failedWARNThe snapshot check before the prompts failed, or the export failed after its authorization was usedstep (check, snapshot, seal or transfer), error_kind (locked for a lock, deadline for a missed deadline); file when a file failed
migration.import-refusedWARNAn import was refused after the bundle arrived and before anything was writtenrefusal (bundle_invalid or wrong_passphrase); detail, the fixed name of the failed rule or check, for bundle_invalid
migration.import-discardedWARNAn unfinished import was discarded by import or initfiles: the names removed, config.toml among them when the import wrote one
migration.importedINFOThe import’s last write is durablevault_id, records, approvers, committed_version, highest_reserved, recipients (the enrolled roles’ names)
migration.import-failedWARNA write of the import failedstep (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.