Revoke Access
Revoke someone’s access to a secret. Understand what revocation does and doesn’t protect against.
Prerequisites
Section titled “Prerequisites”- A secret shared with at least one other identity
- Understanding of how sharing works
-
List current access
See who has access to a secret:
Terminal window dotsecenv vault describeLook for the
available_tofield:DATABASE_PASSWORDavailable_to: [YOUR_FINGERPRINT, TEAMMATE_FINGERPRINT] -
Revoke access
Remove a specific identity’s access:
Terminal window dotsecenv secret revoke DATABASE_PASSWORD TEAMMATE_FINGERPRINTOr revoke from all vaults:
Terminal window dotsecenv secret revoke DATABASE_PASSWORD TEAMMATE_FINGERPRINT --all -
Verify revocation
Terminal window dotsecenv vault describeThe identity should no longer appear in
available_to:DATABASE_PASSWORDavailable_to: [YOUR_FINGERPRINT] -
Rotate the secret value (Critical!)
Store a new value:
Terminal window echo "new-secret-value" | dotsecenv secret put DATABASE_PASSWORDThis creates a new entry that the revoked user cannot access.
-
Update systems using the secret
Update your database, API keys, or other systems to use the new value.
-
Commit the changes
Terminal window git add vaultgit commit -m "Revoke access and rotate DATABASE_PASSWORD"git push
Expected Result
Section titled “Expected Result”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
dotsecenv vault describe# DATABASE_PASSWORD# available_to: [YOUR_FINGERPRINT]# values: 2 (latest accessible to you)What Revocation Does NOT Do
Section titled “What Revocation Does NOT Do”| Revocation protects against | Revocation does NOT protect against |
|---|---|
| Future secret values | Previously shared values |
| New secrets | Old values they already decrypted |
| Access to new entries | Copy/paste of decrypted values |
Why is this the case?
Section titled “Why is this the case?”- GPG is asymmetric encryption — once encrypted for a key, only that key can decrypt
- Append-only vault — old entries remain readable to original recipients
- No time travel — you can’t retroactively change who could decrypt something
What to do about it
Section titled “What to do about it”- Always rotate secrets after revoking access
- Treat revocation as notice that you need to change the value
- Update downstream systems with new credentials
Variations
Section titled “Variations”Revoke all access to all secrets
Section titled “Revoke all access to all secrets”Remove an identity completely:
# Revoke from all secretsfor secret in $(dotsecenv vault describe --json | jq -r '.secrets[].name'); do dotsecenv secret revoke "$secret" FINGERPRINTdoneAudit access history
Section titled “Audit access history”The vault preserves full history. View who had access to each version:
dotsecenv secret get DATABASE_PASSWORD --all --json | jq '.values[] | {timestamp, available_to}'Revoke from all secrets
Section titled “Revoke from all secrets”If someone should no longer have any access:
# Revoke from all existing secrets in all vaultsdotsecenv secret revoke "*" FINGERPRINT --allComplete Offboarding Checklist
Section titled “Complete Offboarding Checklist”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 doctorto clean up (optional) - Document the change in your security log
# Comprehensive offboardingFINGERPRINT="THEIR_FINGERPRINT"
# 1. Revoke all accessdotsecenv secret revoke "*" "$FINGERPRINT" --all
# 2. Rotate secrets (do this for each secret)echo "new-value" | dotsecenv secret put DATABASE_PASSWORDecho "new-value" | dotsecenv secret put API_KEY# ... repeat for all secrets
# 3. Commitgit add vaultgit commit -m "Offboard: revoke access for $FINGERPRINT"git pushTroubleshooting
Section titled “Troubleshooting”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:
dotsecenv vault doctorThe doctor command checks vault health and offers to defragment if needed.
Next Steps
Section titled “Next Steps”- Security Model — Understand what dotsecenv protects against
- Architecture — How the vault and encryption work