Repository navigation
Description
Part of the Leave-no-trace epic spore-host/spore-host#752; found while making spawn#1665 (spawn#1654) silent on a denied lease mark.
The gap
Since spawn#1654, every spawn create path first marks spawn active in the shared-account lifecycle lease. That is the DynamoDB table spore-host-lifecycle, through pkg/lifecyclemark.Mark. The mark needs these actions on arn:aws:dynamodb:*:*:table/spore-host-lifecycle:
dynamodb:ConditionCheckItem,UpdateItem,PutItem,DeleteItem,DescribeTable,CreateTable,TagResource(lifecyclemark.RequiredActions; a test holds this list to what the call graph finds);GetItem, forspawn reaper teardown --if-idle-foronly.
Nothing spore.host provisions gives a CLI user these actions. I checked every path that provisions IAM:
spawn setup-account(admin, once per account) creates only the permissions boundaryspore-host/spawn-instance-boundary. That boundary caps the roles spawn creates. It grants nothing to the user.- Every role spawn creates is a role for instances, sweeps, pools, the reaper, the bot or onboarding:
spored-instance-role,spawn-instance-*,SpawnSweepCrossAccountRole, the reaper roles, and the bot and onboard cross-account roles. None of them is the CLI user's identity. - The portal's onboarding role (
spore-portal-onboard, spore-host/spore-hostdeployment/cloudformation/portal-onboarding-role.yaml) belongs to the portal, which is read-only at 1.0 and creates nothing. - The user baseline is a document only: spore-host/spore-host
docs/reference/iam-permissions.md. An administrator copies it into a policy by hand.
So today an account is lease-enabled only where an administrator added the actions themselves. Everywhere else, the mark fails. That is now silent: it writes to the diagnostic log, and spawn doctor shows an "idle teardown" check. The account counts as "lease unavailable", and the reaper's account-idle sweep never tears it down.
That is safe, but it means leave-no-trace's idle teardown covers almost no account. The owner's rule is that spore.host provisions the IAM a feature needs; "add this to your baseline" is a product gap.
What to decide and build
How spore.host should provision user-side IAM. One option is for spawn setup-account to create a customer-managed policy, e.g. spore-host/spawn-user-lifecycle, scoped to table/spore-host-lifecycle. The administrator would then attach it, or setup-account --attach-to <principal> would. A broader version would ship the whole documented baseline as a managed policy. Either way:
- the policy is tagged
spore-host:managed-by=spawn; - it is removed with the boundary by
spawn setup-account --remove(spawn#1656); spawn doctorpoints at it.
The doc change in spore-host/spore-host#755 currently describes the statement as something an administrator grants. It should become "what spore.host provisions" once this ships.
Activity
fix(lifecyclemark): a denied lease mark is silent; spawn doctor repor…
Reaper account-idle sweep (report mode), lease marks on every creator…
feat(footprint): the user lifecycle policy is permanent account setup…
docs: Leave no trace, what remains and why (#751); IAM page points at…
feat(setup-account): --remove/--offboard, and provision the user life…
feat(footprint): the user lifecycle policy is permanent account setup…
CHANGELOG: keep [0.168.0] as tagged; #1656/#1666 entries under [Unrel…
feat(setup-account): --remove/--offboard, and provision the user life…