Skip to content

Bind spored to name and version; verify Windows and DCV installers (#1597, #1598) - #1619

Merged
scttfrdmn merged 2 commits into
mainfrom
fix/1597-1598-artifact-integrity
Nov 14, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
fix/1597-1598-artifact-integrity

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1597
Fixes #1598

Both issues are about artifact integrity: what the bootstraps install as root/SYSTEM must be exactly what spore.host or Amazon published, and nothing else.

#1597: spored bound to its name and version

Each spored's .sig covers its bytes alone, and the .sha256 sits in the same bucket. So any spored ever signed, of any version or architecture, verified at any release's path.

  • Release (release.yaml). For each spored, the release writes ManifestText = spored-manifest-v1\nname=<name>\nversion=<v>\nsha256=<hex>\n and KMS-signs its digest as <name>.msig. It then verifies that signature against the key compiled into spawn, publishes it with the others, reads it back, and copies it to current/.
  • Linux installer (VerifiedInstallFunc). When SPORED_MANIFEST_VERSION is set, the installer rebuilds the manifest with printf from the binary name, that version and the sha256 it just computed, then verifies .msig with openssl. A missing .msig or a failed verify refuses the install. PinScriptFor sets the variable only for releases ≥ ManifestFloor.
  • Windows installer. Same check in .NET (Assert-SporeSignature over the manifest's SHA-256).
  • ManifestFloor = 0.165.0. This is the first release that will publish .msig. Older releases have none and are still held to .sig alone. TestManifestFloorIsNotAnExistingRelease fails if a tag at or past the floor was released without .msig. If this ships in a release other than 0.165.0, adjust the floor.
  • Bootstrap budget raised by 160 gzipped bytes, in review (minify_test.go has the reasoning). It lands in the published body; a release stub gains one variable.

#1598: Windows installers and DCV

  • Windows installers. The Assert-SpawnAmazonSigned function (pkg/sporedinstall/authenticode.go) requires Get-AuthenticodeSignature Status Valid and a signer subject O=Amazon…, or it throws. Every downloaded installer passes it before it runs:
    • the SSM agent setup
    • the AWS CLI MSI in the launch user data. The MSI is now AWSCLIV2-<the Linux pin's version>.msi, falling back to AWSCLIV2.msi; both are signature-checked.
    • scripts/install-spored.ps1, which was regenerated.
  • DCV (dcvInstallBlock).
    • rpm --import failing now installs nothing; it used to be || true.
    • Every RPM must print digests signatures OK under rpm -K. No RPMs, or any other line, also installs nothing.
    • dnf runs with --setopt=localpkg_gpgcheck=1.

Not done here: sha256 pins for the DCV tarball, the MSI and the SSM agent setup. Computing them means fetching the artifacts from AWS origins, which this work was not allowed to do. The signature checks above fail closed in their place, and I filed #1620 to add the hashes through the pin workflow.

Tests and gates

There is no IAM change, so no sporedPolicySchema bump. User data, the bootstrap body and the release workflow all change.

Live checks needed before merge (owner)

Run in 435415984226, with --ttl 30m.

  1. Release dry run. The first real check of .msig is the release itself. Before tagging, run the "Publish the versioned spored" step on a scratch tag, or read the step's own self-verify output on the release run. Then confirm:
    • aws s3 ls s3://spawn-binaries-us-east-1/spawn/versions/<v>/ --region us-east-1 lists *.msig for all three binaries.
    • openssl dgst -sha256 -verify of the manifest passes.
  2. Linux. With a release build, spawn launch --ttl 30m should log Signature verified and the instance should heartbeat. Negative: in a scratch bucket path, a stale .msig must make the install retire the instance with #1597.
  3. Windows.
    • spawn launch --os windows --ttl 30m. The console output (aws ec2 get-console-output --region us-east-1) shows no spawn: refusing, and spored runs.
    • On an imported Windows 11 AMI without the SSM agent, the agent installs, which confirms the Amazon signer regex on AmazonSSMAgentSetup.exe.
    • On a stock AMI, C:\Program Files\Amazon\AWSCLIV2\aws.exe exists afterwards, which confirms the MSI signer.
  4. DCV. spawn app launch <a DCV app> --ttl 30m should install DCV, start the session, and print no failed signature verification.
  5. Terminate everything and leak-check.

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/sporedinstall/windows.go 91.30% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

scttfrdmn and others added 2 commits November 13, 2026 16:17
…1597, #1598)

the same bucket, so any signed spored, of any version or architecture,
verified at any release's path. Each release now also KMS-signs a
manifest (name, version, sha256) as <name>.msig; the Linux and Windows
installers rebuild it from what they asked for and what they downloaded
and refuse a missing or non-verifying one, for releases from
ManifestFloor (0.165.0) on. The bootstrap budget grows by 160 gzipped
bytes, in review.

Linux bootstrap pins, latest as fallback) and the SSM agent setup only
after Get-AuthenticodeSignature is Valid with an Amazon signer. The DCV
install fails closed: the key import, every RPM's rpm -K and dnf's
localpkg_gpgcheck must pass, or nothing is installed.
@scttfrdmn
scttfrdmn marked this pull request as ready for review November 14, 2026 00:19
@scttfrdmn
scttfrdmn force-pushed the fix/1597-1598-artifact-integrity branch from d11b75d to 6b5652f Compare November 14, 2026 00:19
@scttfrdmn
scttfrdmn merged commit 0d5fe66 into main Nov 14, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1597-1598-artifact-integrity branch November 14, 2026 00:38
@scttfrdmn scttfrdmn mentioned this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant