dcg

HashiCorp Vault

secrets.vault

Protects against destructive Vault CLI operations like deleting secrets, disabling auth/secret engines, revoking leases/tokens, and deleting policies.

  • 9blocking rules
  • 11safe patterns
  • 5Critical
  • 4High
~/.config/dcg/config.toml
[packs]
enabled = ["secrets.vault"]

Evaluated when a command contains vault.

Blocking rules

Each rule ID is secrets.vault:<name>. Use it in allowlists and [policy.rules].

  1. vault-auth-disable

    Critical

    vault auth disable disables an auth method.

    Explanation
    Disabling an auth method revokes ALL tokens issued by that method and removes all configuration. Users authenticating via this method will immediately lose access. This includes all associated roles and policies. Safer alternatives: - vault auth list: Review auth methods first - Migrate users to another auth method - Export auth configuration before disabling
  2. vault-kv-destroy

    Critical

    vault kv destroy permanently deletes secret versions.

    Explanation
    Destroy permanently erases secret data including all specified versions. Unlike delete (which is soft-delete in KV v2), destroy is irreversible. The data cannot be recovered even by Vault administrators. Safer alternatives: - vault kv delete: Soft-delete with undelete option - vault kv get: Verify the secret versions first - Export secret data before destruction
  3. vault-kv-metadata-delete

    Critical

    vault kv metadata delete removes all versions and metadata for a secret.

    Explanation
    Deleting metadata removes ALL versions of a secret and its metadata permanently. This is more destructive than destroy as it removes the entire secret history. The secret path becomes available for reuse. Safer alternatives: - vault kv metadata get: Review secret metadata first - vault kv destroy: Delete specific versions only - Export all secret versions before deletion
  4. vault-policy-delete

    Critical

    vault policy delete removes access policies.

    Explanation
    Deleting a policy immediately affects all tokens with that policy. Users and applications may lose access to secrets they need. Orphaned tokens retain their policy name but lose the permissions. Safer alternatives: - vault policy read: Review policy before deletion - vault token lookup: Check affected tokens - Create replacement policy before deleting
  5. vault-secrets-disable

    Critical

    vault secrets disable disables a secrets engine, causing data loss.

    Explanation
    Disabling a secrets engine permanently deletes ALL secrets stored in that engine. Dynamic credentials are revoked immediately. Applications using secrets from this engine will fail authentication. This cannot be undone. Safer alternatives: - vault secrets list: Review enabled engines first - Export secrets before disabling - Rotate applications to new secrets engine first
  6. vault-delete

    High

    vault delete removes secrets at a path.

    Explanation
    The generic delete command removes data at the specified path. The behavior depends on the secrets engine. For most engines, this is a permanent deletion of the secret data. Safer alternatives: - vault read: Verify the path contents first - Use engine-specific commands for safer operations - Back up data before deletion
  7. vault-kv-delete

    High

    vault kv delete removes the latest secret version.

    Explanation
    In KV v2, delete performs a soft-delete of the latest version. The data can be recovered with undelete until the delete_version_after policy expires. In KV v1, delete is permanent and immediate. Safer alternatives: - vault kv get: Verify the secret before deleting - vault kv undelete: Recover if mistakenly deleted (v2) - Set appropriate delete_version_after policies
  8. vault-lease-revoke

    High

    vault lease revoke invalidates leases and can disrupt access.

    Explanation
    Revoking a lease immediately invalidates dynamic credentials (database passwords, AWS keys, etc.). Applications using these credentials will fail. With -prefix, all leases under a path are revoked. Safer alternatives: - vault lease lookup: Review lease details first - Use shorter TTLs for automatic rotation - Coordinate credential rotation before revocation
  9. vault-token-revoke

    High

    vault token revoke invalidates tokens and can disrupt access.

    Explanation
    Revoking a token immediately invalidates it and all child tokens. Applications using this token will fail authentication on next request. With -prefix, all tokens under a prefix tree are revoked. Safer alternatives: - vault token lookup: Verify the token before revoking - Use token TTLs for automatic expiration - Coordinate token rotation before revocation

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • vault-status
  • vault-version
  • vault-read
  • vault-kv-get
  • vault-kv-list
  • vault-secrets-list
  • vault-policy-list
  • vault-token-lookup
  • vault-auth-list
  • vault-audit-list
  • vault-lease-lookup