Skip to content

installers: pin sha256s for the Windows AWS CLI MSI, SSM agent and DCV, refreshed by a workflow (#1620) - #1635

Merged
scttfrdmn merged 1 commit into
mainfrom
hardening/installer-pins
Nov 15, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
hardening/installer-pins

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1620

As instructed, nothing here downloads from AWS. This PR adds the mechanism that pins the hashes, and wires the bootstrap to use them. The pins themselves come from the new workflow's first run, which you trigger.

The workflow: .github/workflows/installer-pins.yml

It runs weekly and on workflow_dispatch, with an optional force input. The top-level permissions are {}.

Job Runner Token Does
windows windows-latest contents: read Runs scripts/installer-pins-windows.ps1. Downloads AWSCLIV2-<Linux awsCLIVersion>.msi, plus the newest aws/amazon-ssm-agent tag's SSMAgent/<v>/windows_amd64/AmazonSSMAgentSetup.exe, from amazon-ssm-us-east-1, cross-checked byte-for-byte against the ec2-downloads-windows copy. Hashes a file only after Get-AuthenticodeSignature reports it Valid with an Amazon signer. The check is a verbatim copy of WindowsAmazonSignedFunc, held to the original by a test.
dcv ubuntu-latest contents: read Runs scripts/installer-pins-dcv.sh. Downloads NICE-GPG-KEY and both dcvVersion tarballs, and requires every RPM to pass rpmkeys -K against that key in a throwaway rpm database. Computes the key's primary fingerprints with the same pipeline the boot uses, also held by a test. Skips if dcvVersion is already pinned.
pr ubuntu-latest contents / pull-requests / issues: write Needs both jobs above. Runs scripts/installerpin set, regenerates scripts/install-spored.ps1, runs the pin tests, then opens the PR. If GitHub refuses the PR, it opens a fallback issue gated by pr-refused, the same pattern as awscli-pin.yml and efa-pin.yml. A changed DCV key is called out in the PR body.

The bootstrap

  • Windows (cmd/launch_config.go, and the generated install-spored.ps1): the scripts gain an Assert-SpawnSHA256 check. Once a pin is set:
  • DCV (cmd/app.go): once pinned, the boot downloads the key to a file and requires its sorted primary fingerprints to equal the pin before rpm --import. It also requires the machine's tarball sha256 before extracting. rpm -K and localpkg_gpgcheck still run after that. An unknown architecture installs nothing.
  • Unpinned (today): both scripts behave exactly as before.

Gates

Each of these was watched failing against a revert that compiles:

  • TestInstallerPinsAreWellFormed: each pin group is all set or all empty and well-formed, and the DCV pins match dcvVersion. Bumping dcvVersion without re-pinning fails CI.
  • TestDCVInstallsOnlyThePinnedTarballAndKey: runs the boot in bash. Fails for another key, an extra key, a different tarball, or an architecture with no pin.
  • TestPinnedWindowsDownloadsCheckTheSHA256 and TestAssertSpawnSHA256: the latter runs in PowerShell, and runs on the Windows CI job.
  • TestInstallerPinsWorkflowVerifiesBeforeItWrites: the workflow's triggers and per-job permissions, and that it commits the four files.
  • TestInstallerPinScriptsAgreeWithTheBootstrap: the two copied checks still match the boot's.
  • installerpin tests, including running installer-pins-dcv.sh against a local file:// origin.
  • shellcheck on the pinned DCV block.

To do (owner)

  1. Dispatch Installer pins (installer-pins.yml) on main once this is merged.
  2. Review the bot PR, or the fallback issue. Close and reopen the PR to run CI.

Checks

make check passes locally, apart from the path-with-a-space failures in lambda/dashboard-api. actionlint, semgrep and shellcheck are clean on the new files, and the new PowerShell parses cleanly with pwsh.

@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.85057% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/sporedinstall/installer_pins.go 97.95% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn marked this pull request as ready for review November 14, 2026 20:38
@scttfrdmn
scttfrdmn force-pushed the hardening/installer-pins branch from 7261c68 to da838dc Compare November 14, 2026 20:38
@scttfrdmn
scttfrdmn force-pushed the hardening/installer-pins branch from da838dc to c0ff933 Compare November 15, 2026 04:07
@scttfrdmn
scttfrdmn merged commit e887aaf into main Nov 15, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the hardening/installer-pins branch November 15, 2026 04:26
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.

Pin sha256s for the DCV tarball, AWS CLI MSI and SSM agent setup (follow-up to #1598)

1 participant