Add opt-in Windows Authenticode signing via Azure Trusted Signing (CE-424)#100
Open
c1-squire-dev[bot] wants to merge 1 commit into
Open
Add opt-in Windows Authenticode signing via Azure Trusted Signing (CE-424)#100c1-squire-dev[bot] wants to merge 1 commit into
c1-squire-dev[bot] wants to merge 1 commit into
Conversation
Windows .exe and .msi artifacts are currently only Sigstore-signed, which does not satisfy Windows SmartScreen — so downloaded connector executables (e.g. baton-active-directory) trigger SmartScreen warnings (CE-424). Add Authenticode signing to the goreleaser-windows job using Azure Trusted Signing (CE-178), gated behind a new windows_authenticode_signing input (default false) so existing releases are unaffected until the Azure account is provisioned. When enabled, the job: - logs in to Azure via GitHub Actions OIDC (no certificate material in secrets) - installs the Microsoft `sign` CLI - signs the raw .exe in a GoReleaser build post-hook, before it is packaged, so the binary in both the .zip and the .msi is signed - signs the .msi in place via a GoReleaser signs entry ordered ahead of the cosign signature, so the Sigstore bundle and all downstream hashes cover the Authenticode-signed bytes Signing logic lives in scripts/sign-windows-authenticode.ps1, which calls `sign code trusted-signing` and verifies the result. New optional inputs (trusted_signing_*) and secrets (AZURE_CLIENT_ID/TENANT_ID/SUBSCRIPTION_ID) are validated up front. README and release-workflow docs updated. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
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
Windows
.exeand.msiconnector artifacts are currently only Sigstore (cosign) signed. Sigstore proves supply-chain provenance but is not recognized by Windows SmartScreen, so downloaded connector executables (e.g.baton-active-directory) trigger a SmartScreen warning — CE-424.This PR adds Authenticode signing to the shared
goreleaser-windowsrelease job using Azure Trusted Signing, the approach already scoped in the repo's own docs as "Stage 2" and tracked in CE-178.Can it be supported? Yes.
The
goreleaser-windowsjob already runs on a nativewindows-latestrunner withid-token: write(OIDC) and produces the unsigned.exe/.msi. Azure Trusted Signing plugs in cleanly with no long-lived certificate material in secrets (auth is via GitHub OIDC), and gives immediate SmartScreen reputation (unlike OV certs, which must accrue download reputation).Design
The feature is opt-in via a new
windows_authenticode_signinginput (defaultfalse), so every connector keeps releasing unchanged until the Azure Trusted Signing account is provisioned (CE-178 is blocked on IT provisioning).When enabled, the
goreleaser-windowsjob:azure/login(OIDC).signCLI..exein a GoReleaser build post-hook — before it is packaged — so the binary inside both the.zipand the.msicarries the signature. This matters because the.exeextracted from the zip inherits Mark-of-the-Web and is what triggered the SmartScreen warning in the ticket..msiin place via a GoReleasersignsentry ordered ahead of the existing cosign signature, so the Sigstore.sig/.certand all downstream hashes/attestations/manifests cover the Authenticode-signed bytes.All signing is delegated to
scripts/sign-windows-authenticode.ps1, which runssign code trusted-signingand then verifies withGet-AuthenticodeSignature.The signing config is injected into the generated GoReleaser config using the same
envsubstblock pattern the repo already uses for Dockerextra_files, so the template stays valid YAML when signing is off (verified both ways).Changes
.github/workflows/release.yaml— new inputs (windows_authenticode_signing,trusted_signing_endpoint,trusted_signing_account_name,trusted_signing_certificate_profile), new optional secrets (AZURE_CLIENT_ID/AZURE_TENANT_ID/AZURE_SUBSCRIPTION_ID), up-front validation, Azure login +signinstall steps, and conditional signing-config injection.templates/.goreleaser-windows-template.yaml.tmpl— two injection points for the build hook and MSI signs entry.scripts/sign-windows-authenticode.ps1— new signing wrapper.cmd/generate-windows-manifest/main.go— updated stale Stage-2 comment.README.md,docs/release-workflow.md— caller usage, Azure setup, verification.Required to roll out (post-merge, once Azure is provisioned)
AZURE_*secrets, setwindows_authenticode_signing: trueand thetrusted_signing_*inputs in the connector's release workflow.Testing
release.yamlvalidated as YAML; Windows GoReleaser template rendered in both enabled/disabled modes and parsed — disabled adds nohooks, enabled ordersauthenticode-msibeforecosign-msi.go build ./cmd/generate-windows-manifestpasses.baton-github-test/baton-runner) perdocs/release-workflow.md, including pinning thesigntool version and confirmingGet-AuthenticodeSignaturereportsValid.🤖 Generated with Claude Code
🏰 Squire environment: wise-narwhal-72864
Task: 092dff13-086e-4539-b9a2-628381b0e134