The HashiCorp Vault audit log records every authenticated request and response that passes through the Vault API, which makes it the single best source for spotting secret harvesting, rogue token creation and quiet policy changes by both people and non-human identities. This guide explains how the audit entry is structured, how to collect it without gaps, which request patterns deserve detections, and how to tune and test those detections so that your SOC can act on them. It assumes Vault is already deployed and focuses on detection and response, not on installation or configuration hardening.
Vault sits at the centre of most non-human identity programmes. Service accounts, CI pipelines, Kubernetes workloads and AI agents all authenticate to it and read secrets from it. That concentration is exactly why the audit log matters: an attacker who obtains a single workload token can enumerate and read secrets at machine speed, and the only reliable record of that activity is the audit device. For the configuration side of the same problem, see our How to audit HashiCorp Vault tokens, policies and auth methods review, which this page does not repeat.
This is an independent guide from NHI Mgmt Group, based on HashiCorp's public documentation as of November 2026. It is not sponsored or reviewed by HashiCorp. Product features change, so confirm settings against HashiCorp's current documentation.
Key takeaways
- Vault writes a request entry and a response entry for every audited API call, and refuses the request if it cannot write to at least one enabled audit device. HashiCorp recommends enabling at least two devices.
- Most string values are written as HMAC-SHA256 hashes by default. You detect on structure (paths, operations, mount types, identities, policies, remote addresses), not on secret values.
- The most useful fields for detection are
request.path,request.operation,request.mount_type,request.remote_address,auth.display_name,auth.entity_id,auth.policies,auth.token_typeand the top-levelerror. - The highest value detections cover bulk secret reads, list then read enumeration, token creation outside known automation, changes to policies, auth methods and audit devices, and bursts of permission denied errors.
- Audit filtering (available since Vault 1.16.0) can remove the very entries a detection relies on. Check filter configuration before trusting a quiet log.
- All queries on this page are illustrative. Validate field names against a sample of your own log before you deploy anything.
How the Vault audit entry is structured
Each line written by a JSON audit device is one entry. The top-level fields defined in the Vault source are type, time, auth, request, response, error and forwarded_from. The type value is either request or response, so every audited call normally produces a pair. A request entry tells you what was asked for; a response entry tells you what Vault returned and whether it succeeded.
The auth block
The auth object describes the token that made the call. The fields that matter most for detection are:
display_name: a human readable label derived from the auth method, for example a token, AppRole or Kubernetes role name. HashiCorp's own log query tutorial counts calls by this field.entity_id: the identity entity behind the token. This is the most stable way to track one workload or person across many tokens.policies,token_policiesandidentity_policies: the policies attached to the token and to the identity. A sudden appearance of a privileged policy on an entity that never had it is a strong signal.token_type,token_ttl,remaining_usesandno_default_policy: properties of the token itself, useful for spotting unusually long lived tokens.metadata: auth method metadata such as role names, which helps link a token back to a workload.accessorandclient_token: hashed by default, but stable within one audit device, so they let you follow one token through a session.
The request block
The request object carries id, operation, path, mount_type, mount_point, mount_accessor, namespace, remote_address, remote_port, client_token_accessor, client_id, wrap_ttl and headers. The operation field holds values such as create, read, update, delete and list. By default Vault records the User-Agent, Correlation-Id and X-Correlation-Id request headers, and does not hash header values unless you configure it to through /sys/config/auditing.
The response block and errors
The response object includes mount_type, data, wrap_info and, for login and token creation calls, a nested auth object describing the token that was issued. The top-level error field holds error text such as permission denied. Some error text inside response.data.error is hashed, and HashiCorp's tutorial shows how to match it using the sys/audit-hash endpoint on the same device.
What hashing means for detection
Vault hashes most string values with a keyed HMAC-SHA256 before writing them. Integers and booleans are not hashed. In practice this means you never see secret values in the log, and you should not try to. You can still compute the hash of a known value through /sys/audit-hash to answer a specific question during an investigation, such as whether a known leaked token accessor appears in the log. Remember that hashes are tied to the device: if a device is disabled and re-enabled at the same path, a new hashing key is created and old hashes can no longer be reproduced.
Collecting the audit log without gaps
Detection is only as good as collection. Vault supports three audit device types: file, syslog and socket. Vault sends each entry to all enabled devices and guarantees that at least one has saved it. If none can be written, Vault refuses the API request, which protects integrity but means a failed audit sink can become an outage.
Practical collection pattern
- Enable at least two devices, as HashiCorp recommends, for example a
filedevice on local disk shipped by a log forwarder and a second device to a separate path or to syslog. - The
filedevice appends tofile_path, defaults to file mode0600, and can write tostdoutfor container platforms. It does not rotate logs itself. Use an external rotation tool and send SIGHUP to the Vault server process (not to plugin child processes) so the device reopens its file. - Consider
elide_list_responses, which replaces thekeysandkey_infovalues in list responses with counts. This cuts volume and avoids indexing large key lists while keeping the fact that a list happened. - Decide deliberately on
hmac_accessor. HashiCorp's example enables a file device withhmac_accessor=false, which leaves token accessors readable so analysts can revoke a token by accessor during response. Weigh that convenience against who can read the log. - Ship to your SIEM with the original JSON intact. Flattening nested objects early tends to lose
auth.policiesarrays and the nested responseauthobject, which several detections below need.
Know what is not audited
Some endpoints are exempt, including sys/init, sys/seal-status, sys/unseal, sys/health, sys/leader and several rekey and raft endpoints. sys/metrics, sys/pprof/* and sys/in-flight-req are exempt only when the listener allows unauthenticated access. Audit logs are also separate from Vault's operational server logs, so unseal and seal events need the server log or platform telemetry rather than the audit device.
Watch for audit filters
Since Vault 1.16.0 audit devices can filter entries. HashiCorp's tutorial warns that filtered-out entries will simply be missing from your queries. Record the filter expression of every device in your detection documentation, and alert if it changes.
Detections for secret reads and enumeration
Secret harvesting is the most common goal of an attacker who reaches Vault with a stolen workload token. It maps to MITRE ATT&CK T1552 Unsecured Credentials in spirit, and the token theft that precedes it to T1528 Steal Application Access Token.
Bulk reads by one identity
Most workloads read a small, stable set of paths. Baseline the distinct count of request.path values read per auth.entity_id (or per auth.display_name when entity data is thin) over a rolling window, and alert when one identity reads many more distinct paths than its baseline. An illustrative jq query that counts distinct read paths per display name in a file export:
jq -s 'map(select(.type=="request" and .request.operation=="read")) | group_by(.auth.display_name) | map({who: .[0].auth.display_name, paths: (map(.request.path) | unique | length)}) | sort_by(-.paths)' $AUDIT_LOG_FILE
List then read sequences
An attacker who does not know where secrets live will list first. Look for an identity that issues list operations across several mount points and then reads under the same prefixes within minutes. Workloads rarely need to list; humans and attackers do. If you use elide_list_responses you still see the list call and the count of keys returned.
New source address for a known workload
Workload tokens are normally used from a narrow set of hosts or pod networks. Alert when an auth.entity_id that has only ever appeared from one network range makes a successful read from a new request.remote_address. HashiCorp's tutorial includes a query that groups path access by remote address, which is a good starting point for this baseline. This is one of the clearest indicators of a copied token being replayed elsewhere, which maps to T1078 Valid Accounts.
Reads of high value mounts
Tag mounts that hold root cloud credentials, signing keys or database admin roles, and alert on any read by an identity not on an allow list. Use request.mount_point and request.mount_type rather than full paths so that new secrets under the mount are covered automatically. For PKI, HashiCorp's tutorial shows filtering on request.mount_type == "pki" to review every certificate operation.
Detections for token creation and authentication
Tokens are the currency of Vault. Detecting abnormal token issuance catches persistence and privilege escalation earlier than waiting for secret reads.
Token creation outside known automation
Token creation calls appear as requests under the token auth method path, and the response entry carries a nested response.auth object describing the new token, including its policies and TTL. Alert when a token is created by an identity that does not normally create tokens, when the new token carries policies broader than the creator's usual pattern, or when the TTL or remaining_uses values differ sharply from your automation's standard. Confirm the exact endpoint paths used in your environment against the Vault API documentation before writing the rule.
Long lived and plain token use
HashiCorp's tutorial notes that heavy use of the plain token display name may indicate automation that should move to Vault Agent with a machine-friendly auth method. From a detection view, track identities that use static tokens with long auth.token_ttl values. Each one is a credential that can be copied and replayed, so it deserves both a detection and a remediation ticket.
Login failures and brute force
Repeated failed logins against AppRole, userpass or other auth methods show up as entries with a non-null error. Count errors per request.remote_address and per request.mount_point. A spike of failed AppRole logins from one host often means someone is testing leaked role IDs or secret IDs. For the AppRole side of that review, see How to audit Vault AppRole and secret ids.
Permission denied bursts
HashiCorp describes permission denied as the most common audit error, usually a token lacking capabilities. A steady trickle from misconfigured apps is normal. A burst from one identity across many unrelated paths is not: it is the signature of someone probing what a stolen token can reach. Alert on the number of distinct denied paths per identity, not the raw error count. Our HashiCorp Vault Permission Denied Troubleshooting Guide helps separate benign misconfiguration from probing.
Detections for policy, auth method and audit changes
Changes to Vault configuration are rarer than secret reads and almost always worth a look. They map to T1098 Account Manipulation when an attacker grants themselves more access.
Policy writes and deletes
ACL policy changes are create, update or delete operations on the system backend's policy paths. Alert on every policy change that does not come from your infrastructure as code pipeline identity. Treat changes to policies attached to many entities, or to any policy granting sudo capability, as high severity. Then watch for the follow-on: the same identity, or a newly created token, reading paths that the changed policy now allows.
New auth methods, roles and secrets engines
Enabling a new auth method or a new role on an existing method can create a fresh, unmonitored way in. Mounting a new secrets engine can be legitimate, but should match a change ticket. Alert on writes under the system backend's auth and mount paths, and on role creation under existing auth mounts, by any identity outside your platform team.
Audit device tampering
Disabling or reconfiguring an audit device is the Vault equivalent of clearing event logs. Writes and deletes against the sys/audit endpoints should always page someone, whatever the source identity. Because the disable call itself is audited on the device being removed and on any remaining devices, a second device makes this detection robust. Pair it with a SIEM heartbeat rule that alerts when entries from a Vault node stop arriving.
Root and highly privileged tokens
Any request where auth.policies contains root outside a documented break glass window deserves an immediate alert. Root token use should be rare enough that every occurrence can be reviewed by a person.
Building rules in your SIEM
The jq examples above suit quick investigations on an exported file. In production, translate the same logic into your SIEM. A sensible rule set for a first release:
| Rule | Key fields | Suggested severity |
|---|---|---|
| Audit device disabled or changed | request.path, request.operation | Critical |
| Root policy token used | auth.policies | High |
| Policy created, changed or deleted outside pipeline | request.path, request.operation, auth.entity_id | High |
| Workload token used from new address | auth.entity_id, request.remote_address | High |
| Bulk distinct reads above baseline | auth.entity_id, request.path, request.operation | Medium |
| Token created with unusual policies or TTL | response.auth, auth.display_name | Medium |
| Denied requests across many paths | error, auth.entity_id, request.path | Medium |
| Failed logins per source | error, request.remote_address, request.mount_point | Low to medium |
Severities are NHI Mgmt Group suggestions, not HashiCorp guidance. Adjust them to your environment.
Join request and response entries
Several rules need both halves of a call: the request tells you the path, the response tells you whether it succeeded and what token was issued. Join on request.id, which appears in both entries. Do this at ingest time if your SIEM supports it, because joining at query time across large volumes is slow.
Enrich identities
Map auth.entity_id and auth.metadata role names to owners, applications and environments from your NHI inventory. An alert that says "entity 3f2a read 140 paths" is much slower to triage than one that says "payments-batch service in production read 140 paths from a laptop subnet".
Triage and response
When a Vault detection fires, work through a short, repeatable sequence:
- Identify the token and identity:
auth.entity_id,auth.display_name,auth.accessorandauth.metadata. - Pull the full session: every entry with the same accessor or entity in the surrounding hours, joined on
request.id. - List what was read: distinct
request.pathvalues with successful responses. This is your exposure list for rotation. - Check where it came from:
request.remote_addressand theUser-Agentheader against known workload hosts. - Contain: revoke the token (by accessor if you kept accessors readable), disable the role or secret ID that issued it, and rotate every secret on the exposure list, starting with dynamic credentials and cloud root keys.
- Check for persistence: new tokens, roles, policies or auth methods created by the same identity, using the configuration change detections above.
Broader response steps for a compromised secrets platform are covered in our HashiCorp Vault Guide and in your incident response runbooks.
Testing and tuning detections
Test each rule in a non-production Vault with the same audit device setup as production. Generate the behaviour deliberately: create a test token with a narrow policy, read a set of paths, list mounts, trigger permission denied errors, change a test policy and disable then re-enable a test audit device. Confirm each action produces the expected request and response entries and that the rule fires once, with useful context.
Then tune against real traffic. Pipeline identities and Vault Agent sidecars generate a lot of legitimate reads and token renewals. Allow list them by auth.entity_id rather than by display name, which is easier to spoof through role naming. Review the allow list quarterly, because stale entries become blind spots. The Detection Engineering Guide covers rule lifecycle and testing practice in more depth.
Common failure patterns
- Only one audit device is enabled, so a full disk or broken socket blocks Vault requests or leaves a gap.
- Log rotation is configured without sending SIGHUP to the Vault server process, so the device keeps writing to a rotated file that the forwarder no longer reads.
- An audit filter added to cut volume silently removes the entries that detections depend on.
- Nested JSON is flattened at ingest, losing
auth.policiesarrays and the nestedresponse.authobject. - Rules key on
auth.display_namealone, so renamed roles or shared names break baselines. - Request and response entries are never joined, so rules cannot tell a successful read from a denied one.
- Teams try to search for secret values and conclude the log is useless, instead of detecting on paths, identities and operations.
- No heartbeat rule exists, so an audit device that stops shipping goes unnoticed for weeks.
Practitioner checklist
- At least two audit devices enabled on every Vault cluster, with their paths and options documented.
- Log rotation sends SIGHUP to the Vault server process only, and forwarders follow the rotated file.
- Audit filter expressions recorded and changes alerted on.
- Raw JSON preserved in the SIEM, with request and response entries joined on
request.id. auth.entity_idmapped to owners and applications from the NHI inventory.- Rules live for audit device changes, root token use, policy changes, new source addresses, bulk reads, unusual token creation, denied request bursts and failed logins.
- A heartbeat rule alerts when a Vault node stops sending audit entries.
- Each rule tested in non-production with deliberate activity, and allow lists reviewed quarterly.
- A triage runbook covers token revocation, role disablement and secret rotation from the exposure list.
Standards and references
- HashiCorp Vault documentation: Audit devices
- HashiCorp Vault documentation: File audit device
- HashiCorp tutorial: Query audit device logs
- MITRE ATT&CK: T1552 Unsecured Credentials
- MITRE ATT&CK: Steal Application Access Token
- MITRE ATT&CK: T1078 Valid Accounts
- MITRE ATT&CK: T1098 Account Manipulation
- NIST: SP 800-53 Rev. 5 (AU-6 Audit Record Review, Analysis, and Reporting; AU-12 Audit Record Generation)
Related NHI Mgmt Group resources: HashiCorp Vault Guide · Okta System Log Detection Guide · How to audit HashiCorp Vault tokens, policies and auth methods · Detection Engineering Guide