rented drives leak one DigitalOcean SSH key each — ~20 stale idss-gateway-rehearsal-rentfail-* keys on the account, and the name prefix is doubled #708
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#708
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
The DigitalOcean account carries a growing pile of per-drive SSH keys that nothing ever reaps. As of 2026-08-23 (found while doing #707's live forensics):
One per rented rehearsal drive, name doubled (
idss-gateway-idss-gateway-...), never deleted.DigitalOcean.ensureSSHKey(broker/, thePOST /v2/account/keyscall #55 hardened) creates them; no teardown path removes them.Why it matters
What plugging it needs
Reap the key alongside the droplet in the rented teardown (
oc_rented_teardown,scripts/lib/rehearsal-droplet.sh, or the broker's own release path — whichever owns the key's lifetime), and fix the doubled name prefix. A sweep for the existing 20 is a one-off.Found during #707. Not fixed there — out of that ticket's scope (ADR 0174 rule 1: file follow-ups, do not pick up other work).
Verification. Confirmed both root causes by reading the code directly (not just the report):
DigitalOcean.ensureSSHKey(broker/internal/broker/provider_do.go:192) unconditionally does"name": "idss-gateway-" + name, and its only caller,Create(provider_do.go:123), passesreq.Namestraight through — which is already the fully-prefixed droplet name (idss-gateway-<slug>-<rand4>). That's the doubled prefix, confirmed.DigitalOcean.Destroy(provider_do.go:161) only issuesDELETE /v2/droplets/{id}. No code path inprovider_do.go, the broker's release path, oroc_rented_teardown(scripts/lib/rehearsal-droplet.sh:476) ever callsDELETE /v2/account/keys/.... Confirmed no teardown path removes the key.No
.out-of-scope/entry exists for this (directory is currently empty) and no open issue duplicates it.Ruled by agent under ADR 0174 — veto anytime.
Ruling: bug,
ready-for-agent. Scope includes the one-off live sweep of the ~20 existing orphaned keys.Why this is a two-way door: the code fix (prefix-once, delete-key-on-teardown) is an ordinary revertible commit, provable by extending the existing httptest-based contract suite in
provider_do_test.go(the pattern #677/#678 already established for this same file). The one-off live sweep of the ~20 staleidss-gateway-idss-gateway-rehearsal-rentfail-*keys is a live-infrastructure operation, but it's the exact class ADR 0174 rule 1 names as agent-rulable ("live-infrastructure operations with an established rollback pattern") — these are inert, already-orphaned public-key registrations tied to already-destroyed droplets, deletion is provable before/after viadoctl compute ssh-key list, and the account'sdigitalocean_access_tokensecret is already available to sandbox tasks (clan-labconsumes it the same way, per.sandcastle/secrets/README.md). It is not on the one-way-door list: not a personal credential (these are per-drive ephemeral keys, not Ben's own), not a security-posture widening (removing stale keys narrows exposure if anything), not a member-facing trust accept, and not destruction of any data that isn't already inert/orphaned.Agent Brief
Category: bug
Summary: Rented rehearsal drives leak one doubled-prefix DigitalOcean SSH key each, and nothing ever reaps them.
Current behavior:
DigitalOcean.ensureSSHKeyregisters each rented drive's SSH key under a name with the gateway prefix applied twice (idss-gateway-idss-gateway-rehearsal-rentfail-<timestamp>-<rand>), because its caller already passes a fully-prefixed name andensureSSHKeyprefixes again unconditionally. No teardown path — notDigitalOcean.Destroy, not the broker's release path, not the harness'soc_rented_teardownfallback reap — ever deletes the key from the DO account. The account accumulates one stale key per rented drive, unbounded (~20 as of 2026-08-23, back to20260822T170850Z).Desired behavior:
ensureSSHKeycarries the gateway prefix exactly once, regardless of what its caller passes in.releaseleg never ran — the droplet's SSH key is also deleted from the account. Whichever component ends up owning the droplet's destroy call is the natural place to own the key's destroy call too, so the two can't drift out of sync again.idss-gateway-idss-gateway-rehearsal-rentfail-*) are swept once, live, off the DO account.Key interfaces:
DigitalOcean.ensureSSHKey(ctx, name, pubKey)(broker/internal/broker/provider_do.go) — fix the double-prefixing. Check every caller ofCreate/ensureSSHKeyto decide whether the prefix should move to one side only.DigitalOcean.Destroy(ctx, id)/ the broker's release path — needs to resolve and delete the droplet's SSH key (DO'sDELETE /v2/account/keys/{id_or_fingerprint}), not just the droplet.oc_rented_teardown(scripts/lib/rehearsal-droplet.sh) — the harness-side fallback reap for a RED drive whosereleaseleg never ran; mirror its existing droplet-by-tag+IP fallback pattern if this is where the failsafe key cleanup should live instead of (or in addition to) the broker.Acceptance criteria:
broker/internal/broker/provider_do_test.goproves a key registered through the real call path (the same prefixed nameCreateactually passes) is not double-prefixed.idss-gateway-idss-gateway-rehearsal-rentfail-*are deleted from the live DO account — verify viadoctl compute ssh-key list(or the API) before/after: the matching keys are gone, nothing else changed.Out of scope:
swarm-claim host=elitebook-distributed-server-03 run=9326
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #708 — status
success⛔ close-report gates REFUSED this close — the following claims did not verify:
451d2c52c7is not reachable from origin/main (not landed)envelope
close-report for #708 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745