Skip to content

[audit] Medium/Low findings tracker (2026-06 suite audit) #175

Closed

Description

@scttfrdmn

Consolidated Medium/Low for spawn. Critical/High: #173 #174.

  • [M sec] Wildcard IAM templates (s3:*/dynamodb:*/sqs:* on *) user-attachable to instance role. → gate FullAccess behind a flag; default to GenerateScoped* policies.
  • [M corr] Data race on Agent.config: EBS-cost goroutine writes while monitor reads/replaces the pointer. → mutex/atomic.Pointer; run agent tests with -race.
  • [M health] Duplicated byte-identical zombie-prevention block (launch.go:640-655); double --no-timeout warning, dead branch. → delete dup, extract helper.
  • [L sec] DNS registration over SSH disables host-key verification (MITM window). → register from inside instance via user-data/SSM.
  • [L sec] Long-lived IAM creds sent to hosted Lambda via X-AWS-Credentials. → prefer SigV4/presigned GetCallerIdentity; reject AKIA if kept.
  • [L health] configRefreshTick package global mutated by agent loop. → move into Agent struct.
  • [L ergo] --no-timeout disables cost guardrails with only a warning. → require confirm / paired flag; document reaper max-age ceiling.

Activity

  1. added
    bug
    on Jun 15, 2026
  2. added a commit that references this issue on Jun 21, 2026
  3. scttfrdmn commented on Jun 21, 2026

    @scttfrdmn
    ContributorAuthor

    Addressed in e5468c4:

    • ✅ [M corr] Data race on Agent.config: the monitor loop swaps the config pointer (periodic tag refresh) while the FSx-mount and spot-monitor goroutines read it. Access now goes through a mutex-guarded snapshot (cfg()/setConfig()); mountPendingFSx reads a single snapshot. Also removed a redundant racy write of the EBS hourly cost from a startup goroutine (it already propagates via the instance tag + periodic refresh). Agent tests now pass under -race (they previously failed).
    • ✅ [M health] Removed the byte-identical duplicated zombie-prevention block (the double --no-timeout warning).
    • ✅ [L health] configRefreshTick moved from a package global into the Agent struct.

    Deferred (need a product/security-architecture decision — leaving open):

    • [M sec] Wildcard IAM templates (s3:*/dynamodb:*/sqs:* on *) user-attachable to the instance role → gate FullAccess behind a flag; default to GenerateScoped* policies.
    • [L sec] DNS registration over SSH disables host-key verification (MITM window) → register from inside the instance via user-data/SSM.
    • [L sec] Long-lived IAM creds sent to the hosted Lambda via X-AWS-Credentials → prefer SigV4/presigned GetCallerIdentity.
    • [L ergo] --no-timeout disables cost guardrails with only a warning → require a paired confirm flag / document the reaper max-age ceiling.
  4. scttfrdmn commented on Jul 16, 2026

    @scttfrdmn
    ContributorAuthor

    Re-verification against current code (v0.76.0) — 2026-07-16

    3 of 7 fixed organically since June; 4 still open.

    • [M sec] Wildcard IAM templates — ❌ STILL-OPEN. pkg/aws/iam.go:195-270 still defines s3:*/dynamodb:*/sqs:*-on-* FullAccess templates, attachable via buildInlinePolicy (iam.go:691) with no gating flag. Scoped GenerateScoped* generators exist but don't gate the FullAccess path.
    • [M corr] Data race on Agent.config — ✅ FIXED. Now guarded by configMu sync.RWMutex + cfg()/setConfig() accessors (pkg/agent/agent.go:43-44,110-124); EBS-cost goroutine no longer writes config (agent.go:166-179). Caveat: CI does not run go test -race (Makefile uses plain go test).
    • [M health] Duplicated zombie-prevention block — ❌ STILL-OPEN. After the [audit] Refactor: split cmd/launch.go (4324 LOC god-file) along its 5 concerns #318 launch.go split it's now copy-pasted across launch_single.go:290-302, launch_batchqueue.go:211-219, launch_sweep.go:246-248; the doubled "CRITICAL SAFETY CHECK" comment remains at launch_single.go:284/287. No shared helper.
    • [L sec] DNS registration over SSH disables host-key verification — ❌ STILL-OPEN, but this is a duplicate of Local-matching user login fails: spawn silently installs the wrong SSH key + DNS/connect used wrong user #349's follow-up (move DNS registration into spored). registerDNS still uses StrictHostKeyChecking=no (launch_posthook.go:132-133,154). Tracking on Local-matching user login fails: spawn silently installs the wrong SSH key + DNS/connect used wrong user #349.
    • [L sec] Long-lived creds via X-AWS-Credentials — ✅ FIXED by the [HIGH] dns-updater accepts unsigned identity docs + default-allows cross-account → Route53 spoofing #173 SigV4 cutover. No X-AWS-Credentials in pkg/ or cmd/; DNS client SigV4-signs (pkg/dns/client.go:64-75,365-380).
    • [L health] configRefreshTick package global — ✅ FIXED. Now an Agent struct field (agent.go:99-102).
    • [L ergo] --no-timeout warn-only — ❌ STILL-OPEN (flag ergonomics). Warning only (launch_single.go:296-302 et al.); partial backstops exist (sweep requires --ttl/--idle-timeout with --no-detach; server-side ttl-reaper ceiling) but no confirm/paired-flag on the flag itself.

    Remaining: wildcard-IAM (M sec), dup zombie block (M health), --no-timeout ergo (L). DNS-over-SSH → folded into #349. Will address the rest repo-by-repo.

  5. scttfrdmn commented on Jul 16, 2026

    @scttfrdmn
    ContributorAuthor

    Remaining code items closed by PR #364 (merged): wildcard *:FullAccess IAM gate (--iam-allow-full-access), --no-timeout confirmation, de-duplicated zombie-guard, and pkg/agent under -race in CI. The only item not addressed here is DNS-registration-over-SSH (L sec), which is a duplicate of #349's follow-up (move DNS registration into spored) — tracked there. This tracker can be closed once #349 lands.

  6. scttfrdmn commented on Jul 17, 2026

    @scttfrdmn
    ContributorAuthor

    All actionable code items shipped in PR #364 (wildcard-IAM opt-in gate, --no-timeout confirmation, de-duplicated zombie-guard, pkg/agent under -race in CI). The 2 audit-named symbols in #290's scope were already handled; the remaining Medium/Low items were verified fixed or shipped. The one item not fixed here — DNS-registration-over-SSH with host-key verification disabled (L sec) — is a duplicate of #349 (move DNS registration into spored), now noted there. Closing; #349 carries the DNS follow-up.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions