Skip to content

Revoke Access

Revoke someone’s access to a secret. Understand what revocation does and doesn’t protect against.

  • A secret shared with at least one other identity
  • Understanding of how sharing works
  1. List current access

    See who has access to a secret:

    Terminal window
    dotsecenv vault describe

    Look for the available_to field:

    DATABASE_PASSWORD
    available_to: [YOUR_FINGERPRINT, TEAMMATE_FINGERPRINT]
  2. Revoke access

    Remove a specific identity’s access:

    Terminal window
    dotsecenv secret revoke DATABASE_PASSWORD TEAMMATE_FINGERPRINT

    Or revoke from all vaults:

    Terminal window
    dotsecenv secret revoke DATABASE_PASSWORD TEAMMATE_FINGERPRINT --all
  3. Verify revocation

    Terminal window
    dotsecenv vault describe

    The identity should no longer appear in available_to:

    DATABASE_PASSWORD
    available_to: [YOUR_FINGERPRINT]
  4. Rotate the secret value (Critical!)

    Store a new value:

    Terminal window
    echo "new-secret-value" | dotsecenv secret put DATABASE_PASSWORD

    This creates a new entry that the revoked user cannot access.

  5. Update systems using the secret

    Update your database, API keys, or other systems to use the new value.

  6. Commit the changes

    Terminal window
    git add vault
    git commit -m "Revoke access and rotate DATABASE_PASSWORD"
    git push

After revocation + rotation:

  • The revoked user cannot decrypt the new secret value
  • The revoked user can still decrypt the old value (from vault history)
  • Your vault shows only authorized identities for new values
Terminal window
dotsecenv vault describe
# DATABASE_PASSWORD
# available_to: [YOUR_FINGERPRINT]
# values: 2 (latest accessible to you)
Revocation protects againstRevocation does NOT protect against
Future secret valuesPreviously shared values
New secretsOld values they already decrypted
Access to new entriesCopy/paste of decrypted values
  1. GPG is asymmetric encryption — once encrypted for a key, only that key can decrypt
  2. Append-only vault — old entries remain readable to original recipients
  3. No time travel — you can’t retroactively change who could decrypt something
  1. Always rotate secrets after revoking access
  2. Treat revocation as notice that you need to change the value
  3. Update downstream systems with new credentials

Remove an identity completely:

Terminal window
# Revoke from all secrets
for secret in $(dotsecenv vault describe --json | jq -r '.secrets[].name'); do
dotsecenv secret revoke "$secret" FINGERPRINT
done

The vault preserves full history. View who had access to each version:

Terminal window
dotsecenv secret get DATABASE_PASSWORD --all --json | jq '.values[] | {timestamp, available_to}'

If someone should no longer have any access:

Terminal window
# Revoke from all existing secrets in all vaults
dotsecenv secret revoke "*" FINGERPRINT --all

When a team member leaves:

  • Revoke their access to all secrets
  • Rotate ALL secrets they had access to
  • Update all systems with new credentials
  • Run vault doctor to clean up (optional)
  • Document the change in your security log
Terminal window
# Comprehensive offboarding
FINGERPRINT="THEIR_FINGERPRINT"
# 1. Revoke all access
dotsecenv secret revoke "*" "$FINGERPRINT" --all
# 2. Rotate secrets (do this for each secret)
echo "new-value" | dotsecenv secret put DATABASE_PASSWORD
echo "new-value" | dotsecenv secret put API_KEY
# ... repeat for all secrets
# 3. Commit
git add vault
git commit -m "Offboard: revoke access for $FINGERPRINT"
git push

Can they still see secrets?

If they have the old vault file, yes. The vault is encrypted but the entries for their key still exist. They can decrypt old values.

This is why rotating secrets is essential after revocation.

Vault getting large?

Revoked entries and old values accumulate. Run doctor to check and optionally defragment:

Terminal window
dotsecenv vault doctor

The doctor command checks vault health and offers to defragment if needed.