Repository navigation
Verify spored by its heartbeat tag; report AccessDenied as AccessDenied (#1053, #1126) - #1196
Merged
Merged
Conversation
This was referenced Oct 19, 2026
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…ed (#1053, #1126, #878) spawn launch now waits for spored's spawn:last-heartbeat tag (read with ec2:DescribeInstances, already in the IAM baseline) and uses SSM only as a second signal. AMIs without amazon-ssm-agent no longer fail with a false "spored never came up". SSM AccessDenied is terminal and names the refused action; a refused DescribeInstances is reported as "could not be verified", not as a broken instance. --wait-for-ssh=false now says it skipped verification.
scttfrdmn
force-pushed
the
fix/1053-1126-spored-verification
branch
from
October 19, 2026 22:12
ba64e96 to
d4b7cae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Post-launch spored verification (
cmd/launch_posthook.go, called fromlaunch_singleStep 10b andplugin'sensureInstanceReady) now waits for spored's ownspawn:last-heartbeattag, per the owner decision on #1053. SSM is consulted alongside it as a second signal (a successfulspored status/Get-Service sporedstill verifies, and can answer before the first heartbeat), but SSM being absent or refused is never the verdict.ec2:DescribeInstances, which the documented baseline (EC2ReadAndLaunch) grants on*unconditioned.ec2:DescribeTagswas deliberately not used: the baseline only grants it under anec2:ResourceTag/spawn:managedcondition, which a Describe call cannot satisfy. No IAM policy in this repo was changed.writeHeartbeatTagis inpkg/agent/agent.go(no build constraint) and is called fromcheckAndActon every OS; a gate checks this for GOOS=linux and windows.pkg/aws:WaitForSSMOnline,RunShellScriptandRunPowerShellnow return an*AccessDeniedErrornamingssm:DescribeInstanceInformation/ssm:SendCommand/ssm:GetCommandInvocationat once instead of polling it until the timeout. During launch verification an SSM refusal only disables the SSM signal (the heartbeat still answers) and is named in the timeout message if nothing arrives. A refusedec2:DescribeInstancesstops verification immediately with "spored could not be verified ... your credentials lack ec2:DescribeInstances ... the instance itself may be fine", never "spored never came up".--terminate-on-error; the message now says which evidence was missing and what SSM saw. A missing instance profile still fails fast (wrapsErrSSMUnreachable), and a stopped/terminated instance now fails fast too.--wait-for-ssh=false(spored-availability preflight for regions without a bucket; spored verification is missing on Windows and possibly on non-single launch paths #878): still the escape hatch, per the scope in spored-availability preflight for regions without a bucket; spored verification is missing on Windows and possibly on non-single launch paths #878's correction comment, but no longer silent. It prints that spored was not verified, help text says it skips spored verification too, and--output jsongainsspored_verified.Gates (each watched failing against a compiling revert)
TestVerifySpored_SSMDeniedButHeartbeatVerifies,_NoSSMAgentButHeartbeatVerifiescase false && l.Heartbeat != ""TestVerifySpored_DescribeDeniedIsUnverifiableAndNamedcase false && err != nil && IsAccessDenied(err); alsoif false && errors.As(err, &unverifiable)in the launch messageTestVerifySpored_TimeoutNamesTheRefusedSSMActionif false && IsAccessDenied(oerr);case false && IsAccessDenied(perr)TestVerifySpored_NoHeartbeatTimesOutTestHeartbeatTagIsWhatSporedWritesOnEveryOSspawn:heartbeat;_ = a.writeHeartbeatTagincheckAndActTestSkippedSporedVerificationIsAnnounced} else if false {;}+if false {TestWaitForSSMOnline_AccessDeniedIsTerminalAndNamed(fake SSM over httptest)_ = deniedinisOnlineTestRunCommand_AccessDeniedIsTerminalAndNamed(shell + PowerShell)false && d != nilfor SendCommand; same for GetCommandInvocationAll polling tests run on an injected clock and count calls through the
sporedSignalsseam; no wall-clock bounds.Checks
make check: every step passes exceptcheck-build-tags, which fails identically on an unmodifiedorigin/mainworktree on this machine (/private/tmppaths intest/e2e/tier2_test.go,tier3_test.go).make api-snapshotcommitted (additions only).make gen-docs+check-docsclean.semgrep scan --config=auto --errorclean on touched files.Not done / follow-ups
spore-host/spore-hostdocs/reference/iam-permissions.md) says the SSM actions are required for verification and that without them the launch "reports that spored never came up". After this merges they are optional for launch, so that paragraph needs updating.Fixes #1053
Fixes #1126
Refs #878