Repository navigation
Description
Goal
Establish a spore.host-owned signing key and a signed authenticity tag
on every spore, so spore tools can cryptographically verify an instance is a
legitimate spore.host spore. Invariant: if the signature is absent or does not
verify, spore tools will not touch the instance — they treat it as not-ours.
This is the trust root for all destructive/mutating spore automation, motivated
by the TTL reaper (#70): today the reaper acts purely on plaintext tags
(spawn:managed=true + past spawn:ttl-deadline), which anyone with
ec2:CreateTags can forge to either trick the reaper into killing a non-spawn
instance, or to hide a spore from it. A signature anchored to a key only
spore.host holds removes tag forgery as an attack.
Key ownership
- The signing key belongs to spore.host, in its infra account (966362334030).
- Asymmetric (sign/verify), preferably KMS asymmetric (ECC_NIST_P256 / sign)
so the private key never leaves KMS:- Private key: only the launch path /
spawn extendmay callkms:Sign
(scoped IAM in infra). - Public key: distributed to verifiers (the reaper Lambda, and any other
spore tool); verification is offline, no KMS call needed.
- Private key: only the launch path /
- Cross-account: spores run in many accounts, but they're all signed by the one
infra-account key; verifiers just need the public key.
The signed tag
spawn:ttl-sig(orspawn:sig) = signature over a canonical payload binding
at minimum instance-id + account-id + ttl-deadline (so a signature can't
be replayed onto another instance, and a deadline can't be extended without
re-signing —spawn extendmust re-sign).- Written at launch alongside the existing
spawn:*tags.
Verification contract (shared primitive)
A single verify function (e.g. pkg/authenticity) used by every spore tool
that mutates or terminates an instance:
Verified(instance) == valid signature over (instance-id, account, deadline)
using the spore.host public key
- Reaper (Server-side TTL reaper: out-of-band backstop so a spore can never outlive its deadline (even if spored is dead) #70): only terminates instances that are
VerifiedAND past
deadline/max-age. Unverified instances are never terminated by the reaper
(fail-safe toward not-destroying). - Other spore tools (stop/start/extend/etc.): refuse to act on unverified
instances, or clearly mark them as "not a spore.host spore."
Design decisions to resolve
- Migration: existing unsigned instances. Per the invariant, tools won't
touch them — which is safe for destructive actions but means the reaper
won't reap legacy spores (potential leak). Options: backfill-sign the current
fleet via the launch role, a cutover date, or a documented max-age sweep for
the legacy unsigned set. MUST be decided before enforce mode relies on
signatures. - Sig-stripping: an attacker who deletes
spawn:ttl-sigmakes a spore
unverifiable → untouchable → leaks. Mitigate by restrictingec2:CreateTags/
DeleteTagson thespawn:*namespace to the launch role via IAM/SCP, so the
authenticity tags can't be forged or stripped in the first place (highest
leverage; pairs with signing). - Payload canonicalization + versioning (
spawn:sig-v), key rotation, and the
KMS key policy.
Scope / sequencing
- The TTL reaper (Server-side TTL reaper: out-of-band backstop so a spore can never outlive its deadline (even if spored is dead) #70, Release v0.37.0 — TTL reaper backstop + lifecycle invariant #75) ships in dry-run today and does not yet depend on
signatures. Broadly enabling reaper enforce mode in accounts that also run
non-spawn production instances SHOULD wait on this (or on the SCP mitigation),
to remove the forged-kill risk.
Activity
[-]Harden reaper against tag forgery: signed spawn:ttl-deadline tags[/-][+]Implement spore.host authenticity key: signed spore tag that all spore tools verify before touching an instance[/+]scttfrdmn commentedon Oct 11, 2026
Audit note — this issue is the designed fix for a threat the 2026-10 review
re-confirmed, and its framing is already exactly right:
Three specifics worth adding, because they narrow who "anyone" is and because one
of them is independently fixable without waiting for the signing key.
1. The forger does not need stolen credentials — the instance's own role suffices
pkg/aws/iam.go:921-933(and the DCV copy at:1296-1305) grants the instanceec2:CreateTags/ec2:DeleteTagsconditioned onec2:ResourceTag/spawn:managed=true— a condition its own instance satisfies.The #174 fix correctly stopped a spore tagging foreign instances; it does not
stop a spore rewriting its own control tags. So any code execution on a spore —
the owner's own job, or an RCE in their workload — is enough.
2. The max-age ceiling is skipped on the forged branch, and that part is fixable now
lambda/ttl-reaper/main.go:744-760:A deadline of 2099 therefore exempts the instance from the max-age ceiling as
well, which
template.yaml:41advertises as a "hard max-age ceiling". Removingthat early
returnmakes the ceiling genuinely unconditional and bounds thedamage to
MaxAgeinstead of forever — one line, no dependency on this issue.3. The detection control is defeated by the same primitive
SporedQuietAlarm(lambda/ttl-reaper/template.yaml:539) fires on theSPORED NOT CHECKING INsentinel, whichheartbeat.go:61derives from thespawn:last-heartbeattag — written by the in-instance agent atpkg/agent/agent.go:711. So an instance can forge its own liveness attestation:kill spored, extend the deadline, and no alarm fires.
heartbeat.go:85-88states the assumption this breaks: "the instance's lifetimeis still governed by
spawn:ttl-deadlineand the reaper's max-age ceiling, whichare the right authorities." Both are instance-writable, so neither is an
authority today.
Why no separate advisory
The threat is already public here, so filing it privately would be theatre. The
cheap mitigations — the unconditional ceiling above, and denying the control tag
keys on the instance role via
ForAllValues:StringNotEqualsonaws:TagKeys—belong in this issue or a small PR referencing it.
Interaction to watch: #112 proposes making the tag prefix configurable
(
prism:/prp:), which a tag-key denylist would have to track. And #38/#39 askto widen
spored-instance-role; those should not be merged without checkingthey do not re-grant unconditioned tag writes.
fix(reaper): make the max-age ceiling apply inside a live deadline, a…
Stop the reaper running instance-writable tags as root (#832)