Skip to content

[audit] Dup: 18 inline sts.NewFromConfig+GetCallerIdentity sites bypass the existing GetAccountID helper #302

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 1 — internal refactor

Evidence

  • pkg/aws/client.go:1806 (c *Client) GetAccountID (has IMDS fallback); cmd/dns.go:307 getAccountID wraps it
  • 18 inline sts.NewFromConfig+GetCallerIdentity across 9 cmd files (cancel, team, list-sweeps, pipeline x2, alerts x2, extend, bot x2, …)

Recommendation
Add accountIDFromConfig(ctx,cfg) or route through aws.NewClientFromConfig(cfg).GetAccountID; RESPECT per-site config (devCfg vs infra). Adds IMDS fallback for free.

User-facing / SemVer: No — internal. CHANGELOG Changed (behavior identical).

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

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

    audit:2026-07

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions