VNX-SEC-037 – HashiCorp Vault Token
Overview
This rule detects HashiCorp Vault tokens in three formats:
hvb.<138-300 chars>— batch tokenhvs.<90-120 chars>— service tokens.<24 chars>— legacy service token
Vault tokens grant the ability to read every secret the token’s policy allows, which often includes database credentials, API keys, and signing keys for downstream services.
Severity: Critical | CWE: CWE-798 – Use of Hard-coded Credentials
Why This Matters
A leaked Vault token is the keys to the kingdom for whatever secrets Vault is managing. Unlike cloud-issued tokens, Vault policies are entirely under your control — a token with database/creds/read grants the ability to issue short-lived database credentials on demand, which can then be used to exfiltrate the entire database.
Remediation
- Revoke the token in Vault with
vault token revoke <token>or via the UI. - Audit the token’s accessor in the Vault audit log to see what secrets were read.
- Rotate every secret the token’s policy allowed, since the attacker may have already read them.
- Use short-lived tokens (Kubernetes auth, AWS IAM, GCP IAM) with a 1-hour TTL instead of long-lived ones.
- Purge from git history with
git filter-repo.