| 1 | --- |
| 2 | type: bug |
| 3 | id: bd-8a591dc |
| 4 | status: closed |
| 5 | title: Machine access is a permanent grant — provisioning is O(machines) and revocation never happens |
| 6 | created: 2026-07-31 |
| 7 | source: provisioning a disposable agent VM against the pilot host, 2026-07-31 |
| 8 | --- |
| 9 | |
| 10 | # Machine access is a permanent grant |
| 11 | |
| 12 | Granting a machine access to a valley host meant appending its public key to |
| 13 | `services.valley.authorizedKeys` and rebuilding the host. The grant had no expiry, so it persisted |
| 14 | until someone edited the list again. Nothing observed that the machine it was issued for had ceased |
| 15 | to exist, and a disposable machine left its key behind when it went. |
| 16 | |
| 17 | Two costs followed, and they compounded as the number of machines grew. |
| 18 | |
| 19 | Provisioning was O(machines) with a human deploy in the loop. Each new machine needed a change to |
| 20 | the host's declaration, review, a merge, and an interactive rebuild of the host. That was a deploy |
| 21 | of the primary git host to grant read access to a scratch machine — an expensive motion to repeat, |
| 22 | and one performed on the machine whose availability everything else depends on. |
| 23 | |
| 24 | Revocation was the harder cost, because it never happened on its own. A key list only shrank when a |
| 25 | human noticed an entry was dead and removed it, and nothing prompted that noticing. Ephemeral |
| 26 | machines are exactly the case where the grant outlives the grantee, so the list accreted standing |
| 27 | grants to destroyed hosts. Each entry reached every project on the host, because access was |
| 28 | host-level by design. |
| 29 | |
| 30 | ## The resolution |
| 31 | |
| 32 | The identity registry ([[dcr-b87f6e8]] |
| 33 | ([dcr-b87f6e8-identity-is-a-governed-registry.md](../decisions/dcr-b87f6e8-identity-is-a-governed-registry.md))) |
| 34 | replaces the hand-maintained key list. Machine and service entries carry mandatory expiry, and |
| 35 | expiry is enforced at compilation: the step that renders the registry into the artifacts a boundary |
| 36 | checks — the host's authorized keys among them — refuses expired entries. Access ends at the first |
| 37 | convergence after expiry, with no separate revocation act. Provisioning a machine is now a registry |
| 38 | entry rather than a host declaration, so granting it no longer requires a rebuild of the primary |
| 39 | host for each machine. |
| 40 | |
| 41 | The compiler is [identity/](../../../identity/), staged first against the host's push boundary — the |
| 42 | same boundary this bug was raised against. A compilation that fails for any reason leaves the last |
| 43 | good artifacts as they were, so a bad registry edit cannot lock the host's git user out; the |
| 44 | declared keys remain the way back in. |
| 45 | |
| 46 | ## Why the risk was tolerable before this landed |
| 47 | |
| 48 | Every key in the list belonged to the operator, the host was reachable only over a private tailnet, |
| 49 | and the projects were small in number. A stale entry was a key nobody held on a host nobody else |
| 50 | could route to. The defect was one of scale and hygiene, not a live exposure. |
| 51 | |
| 52 | ## Related |
| 53 | |
| 54 | The instance-level counterpart is qinling's `dcr-34b3f6d` (keys partition by capability), which |
| 55 | observes that the pilot host's key inventory conflates decryption, authentication, and human |
| 56 | signing, and wants it partitioned by capability. Splitting a git-only class out of the inventory's |
| 57 | user list — done for the machine that surfaced this bug — separates authentication from decryption |
| 58 | for one member, and was a down payment on that partition rather than a substitute for it. |
| 59 | |
| 60 | Short-lived certificates issued per instance are the direction machine access is still moving |
| 61 | toward; the issuance service and what authenticates an issuance request remain open in |
| 62 | [[dcr-b87f6e8]] |
| 63 | ([dcr-b87f6e8-identity-is-a-governed-registry.md](../decisions/dcr-b87f6e8-identity-is-a-governed-registry.md)). |