Repository navigation
ci: sign Windows PowerShell scripts and consume signed VHD artifacts - #10206
Tim Wright (timmy-wright) wants to merge 15 commits into
Conversation
Windows Unit Test Results 3 files 21 suites 1m 1s ⏱️ Results for commit 8b16595. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
🟡 Changes recommended
All seven PowerShell provisioners use uploads that convert CRLF to LF, invalidating script signatures; each needs binary uploads enabled and regression coverage.
1 open issue
What changed in this PR
Adds PowerShell signing to AgentBaker’s Windows VHD build flow, with builds consuming artifacts from a signing run tied to the same source commit.
Changes:
- Adds a OneBranch pipeline that signs scripts and modules, then publishes individual files and the Windows CSE ZIP.
- Queues and waits for signing, downloads artifacts from that exact run, and rejects missing or empty Packer script copies.
- Extracts the volume-expansion startup script for signature-preserving copying and adds regression coverage.
The pipeline currently uses test certificates; end-to-end signing and VHD validation remain pending.
| File | Description |
|---|---|
vhdbuilder/packer/windows/windows-vhd-builder-sig.json |
Uploads the static volume-expansion script. |
vhdbuilder/packer/windows/expand-volume.ps1 |
Extracts the existing startup volume-expansion commands. |
vhdbuilder/packer/windows/configure-windows-vhd.tests.ps1 |
Tests unchanged copying and missing-source failure. |
vhdbuilder/packer/windows/configure-windows-vhd.ps1 |
Copies the signed startup script instead of generating it. |
vhdbuilder/packer/README.md |
Documents signed artifacts and local-build requirements. |
spec/vhdbuilder/packer/windows_build_vhd_spec.sh |
Tests signed-file staging, byte preservation, and failure cases. |
.pipelines/templates/.builder-release-template-windows.yaml |
Downloads signed artifacts from the selected signing run. |
.pipelines/templates/.build-and-test-windows-vhds-template.yaml |
Queues signing at the parent commit and waits for success. |
.pipelines/templates/.build-and-test-windows-vhd-template.yaml |
Passes the signing run ID into each VHD build job. |
.pipelines/scripts/windows_package_cse.sh |
Removes the obsolete local ZIP creation script. |
.pipelines/scripts/windows_build_vhd.sh |
Replaces checkout scripts with required signed copies. |
.pipelines/powershell-script-signing.yaml |
Defines signing, CSE packaging, and artifact publication. |
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The mandatory Windows signing dependency requires external end-to-end validation of pipeline 491013 permissions, OneBranch artifact contracts, and signed-script execution on supported Windows VHDs, which cannot be confirmed from the repository.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
|

What this PR does / why we need it:
Adds a OneBranch signing pipeline for Windows PowerShell scripts and modules, and makes Windows VHD builds consume its signed output instead of unsigned checkout files.
.ps1and.psm1files; publish the signed CSE ZIP and individual signed files.expand-volume.ps1into a static file and copy it unchanged onto the VHD to preserve its signature.Validation:
10 focused ShellSpec tests and two Pester regression tests passed. YAML/JSON parsing, PowerShell syntax, signing coverage, artifact-path contracts, and unchanged startup-script commands were checked. ShellCheck diagnostics match the existing baseline.
Notes:
The pipeline currently uses OneBranch NonOfficial test certificates, not production-trusted certificates. End-to-end signing and VHD build verification remains pending. The parent build identity needs permission to queue pipeline 491013 and download its artifacts. Package-provided WCN scripts are unchanged.
Which issue(s) this PR fixes:
None linked.