Skip to content

fix(iam): attach SSM core to the spored instance role (#77) - #89

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/77-spored-role-ssm
Jun 9, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/77-spored-role-ssm

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

spawn connect on Windows uses SSM (Session Manager + RunCommand) — no SSH-user model — but the default spored-instance-role had no SSM permissions, so a normally-launched Windows instance never registered with SSM and connect couldn't reach it. (Found during #77 Stage 5 real-EC2 verification.)

Attach AmazonSSMManagedInstanceCore in SetupSporedIAMRole. Idempotent; AccessDenied is logged non-fatally. Benefits Linux too (enables the no-public-IP SSM connect fallback connect.go already attempts).

Verified end-to-end on real Windows EC2

With this role, a normally-launched Windows instance:

  • registered with SSM,
  • ran spored as a Windows Service (EC2 provider),
  • read its config from EC2 tags (Config: TTL=15m0s via DescribeTags),
  • registered DNS, ran the monitor loop,
  • and self-terminated at the TTL deadline (terminated).

That completes the #77 Windows-spored verification: boot → CLI install → spored download from S3 → service → monitor → self-terminate, all on real Windows. Zero leaks.

Refs #77.

`spawn connect` on Windows uses SSM (Session Manager + RunCommand) — there's no
SSH-user model — but the default spored-instance-role had no SSM permissions, so
a normally-launched Windows instance never registered with SSM and connect
couldn't reach it. Attach AmazonSSMManagedInstanceCore in SetupSporedIAMRole.

Idempotent; AccessDenied is logged non-fatally (restricted IAM still launches,
just without SSM fallback). Benefits Linux too: enables the no-public-IP SSM
connect fallback that connect.go already attempts.

Verified end-to-end on real Windows EC2: with this role, spored registered with
SSM, read its config from EC2 tags (TTL=15m via DescribeTags), registered DNS,
ran the monitor, and self-terminated at the TTL deadline.

Refs #77.
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/aws/client.go 0.00% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit dfe3c08 into main Jun 9, 2026
2 of 3 checks passed
@scttfrdmn
scttfrdmn deleted the fix/77-spored-role-ssm branch June 9, 2026 02:02
scttfrdmn added a commit that referenced this pull request Jun 9, 2026
Patch release for the two fixes that make Windows spored actually install and
self-manage on EC2 (found in v0.38.0 real-EC2 verification):
- #88: install the AWS CLI before the S3 download (stock Windows AMI has none).
- #89: attach SSM core to the spored instance role (Windows connect needs SSM).

Verified end-to-end on real Windows EC2: boot → CLI install → spored download
from S3 → Windows Service → reads config from tags → self-terminates at TTL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant