Add Azure Artifact Signing as a Windows signer mode - #227
Merged
Conversation
Roughly $10/month against several hundred a year for a CA certificate, with no hardware token and no annual re-issue. signtool loads Azure.CodeSigning.Dlib.dll, which authenticates to Azure and has the signature produced server-side, so no private key is ever on the build machine -- a compromised build host can request signatures while its access lasts but cannot take the key. Two behaviours are handled rather than left to be discovered: Artifact Signing certificates are valid for three days. A signature outlives them only because a timestamp proves it was made while the certificate was live, so the signer always timestamps against Microsoft's authority. Skip it and the installer verifies for three days and then begins failing on customer machines with nothing about the file having changed. DefaultAzureCredential walks a chain of credential sources, one of which opens a browser -- on a headless build that hangs rather than fails. With a service principal in the environment the signer narrows the chain to it; with federated identity it keeps the chain but excludes the browser. The two common Azure failures both surface from signtool as a generic SignerSign() error, so each gets a hint: a 403 is almost always a region mismatch or a missing signer role assignment, and a dlib load failure is almost always a missing .NET 8 runtime or an x64/x86 mismatch. The release workflow's preflight now detects the mode with the same precedence as the signer's own auto-detect, so the two cannot disagree, and installs the client tools on the runner. The release gate reports the mode without requiring AZURE_SIGNING_DLIB, which is a path on the Windows machine that signed and cannot exist on the Linux host running the gate. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here. |
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
Adds
TRANSTRACK_SIGN_MODE=azure— Azure Artifact Signing, Microsoft's cloud signing service. Roughly $10/month against several hundred a year for a CA certificate, with no certificate to buy, no hardware token, and no annual re-issue.signtoolloadsAzure.CodeSigning.Dlib.dll, which authenticates to Azure and has the signature produced server-side. No private key is ever on the build machine, which bounds what an attacker gains by compromising one: they can request signatures while their access lasts, but they cannot take the key.Two behaviours are handled in the signer rather than left to be discovered in production:
DefaultAzureCredentialwalks a chain that includes a browser prompt, which hangs a headless build rather than failing it. With a service principal in the environment the signer narrows the chain to that one credential; with federated identity (GitHub OIDC, managed identity) it keeps the chain but excludes the browser.The two common Azure failures both surface from
signtoolas a genericSignerSign()error, which says nothing about which of several settings is wrong. Each now gets a hint: a 403 is almost always a region mismatch betweenAZURE_SIGNING_ENDPOINTand the account, or a missing Certificate Profile Signer role; a dlib load failure is almost always a missing .NET 8 runtime or an x64/x86 mismatch betweensigntooland the dlib.The release workflow's
preflightjob detects the mode using the same precedence as the signer's own auto-detect, so the two cannot disagree about which mode is in play, and installs the client tools on the runner. The release gate reportsazuremode without requiringAZURE_SIGNING_DLIB— that is a path on the Windows machine that signed, and the gate runs on Linux, where requiring it would fail a correctly configured release.Test plan
npm test— 50/50 suites;signWin.test.cjsnow 31 casesnpm run lintclean,release.ymlparsesnode scripts/check-compliance-docs.mjs— 83 requirements, 83 matrix rows, 73 OQ cases, 28 risksazure mode (Artifact Signing)with only the three non-path variables set, confirming it does not demand a Windows path on LinuxGITHUB_RUN_ID, and the timestamp authorityFollow-up for the account owner
Before enrolling, check one thing: Artifact Signing requires the organisation to have been verifiable for three years or more. Newer organisations can enrol but the certificate shows an unverified identity. If that blocks you,
ssl_esignerwith an OV certificate remains the fallback and is unchanged.Setup is four steps, written out in
docs/CODE_SIGNING.md: create the account and a Public Trust certificate profile, create a service principal with the Certificate Profile Signer role, install the client tools, set six secrets.