---
name: "hashicorp-vault-approle-secrets"
description: "Authenticate applications and lease dynamic database credentials with HashiCorp Vault."
metadata:
  author: "HashiCorp"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "authenticate with vault approle"
  - "lease dynamic database credentials vault"
  - "use vault transit encryption"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# HashiCorp Vault AppRole Dynamic Secret Leases

Integrates HashiCorp Vault with AppRole authentication: role-id/secret-id exchange, dynamic database credentials with TTL leases, transit encryption, and automated secret renewal.

## When to Invoke
Invoke this skill whenever you need to:
- authenticate with vault approle
- lease dynamic database credentials vault
- use vault transit encryption

## Execution SOP & Rules
1. Authenticate using role_id and secret_id via POST /v1/auth/approle/login to obtain a client token.
2. Store the Vault token in memory; never write tokens to disk or log files.
3. Renew leased secrets before the lease TTL expires using sys/leases/renew.
4. Revoke leases immediately upon service shutdown to minimize credential exposure windows.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
