Authenticode-sign the Windows stable-diffusion.cpp prebuilts - #13
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc81df7c59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # The gate, run on the finished zip rather than the build tree: packaging | ||
| # copies files in after signing, so the zip is the only thing that proves | ||
| # what ships. | ||
| - name: Verify every PE in the bundle is signed |
There was a problem hiding this comment.
Skip verification when fork signing is skipped
On a fork without Azure secrets, the composite action deliberately returns signed=false and leaves the binaries unsigned, but this verification step still runs unconditionally and rejects that bundle. Consequently, every manually dispatched or scheduled fork build fails before artifact upload, contradicting the action's stated fork behavior; give the signing step an ID and condition this gate on its signed output (or otherwise exempt the unsigned-fork path).
Useful? React with 👍 / 👎.
Same fix as unslothai/whisper.cpp#27 for this repo: the Windows bundle we publish here is 100% unsigned, and Windows Smart App Control evaluates every binary as it loads.
What ships today
Measured on the published asset by parsing the PE certificate table directly:
master-813-bfbef5b-uea65600bin-win-cpu-x64sd-cli.exeandsd-server.exe, neither signed. VirusTotal returns 404 for both, so they are not flagged files, they are unknown files, which is what Smart App Control blocks. A block surfaces as a "Bad Image" dialog with status0xc0e90002naming whichever file was refused.This bundle is fetched by Unsloth Studio after its own signed installer has already run, so it sits outside that installer's Authenticode scope. Nothing else signs it. Its only current gate is the SHA-256 manifest, which proves integrity but establishes no trust.
What this does
.github/actions/sign-windows(composite): gates on the Azure credentials, installstrusted-signing-clipinned by SHA-256, verifies that the binary PATH resolves to is the digest-checked copy, then signs. Onunslothai/*a missing secret is a hard error, because a skip that looks like a pass is exactly how the Defender scan in Scan Windows bundles with MpCmdRun when the Defender cmdlets are down unsloth#8358 went missing for five releases. On a fork it is a warning, since a contributor cannot fix it..github/scripts/sign-windows-tree.ps1: signs every PE in the build tree in one batched Azure round trip, retrying only genuine auth flakiness, and leaving any file that already carries a valid signature alone..github/scripts/assert-windows-bundle-signed.ps1: the release gate, run against the finished zip rather than the build tree.package_bundle.pycopies files in after signing, so the zip is the only thing that proves what ships. Without this the signing regresses silently.Signing runs before
Package bundle; the gate runs after it and before the upload.Required before this can pass
Five repository secrets, the same set
unslothai/unsloth'srelease-desktop.ymlalready uses:TAURI_SIGNING_PRIVATE_KEYand theAPPLE_*set are not needed here.build-windowsdeclaresenvironment: release-signingso the job that can read them is named explicitly.Until those secrets exist,
build-windowswill fail at the gate step with a message saying which ones are missing. That is deliberate:assembleskips if any CPU leg fails, so nothing gets published half-signed.How to test
Then verify the artifact on a Windows box:
Both rows should read
Validwith signerUnsloth AI Inc.. Two files is a small tree, so this leg should cost well under a minute.Note on the license header
The scripts here carry this repository's MIT header rather than the AGPL header they have in unslothai/llama.cpp, matching
scripts/unsloth/package_bundle.py.