Repository navigation
Sign Windows installer with GitHub OIDC instead of IAM user keys - #197
Merged
Merged
Conversation
STS rejects the IAM user access key the signing steps use ("The
security token included in the request is invalid"), so signed
installers can't be built. The signer's artifact access role now trusts
GitHub's OIDC provider for workflows on develop.
- Grant id-token: write (and contents: read) to build-windows32 and
build-windows64, the jobs that sign.
- Switch the signing credential steps to configure-aws-credentials
v6.3.1, pinned by SHA, with role-to-assume only. Drop the access key,
secret key, ExternalId and session-tagging inputs, which do not apply
to AssumeRoleWithWebIdentity.
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.
Summary
Sign the Windows installer with GitHub Actions OIDC instead of long-lived IAM user access keys.
Description
The signing steps in
win-build.ymlassume the signer's artifact access role with a stored IAM user access key. STS now rejects that key ("The security token included in the request is invalid", see run 45716520159), so signed installers can't be built. The signer role now trusts GitHub's OIDC provider for this repository'sdevelopbranch (sub = repo:aws/amazon-documentdb-odbc-driver:ref:refs/heads/develop,aud = sts.amazonaws.com).Changes, all in
.github/workflows/win-build.yml:build-windows32andbuild-windows64getpermissions: { contents: read, id-token: write }, so the jobs can request an OIDC token. The repository's default token is already read-only, so the only permission dropped ispackages: read, which these jobs don't use.configure-aws-credentials@v1to v6.3.1, pinned by commit SHA. They pass onlyaws-region,role-to-assumeandrole-duration-seconds. The access key, secret key, ExternalId and session-tagging inputs are removed because they don't apply toAssumeRoleWithWebIdentity.Signing still runs only on
workflow_dispatchwithsign: true, through the existingif: env.SIGNING_ENABLED == 'true'guards. A dispatch from any branch other thandevelopfails at the credentials step, because the role only trustsdevelop. That is intended.Relationship to #196. #196 removes the unconditional
configure-aws-credentialsstep at the top ofbuild-windows64(b3ae684) and bumps the retired artifact actions. This PR doesn't touch that step. It branches fromdevelopand merges cleanly with #196 in either order; I checked both withgit merge-tree. After both merge, the onlyconfigure-aws-credentialssteps left are the two guarded signing steps. A signed build needs both PRs, because the retiredupload-artifact@v3steps fail the job.Testing. actionlint shows no new findings. The total drops from 25 to 23 because two
@v1steps are gone; the rest are pre-existing "action too old" warnings. The signed path can only be exercised after merge, because the role trustsdeveloponly.CI on this PR. All the failing or stuck checks come from problems that already exist on
develop. None of them come from this change, and none are required checks (developrequires 1 approval and no status checks).build-windows32,build-windows64,build-windows64_coverageandbuild-power-bi-connectorfail at Set up job with "uses a deprecated version ofactions/upload-artifact: v3".developstill references the retired v3; Update retired GitHub artifact actions in win-build workflow #196 bumps it.scripts/reinstall_mongodb.ps1runscreateUserwith an emptyDOC_DB_PASSWORD, and MongoDB answersError preflighting UTF-8 conversion: U_STRING_NOT_TERMINATED_WARNING.TestConnectionRestore{Internal,External}SSHTunnelandTestDocumentDbConnectionGetSshTunnelPort*, which can't reach the SSH host (java.net.ConnectException: Connection timed out). See run 45716520159.build-linux64-debug,build-linux-docker-imageandbuild-mac-debugstay queued becauselinux-build.ymlusesubuntu-20.04and the mac workflows usemacos-11. GitHub retired both runner images, so no runner ever picks these jobs up.None of this blocks signing. In
build-windows32andbuild-windows64, "Configure AWS credentials", "Sign Executables" and the artifact uploads (whensign: true) all run beforeregister-driver,Setup MongoDBandrun-tests.After merge
ODBC Driver for Windowsfromdevelopwithsign: true, and check that both signing steps upload, get a job ID, and download the signed installers.AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEYandAWS_ROLE_EXTERNAL_ID. KeepAWS_ROLE_TO_ASSUME,AWS_KEY,AWS_UNSIGNED_BUCKETandAWS_SIGNED_BUCKET.Related Issue
#196. Companion: aws/amazon-documentdb-jdbc-driver#578 (Tableau connector signing over OIDC).
Additional Reviewers
@manojnks
@alexey-temnikov
@birschick-bq