You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Guard against spored/reaper IAM drift: code calls AWS APIs the role doesn't grant (recurring class) #254
The same class of bug has now bitten three times: in-instance/out-of-band code (spored, ttl-reaper) calls an AWS API that the relevant IAM role/policy does not grant, so the call fails with AccessDenied — and because these paths are best-effort and under-logged, it manifests as a silent no-op, not a loud failure.
The IAM policy (pkg/aws/iam.gobuildInlinePolicy for spored; lambda/ttl-reaper/template.yaml for the reaper) is maintained by hand, separately from the code that makes the calls. Adding an SDK call doesn't fail any build/test if the matching grant is missing — it only fails at runtime, in an account, often silently.
Ideas (pick one or more)
A test that greps the agent/reaper packages for client.<Service> SDK call sites and asserts each service appears in the inline policy (a coarse but cheap drift guard — would have caught all three).
Centralize the spored required-action list in one place that both buildInlinePolicy and a doc/test consume, so adding a call forces a policy edit in the same change.
ifaceOpen matches it, the service lookup returns "", and if svc == "" { continue } silently drops both methods. methodCall has the
same shape — it only matches (ec2|fsx|ssm)Client\.. So an entire AWS service the
reaper calls, including a mutating action, is invisible to the gate titled "every
AWS action the reaper calls must be granted".
Honest severity: not a live permission gap.pkg/reaperdeploy never
configures DNS, so a scan-self reaper has route53Client disabled. It is the gate
that is wrong, not the policy.
The fix is the rule-4 shape: derive the service from the interface name and fail on an unmapped one, rather than skipping it. A gate whose default for
"I don't recognise this" is continue reports clean on exactly what it forgot —
which is the same defect this issue exists to catch, one level up.
Related, and the inverse direction: the in-account reaper over-grants ssm:SendCommand on Resource: "*". That one is a security finding and is
tracked privately rather than here.
Activity
feat(reaper): make failures observable and alarmable (#469) (#471)
scttfrdmn commentedon Oct 11, 2026
Audit note — the 2026-10 review found a hole in this issue's own guard, which is
worth recording here rather than as a new issue.
apiServicePrefix(pkg/reaperiam/drift_test.go:20) maps onlyec2/fsx/ssm/netResource. Butlambda/ttl-reaper/main.go:178declares:ifaceOpenmatches it, the service lookup returns"", andif svc == "" { continue }silently drops both methods.methodCallhas thesame shape — it only matches
(ec2|fsx|ssm)Client\.. So an entire AWS service thereaper calls, including a mutating action, is invisible to the gate titled "every
AWS action the reaper calls must be granted".
Honest severity: not a live permission gap.
pkg/reaperdeployneverconfigures DNS, so a scan-self reaper has
route53Clientdisabled. It is the gatethat is wrong, not the policy.
The fix is the rule-4 shape: derive the service from the interface name and
fail on an unmapped one, rather than skipping it. A gate whose default for
"I don't recognise this" is
continuereports clean on exactly what it forgot —which is the same defect this issue exists to catch, one level up.
Related, and the inverse direction: the in-account reaper over-grants
ssm:SendCommandonResource: "*". That one is a security finding and istracked privately rather than here.
test(iam): one coverage gate for every spore.host principal's AWS cal…
test(iam): one coverage gate for every spore.host principal's AWS cal…