Repository navigation
installers: pin sha256s for the Windows AWS CLI MSI, SSM agent and DCV, refreshed by a workflow (#1620) - #1635
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
scttfrdmn
marked this pull request as ready for review
November 14, 2026 20:38
scttfrdmn
force-pushed
the
hardening/installer-pins
branch
from
November 14, 2026 20:38
7261c68 to
da838dc
Compare
…V, refreshed by a workflow (#1620)
scttfrdmn
force-pushed
the
hardening/installer-pins
branch
from
November 15, 2026 04:07
da838dc to
c0ff933
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ymlIt runs weekly and on
workflow_dispatch, with an optionalforceinput. The top-level permissions are{}.windowscontents: readscripts/installer-pins-windows.ps1. DownloadsAWSCLIV2-<Linux awsCLIVersion>.msi, plus the newestaws/amazon-ssm-agenttag'sSSMAgent/<v>/windows_amd64/AmazonSSMAgentSetup.exe, fromamazon-ssm-us-east-1, cross-checked byte-for-byte against theec2-downloads-windowscopy. Hashes a file only afterGet-AuthenticodeSignaturereports it Valid with an Amazon signer. The check is a verbatim copy ofWindowsAmazonSignedFunc, held to the original by a test.dcvcontents: readscripts/installer-pins-dcv.sh. DownloadsNICE-GPG-KEYand bothdcvVersiontarballs, and requires every RPM to passrpmkeys -Kagainst 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 ifdcvVersionis already pinned.prscripts/installerpin set, regeneratesscripts/install-spored.ps1, runs the pin tests, then opens the PR. If GitHub refuses the PR, it opens a fallback issue gated bypr-refused, the same pattern asawscli-pin.ymlandefa-pin.yml. A changed DCV key is called out in the PR body.The bootstrap
cmd/launch_config.go, and the generatedinstall-spored.ps1): the scripts gain anAssert-SpawnSHA256check. Once a pin is set:Assert-SpawnAmazonSignedandAssert-SpawnSHA256must both pass. There is no fallback to the unversioned latest.amazon-ssm-<region>and thenamazon-ssm-us-east-1, using regional S3 names only (bootstrap: fetch spored from the regional S3 name so an S3 interface endpoint serves a private-only instance #1436), with both checks.cmd/app.go): once pinned, the boot downloads the key to a file and requires its sorted primary fingerprints to equal the pin beforerpm --import. It also requires the machine's tarball sha256 before extracting.rpm -Kandlocalpkg_gpgcheckstill run after that. An unknown architecture installs nothing.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 matchdcvVersion. BumpingdcvVersionwithout 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.TestPinnedWindowsDownloadsCheckTheSHA256andTestAssertSpawnSHA256: 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.installerpintests, including runninginstaller-pins-dcv.shagainst a localfile://origin.To do (owner)
installer-pins.yml) on main once this is merged.Checks
make checkpasses locally, apart from the path-with-a-space failures inlambda/dashboard-api. actionlint, semgrep and shellcheck are clean on the new files, and the new PowerShell parses cleanly with pwsh.