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
ttl-reaper template.yaml ScanSelf policy has drifted from pkg/reaperiam: no network-resource grants, and unconditioned ssm:SendCommand #985
Found while adding the #950 grant. I read the code and did not check a live stack.
lambda/ttl-reaper/template.yaml attaches its own inline policy when ScanSelf=true. That policy is maintained apart from pkg/reaperiam.ScanSelfStatements, and the drift gates in pkg/reaperiam/drift_test.go check only reaperiam and ttl-reaper-cross-account-role.yaml. They never read template.yaml. The two have diverged:
ssm:SendCommand and ssm:GetCommandInvocation are Resource: '*' with no condition. Scope the in-account reaper's SSM grant the way the cross-account template already does #818 narrowed SendCommand in reaperiam to spawn-managed instances plus the AWS-RunShellScript document, because the unconditioned form allows arbitrary root shell on any SSM-managed instance in the account. The template still has the unconditioned form.
Production runs ScanSelf=false, so the operated reaper is not affected. Anyone deploying this template with ScanSelf=true is.
Suggested fix: extend TestBothReaperRolesGrantTheSameTargetAccountActions, or add a sibling test, so that the template's ScanSelf statement must match ScanSelfStatements in actions, and in conditions for the destructive and SSM actions. Then bring the template into line.
Activity
Gate the reaper's YAML IAM copies against pkg/reaperiam; fix the SAM …
Gate the reaper's YAML IAM copies against pkg/reaperiam; fix the SAM …
Annotate the template-drift test's JSON canonicalisation for Semgrep (#…
Gate the reaper's YAML IAM copies against pkg/reaperiam; fix the SAM …
Annotate the template-drift test's JSON canonicalisation for Semgrep (#…
Gate the reaper's YAML IAM copies against pkg/reaperiam; fix the SAM …