Unable to validate the auditing for Vault

Hi, I’m following this doc to set up file_path auditing device. I understand that the username/passwords/tokens in the audit log are are hashed with a salt using HMAC-SHA256.

My goal is to use Vault to translate a token/username/password back to the original token (non hashed version) so that I know who initiated that request.

In my payload.json file, I have the hashed token like this:

“input”: “hmac-sha256:0f6621d2813df41ccf2ffabd7dd97148c0302aae59e00f81abb41ae5c0000000”

When I run the following Vault command:

–header “X-Vault-Token: hvs.rUzPWfowWGKDQcxhV0000000”
–request POST
–data @payload.json

I get this output:


I’m failing to understand how to use the above data to audit who requested a username/password since the data is hashed here.

  • some values are masked intentionally

The audit-hash function takes in clear-text and converts it to the hash value that would be seen in the audit log (each audit log has a unique salt so the resulting hash differs from log to log; e.g. syslog vs file if you have both setup)

It does not “un-hash” the value. There is no way to “un-hash” as
hashing is a one way operation.

Basically if you suspect a particular known value was used you could verify that by comparing the resulting hash from the command with what you see in the log.

However, you should be able to see authentication information in the audit records such as auth.display_name, auth.entity_id, auth.policies, auth.token_issue_time, and more.

You can disable hashing of specific fields when creating or tuning the mount using the audit_non_hmac_request_keys and audit_non_hmac_response_keys but I would recommend not doing so unless absolutely required and you understand the risks in doing so.

Example: /sys/auth - HTTP API | Vault by HashiCorp


Thank you @jeffsanicola