Skip to main content

Vault Policy Generator

Build HashiCorp Vault HCL policy files visually. Add path rules, toggle capabilities, and use presets for common patterns like read-only secrets, app service accounts, PKI cert issuers, and database credentials. Runs entirely in your browser.

✓ 4 built-in presets ✓ All 7 capabilities ✓ HCL output with CLI command

Frequently Asked Questions

What are HashiCorp Vault policies?▼

Vault policies are HCL (or JSON) documents that describe what paths in Vault a token can access and what capabilities it has. Policies follow the principle of least privilege — tokens get no permissions by default. Policies are attached to tokens via auth method roles. For example, a Kubernetes service account mapped to a Vault role can only access the secrets your policy allows.

What do the different capabilities mean?▼

create — POST/write new data. read — GET data. update — PUT/PATCH existing data. delete — DELETE data. list — enumerate keys at a path (does not read values). sudo — access root-protected paths (rare, use sparingly). deny — explicitly deny access, overriding any allows. For read-only access, use [read, list]. For full access, use [create, read, update, delete, list].

How do Vault path wildcards work?▼

Vault paths support two wildcards: * matches any sequence of characters within a single path segment (e.g. secret/data/myapp/* matches secret/data/myapp/db-password but not secret/data/myapp/db/password). The + glob matches exactly one path segment. Prefix matching with a trailing * is the most common pattern — e.g. secret/data/prod/* grants access to all secrets under the prod namespace.

What is the 'deny' capability used for?▼

deny overrides all other capabilities, including those from other policies attached to the same token. It's used to explicitly block access to sensitive sub-paths when a parent wildcard would otherwise grant access. For example, you might grant secret/data/* with [read] but then add secret/data/admin/* with [deny] to carve out admin secrets.

How do I apply a Vault policy?▼

Save the HCL to a file (e.g. policy.hcl), then run: vault policy write my-policy policy.hcl. To attach it to a role (e.g. Kubernetes auth): vault write auth/kubernetes/role/my-role bound_service_account_names=my-sa bound_service_account_namespaces=default policies=my-policy. To attach to AppRole: vault write auth/approle/role/my-role policies=my-policy.

Does this tool send my policy to a server?▼

No. All HCL generation runs entirely in your browser using JavaScript. Your policy configuration never leaves your machine.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →