Skip to content

spored-instance-role is shared and rewritten by whichever CLI version launches last; mixed-version accounts silently lose newer grants #1558

Description

@scttfrdmn

Found live-testing #1555 (PR comment #1555 (comment), spore-host-dev, 2026-11-08).

  • A branch launch put ec2:DescribeSpotPriceHistory into spored-policy on the shared spored-instance-role. CloudTrail: a successful PutRolePolicy.
  • A released v0.161.0 spawn launch in the same account then rewrote spored-policy without it.
  • The live Spot instance's next price read got UnauthorizedOperation. It would have fallen back to on-demand costing after 1 h. A later branch launch restored the grant.

So in any account where more than one CLI version launches (CI on the latest, a laptop on an older Homebrew, a colleague), the shared role's policy flips between versions. Newer grants vanish from running instances, and older CLIs can strip what newer spored builds need, or the reverse. This isn't specific to #1555; it applies to every future grant.

Options:

  • Make the role policy monotonic: never remove an action that an older CLI doesn't know about. For example, merge the existing statements, keyed by Sid, and only add.
  • Or version the role, e.g. spored-instance-role-v<schema> per policy schema version, with each CLI using its own (needs a deleter for retired versions: leave-no-trace).
  • Or include a policy version marker so an older CLI refuses to downgrade and warns instead.

Pick one and verify it with a real PutRolePolicy under mixed versions. Related: the reaper and Lambda version-skew note in project memory ("version skew is the normal state").

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sporedtype:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions