Skip to content

ttl-reaper template.yaml ScanSelf policy has drifted from pkg/reaperiam: no network-resource grants, and unconditioned ssm:SendCommand #985

Closed

Description

@scttfrdmn

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions