Skip to content

Provision the user-side lifecycle-lease IAM (spore-host-lifecycle) instead of documenting it #1666

Closed

Description

@scttfrdmn

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, for spawn reaper teardown --if-idle-for only.

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 boundary spore-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-host deployment/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 doctor points 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:spawnenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions