
jq. Vault automatically hashes any sensitive data (tokens, secrets) using HMAC-SHA256 and a unique salt, ensuring that no raw secret ever appears in logs.
Never disable HMAC hashing in production. Without hashing, sensitive values and tokens may be exposed in plaintext.
Supported Audit Devices
Vault offers three primary audit devices. You can mount one or more simultaneously to ensure high availability.| Device Type | Description | Common Use Case |
|---|---|---|
| file | Appends JSON logs to a local file. | Simple setups; file rotation by user |
| syslog | Sends entries to a local syslog daemon or remote host. | Centralized logging via syslog |
| socket | Streams logs over TCP, UDP, or UNIX sockets. | Guaranteed delivery with TCP stream |

Safety and High Availability
Audit devices are disabled by default. As soon as you enable one, Vault will require successful log writes before processing any request. If logging fails (e.g., disk full, syslog unreachable), Vault halts client operations—prioritizing safety over availability. To mitigate this, enable multiple audit devices (for example,file and syslog) so that at least one remains writable.
Enabling two audit devices ensures redundancy. If one path fails, Vault continues logging on the other.

Audit Log Workflow
- Configure Audit Devices
Vault Admin mounts one or more audit devices usingvault audit enable. - Write Logs
Vault writes JSON entries to the configured device(s). - Collect Logs
A local collector (e.g., Fluentd, Splunk Forwarder) tails the file or listens on syslog/socket. - Aggregate & Analyze
Logs are forwarded to SIEM or monitoring platforms (Splunk, Datadog). - Alerting & Dashboards
Create dashboards and alerts—for example, when a root token is created or a policy is changed.

Enabling an Audit Device
Usevault audit enable with the target type and parameters:
file with syslog or socket and add the required flags.Run
vault audit enable -help for full parameter details.
Listing and Disabling Audit Devices
Quickly view or remove audit devices:Inspecting a Sample Audit Entry
Pipe JSON logs throughjq for readability:
Permissions for Audit Device Management
To grant a policy permission to create, read, and manage an audit device, include thesudo capability:
sudo, roles cannot enable, disable, or reconfigure audit devices.
Links and References
This concludes our overview of Vault audit devices and log management. In the next hands-on lab, you’ll enable devices, generate log entries, and configure a log collector for centralized monitoring.