Skip to content

allmyram: the client revocation problem

Design doc: docs/superpowers/specs/2026-11-23-join-by-invite-design.md on branch wip/bootstrap-design, section "Removing and revoking".

Setup

  • One owner, one laptop (the only client today), a few runners (Linux and macOS machines) reached over tailcat. Runners accept SSH from the client and run code on its behalf, so this is remote code execution by design.
  • Owner key: in the laptop's Secure Enclave (Secretive), Touch ID only. owner.pub is installed on each runner at join time. The only things it signs are day-key certificates and the pinned set (below).
  • Day key: a file on the laptop, regenerated daily. The owner key certifies it for 24 hours, which is the one Touch ID prompt each day. It signs the client's SSH certificate (until the day key expires) and runner host certificates (30 days).
  • Client key: a file on the laptop. Its SSH certificate comes from the day key.
  • Pinned set: runners admit a client only if its certificate is valid and its key is in an owner-signed list of pinned client keys. Revoking means signing a list without that key and pushing it to every runner. Runners drop existing connections from keys that get unpinned.

What revocation is for

  • A stolen laptop needs no revocation. It can't make a new day key without the owner's fingerprint, so it is cut off within 24 hours. It couldn't revoke anyway, since the owner key is on the laptop.
  • What's left is: a client key copied off the laptop, which you want cut off now instead of at the end of the day. Revocation will matter more later, if a second client exists (a phone app is a distant idea).

Where it got complicated

The first version was simple: the owner signs the whole set plus a version number that only goes up, and each runner keeps the highest version it has seen. An older set can't be replayed to un-revoke a key.

Repeated automated security reviews then kept finding variations on one scenario: the laptop is restored from an old backup. Its stored set and version go backwards, and then:

  • a new revoke signs version N+1 from stale contents, which may re-add a key some runner already had unpinned;
  • a rejoin of one runner sends it the stale set;
  • runners end up holding different sets.

Each finding was patched, and the doc now has:

  1. a lock file and reread around every set change on the laptop;
  2. a record kept by each runner of every key it has ever seen unpinned, which overrides any later set unless that set marks the key "re-pinned" (only after the owner approves it by fingerprint);
  3. a reconciliation rule: before signing, collect every reachable runner's set, sign above the highest version seen, keep only keys pinned on all of them, drop anything in any runner's unpinned record;
  4. sets and unpinned records also travel in the join exchange;
  5. anti-lockout rules: no empty set, can't revoke the active key, and a two-phase rotate-client-key.

That's about 90 lines of design plus join-protocol changes, protecting against a stacked failure (an old backup restored and then a revoke or rejoin) for a single-owner tool where rejoining a runner takes a few minutes.

The question

Is there a simpler revocation design that gives:

  • instant cut-off of a client key on every runner the laptop can reach;
  • no way to un-revoke a key by replaying an old signed message;
  • nothing that needs a laptop backup to be perfectly current;

without the reconciliation machinery? Accepting "restore an old backup, then you may need to rejoin runners" is fine, if it can't silently bring a revoked key back.

Constraints: no infrastructure beyond the laptop and runners (no server, no tailnet ACL changes); tailcat can add an allowed node key at runtime but can't remove one without a restart; SSH certificates can't chain, so the day-key chain is checked in allmyram's own code.

The review loop

Six rounds of automated security review (roborev) on the design doc. Each round failed with one or two High findings, each was patched, and the next round found a new path. Eight findings in total. Six of them are the same story:

Round Finding Patch
1 Restored laptop rejoins a runner and signs a higher version that still holds a revoked key K. Re-pinning requires a separate fingerprint approval.
2 Rejoin only sends the runner's set version, not the set, so the laptop can't preserve the runner's revocations. Send the full signed set in the join exchange.
3 Laptop and runner sets have diverged; reconciling from the runner's set brings back K, which the laptop had revoked. Merge both sides and keep revocations from each.
4 Restored laptop revokes at v3; runner holds v10 still pinning K and rejects v3; rejoin skips reconciling because the active key is still pinned. One reconciliation rule for every signature: collect all reachable runners' sets and sign above every version seen.
5 Offline runner holds an older-signed v5 pinning K; laptop revoked at v4; background sync adopts v5 because it's higher and spreads it. Background connections never adopt a set; they only push the laptop's own.
6 Reconciliation skips an unreachable runner, the laptop signs v3 still holding K, and the runner later accepts v3 over its v2. Each runner keeps a record of every key it has seen unpinned and refuses those keys unless a set marks them "re-pinned".

Each patch closed its own path but made the state machine bigger, which gave the next round more to work with. Round 6's fix (runners never forget a revocation) is general enough that it probably makes rounds 1 to 5's patches unnecessary, but those patches are all still in the doc.

Every one of these attacks needs all of:

  • the laptop restored from an old backup;
  • a copied client key K;
  • a still-valid client certificate for K. Client certificates last at most until the day key expires (24 hours), and a new one needs the laptop.

So what they protect is the rest of a 24-hour window, in a stacked-failure case.

The other two findings were real and unrelated to restoring a backup:

  • The join running as allmyram-runner could write the trust root. Fixed: trust settings come in a bundle signed with a key carried in the invite, and install.sh checks it as root before writing to /etc/allmyram.
  • A join in progress could miss a revoke happening at the same time. Fixed: finishing a join takes the same lock as pin changes.