gunk-dev/the-valley

bd-8a591dc-machine-credentials-never-expire.md

source464bb74845f2main's published tip history
4.0 KiB · Rendered
1---
2type: bug
3id: bd-8a591dc
4status: open
5title: Machine access is a permanent grant — provisioning is O(machines) and revocation never happens
6created: 2026-07-31
7source: provisioning a disposable agent VM against the pilot host, 2026-07-31
8---
9
10# Machine access is a permanent grant
11
12Granting a machine access to a valley host means appending its public key to
13`services.valley.authorizedKeys` and rebuilding the host. The grant has no expiry, so it persists
14until someone edits the list again. Nothing observes that the machine it was issued for has ceased
15to exist, and a disposable machine leaves its key behind when it goes.
16
17Two costs follow, and they compound as the number of machines grows.
18
19Provisioning is O(machines) with a human deploy in the loop. Each new machine needs a change to the
20host's declaration, review, a merge, and an interactive rebuild of the host. That is a deploy of the
21primary git host to grant read access to a scratch machine — an expensive motion to repeat, and one
22performed on the machine whose availability everything else depends on.
23
24Revocation is the harder cost, because it never happens on its own. A key list only shrinks when a
25human notices an entry is dead and removes it, and nothing prompts that noticing. Ephemeral machines
26are exactly the case where the grant outlives the grantee, so the list accretes standing grants to
27destroyed hosts. Each entry reaches every project on the host, because access is host-level by
28design.
29
30## Why it is acceptable today
31
32Every key in the list belongs to the operator, the host is reachable only over a private tailnet,
33and the projects are small in number. A stale entry is a key nobody holds on a host nobody else can
34route to. The defect is one of scale and hygiene, not a live exposure.
35
36## The gate
37
38The mechanism needs replacing before either of these becomes true:
39
40- machines that are not the operator's own are granted access, or
41- machines are provisioned often enough that the manual rebuild is a routine motion rather than an
42 exception.
43
44Dispatched agent machines make the second true first, and they arrive with S3.
45
46## Directions, not decisions
47
48- **Move authorization to the tailnet.** Identity is already declared to be Tailscale-ACL-based, and
49 the tailnet is already the front door, but it currently establishes reachability while a static
50 key list establishes authorization. An ACL tag naming which nodes may act as the git user would
51 make access follow from a machine's tag, needing no host change per machine, and would inherit
52 node expiry as a TTL. Whether Tailscale SSH composes with `git-shell` and non-interactive
53 `git-receive-pack` is unverified, and it bypasses the module's sshd hardening.
54- **Short-lived certificates.** An SSH CA trusted by the host, issuing certificates that expire in
55 hours, makes revocation the default rather than an act of hygiene. It also introduces a signing
56 service, which is a new coordination point to justify against the decentralization constraint. The
57 trust backstop wants something shaped like this anyway.
58- **Do not credential the machine at all.** Integration is planned to be pull-based. A contributor
59 the integrator fetches from needs to be reachable, not authorized to push. A disposable machine is
60 a better fetch source than it is an authorized pusher.
61
62## Related
63
64The instance-level counterpart is qinling's `dcr-34b3f6d` (keys partition by capability), which
65observes that the pilot host's key inventory conflates decryption, authentication, and human
66signing, and wants it partitioned by capability. Splitting a git-only class out of the inventory's
67user list — done for the machine that surfaced this — separates authentication from decryption for
68one member, and is a down payment on that partition rather than a substitute for it. Neither change
69gives a grant an expiry.
70
71The open question this sharpens is _when_ Phase-0 identity has to grow and into what
72([openquestions.md](../../design/openquestions.md)). This bug is one concrete forcing function: a
73machine that exists for an afternoon.