Skip to content

Offboard a departing team member

Remove a leaving teammate’s GPG key from every vault they could read and rotate the secrets they had access to.

  1. Inventory. List every secret whose recipient list includes the leaver’s fingerprint:

    Terminal window
    LEAVER_FP="ABCD1234..." # the 40-char fingerprint
    for v in $(dotsecenv vault describe --json | jq -r '.[].vault'); do
    dotsecenv vault describe --json -v "$v" \
    | jq -r --arg fp "$LEAVER_FP" \
    '.[].secrets[] | select((.available_to // []) | index($fp)) | .key'
    done

    Order the worklist by blast radius: production credentials first.

  2. Revoke in one pass. Quote the wildcard so the shell does not expand it.

    Terminal window
    dotsecenv secret revoke "*" "$LEAVER_FP" --all
  3. Verify. Re-run the inventory from step 1. The output should be empty.

    Terminal window
    dotsecenv vault doctor
  4. Rotate at the source. Generate a new credential at the originating system (database, IDP, cloud provider, API issuer) and store it. Production-critical first.

    Terminal window
    echo "<new-value>" | dotsecenv secret store SECRET_NAME
  5. Commit.

    Terminal window
    git add path/to/vault
    git commit -m "Offboard <name>: revoke $LEAVER_FP, rotate N secrets"
SymptomCauseFix
secret revoke ... --all says “no matching secret”Wildcard not quoted; shell expanded * to local filenamesQuote it: "*"
vault describe is missing a vault you expectedVault path not in vault: config, or blocked by policyAdd it with -v once, or list it under vault: in ~/.config/dotsecenv/config.yaml
Decrypt failure when rotatingYour own login fingerprint was accidentally revoked from this secretdotsecenv secret share SECRET YOUR_FP --all, then re-run secret store
Revoke succeeds in some vaults, fails in othersA vault file is read-only or owned by another userRun revoke per vault with -v and a writeable path
Leaver’s fingerprint is not in your keyringPublic key was never imported, or expired and was purgedRevoke works without the public key; you only need the fingerprint string
  • Erase a leaked entry from the vault file. Append-only by design. Rewriting git history with git filter-repo is possible, but anyone who already cloned the repo still has the old data and the leaver’s key still decrypts it.
  • Re-encrypt an existing entry to a different recipient set. secret share and secret revoke only affect future writes. Source rotation is the only fix.
  • Recall a value the leaver memorized or saved elsewhere. Rotating the underlying credential makes that knowledge worthless.