Skip to content

[audit] Refactor: SetupSporedIAMRole — extract inline trust-policy const; consolidate with iam.go #323

Closed

Description

@scttfrdmn

Filed from the 2026-07-11 spawn audit. Full report: docs/spawn-audit-2026-07-11.md. Assessment-only — no code changed yet.

Phase: Phase 3 — structural (low)

Evidence

  • pkg/aws/client.go:1572-1676 SetupSporedIAMRole (~105 lines, not 209); inline trust-policy literal; 7 callers

Recommendation
Extract the inline trust-policy to a const; consolidate with iam.go create-or-get. (Propagation-wait is already extracted.)

User-facing / SemVer: No — internal. No bump.

Adversarially verified during the audit (62/62 findings survived verification; severities/scope adjusted where the first pass was wrong).

Activity

  1. added
    area:spored
    audit:2026-07
    on Jul 11, 2026
  2. scttfrdmn commented on Jul 11, 2026

    @scttfrdmn
    ContributorAuthor

    Shipped in #336 (client.go split). Closing manually (only #322 auto-closed from that PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sporedaudit:2026-07

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions