This article explains Vault Policies in HashiCorp Vault, focusing on authorization, permissions, and the principle of least privilege.
Vault Policies are the core mechanism for enforcing authorization in HashiCorp Vault. By defining fine-grained permissions on Vault paths and operations, policies uphold the principle of least privilege. This ensures that diverse clients—DBAs creating dynamic database credentials, Packer builds pulling secrets, reporting applications querying data, CI/CD pipelines provisioning cloud resources, and administrators performing routine tasks—receive only the access they need.
Segregate duties across automation tools and human operators
Protect sensitive paths and actions
Minimize blast radius by granting minimal required capabilities
Always follow the principle of least privilege: grant only the permissions necessary for each client.
Vault supports policies authored in JSON or HCL (HashiCorp Configuration Language). HCL is more human-readable and is the community’s preferred choice for most configurations.
Vault Policies operate under three fundamental rules:
Feature
Description
Deny by Default
Any access not explicitly granted is automatically denied.
Explicit Deny
You may override allow rules by explicitly denying specific paths or capabilities.
Cumulative
A token can have multiple policies attached; its effective permissions are the union of all.
When a client authenticates, Vault issues a token. Policies attached to that token determine the client’s capabilities. If multiple policies are attached, their permissions merge together.Vault ships with two built-in policies:
Policy Name
Description
Modifiable
Attached To
root
Grants unrestricted access to all Vault paths and actions.