Skip to content

Key pairs a nested-spawn head imports are never deleted (no deleter, not reaped) #1621

Closed

Description

@scttfrdmn

Found during a live check, 2026-11-13. A nested-spawn head that launches a child imports an EC2 key pair, spawn-key-<user> (here spawn-key-spore), tagged spawn:managed=true with spawn:iam-user set to the head's role session. The pair outlived both instances by more than a day: nothing deletes it on spawn terminate, at head teardown, or in the TTL reaper (lambda/ttl-reaper has no DeleteKeyPair path; netresources.go reaps SGs, ENIs and EIPs only). It was deleted by hand.

Fix: give every spawn-imported key pair a named deleter:

  • the reaper deletes spawn:managed key pairs that no running or stopped instance references and that are older than a grace period;
  • spawn cleanup has the same path.

Workstation keys that users reuse should be distinguished from per-session ones, for example with a spawn:purpose=ssh-key-session tag, so a user's long-lived key is never removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions