Skip to content

ci(release): Authenticode-sign Windows release binaries via Azure Artifact Signing - #234

Merged
zackees merged 1 commit into
mainfrom
ci/azure-signing
Nov 2, 2026
Merged

zackees merged 1 commit into
mainfrom
ci/azure-signing

Conversation

@zackees

@zackees zackees commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Adds Azure Artifact Signing (Authenticode) to release.yml, same approach as forge-ci/zccache#2048 and forge-ci/bosn#807.

What gets signed: reld.exe, reld-link.exe and llvm_ld.dll in the build-cross windows-x64 (x86_64-pc-windows-msvc) and windows-arm64 (aarch64-pc-windows-msvc) lanes. Signing runs after ci/fetch_llvm_ld.py has checked the DLL against its lock and before ci/package_release.py, so the zip, SHA256SUMS and manifest.json all describe the signed bytes.

How:

  • The new ci/sign_windows_release.py uses jsign 7.6, pinned by SHA-256, with TRUSTEDSIGNING, SHA-256 and an RFC 3161 timestamp from timestamp.acs.microsoft.com. The token comes from az account get-access-token --resource https://codesigning.azure.net, is masked, and reaches jsign as --storepass env:RELD_AZURE_SIGNING_TOKEN.
  • Login uses azure/login@a457da9e… (v2.3.0) over OIDC, with allow-no-subscriptions: true.
  • After signing, a structural check of each PE fails the step if any one lacks a PKCS#7 WIN_CERTIFICATE, the publisher CN or an RFC 3161 timestamp.
  • smoke-windows now requires Get-AuthenticodeSignature to report Valid for every .exe and .dll in the archive that publish ships.
  • build-cross gets job-level contents: read and id-token: write.
  • ci.toml allowlists azure/login, the six org secrets, and id-token: write for build-cross.

Behaviour change: preflight emits sign=false only for pull_request runs, because their OIDC subject is not trusted. Tag pushes and dispatches from main sign. A dispatch from any other branch fails closed instead of producing unsigned binaries. So this PR's own release.yml run checks the unsigned pipeline only. The signing path is first exercised on the next tag or dispatch from main.

Tests: cases added to ci/tests/test_ci_workflow.py (no new test file): the signature checker, the multi-directory fail-closed check, the pinned jsign argv, and step ordering in release.yml. pytest ci/tests gives 392 passed, and actionlint is clean.

ci-lint precheck (pinned 92106df, with PyYAML): it goes from 414 to 416 violations. The two new ones come with the request itself: SEC-002 allows id-token only on an OIDC publisher job, and GATE-012 flags an id-token job that runs on PRs. The precheck is not a merge gate today.

…ifact Signing

Sign reld.exe, reld-link.exe and llvm_ld.dll in the windows-x64 and
windows-arm64 build-cross lanes with a SHA-256-pinned jsign 7.6 jar
against Azure Artifact Signing (OIDC azure/login, token via env), after
the llvm-ld lock check and before packaging, so the archive, SHA256SUMS
and manifest.json describe signed bytes. A structural post-sign check
fails closed on any unsigned PE, and smoke-windows requires
Get-AuthenticodeSignature Valid for every PE in the shipped archive.
pull_request runs (untrusted OIDC subject) skip signing.
@zackees
zackees added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit bc98d76 Nov 2, 2026
26 checks passed
@zackees
zackees deleted the ci/azure-signing branch November 5, 2026 05:51
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.

1 participant