Skip to content

ci: sign Windows PowerShell scripts and consume signed VHD artifacts - #10206

Open
Tim Wright (timmy-wright) wants to merge 15 commits into
devfrom
aatim-sign-ps1
Open

Tim Wright (timmy-wright) wants to merge 15 commits into
devfrom
aatim-sign-ps1

Conversation

@timmy-wright

Copy link
Copy Markdown
Contributor

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.

  • Sign .ps1 and .psm1 files; publish the signed CSE ZIP and individual signed files.
  • Queue signing pipeline 491013 at the parent build's source commit, wait for success, and download artifacts directly from that exact run in each VHD build stage.
  • Replace all eight repository-owned Packer scripts with signed copies before building; fail on missing or empty copies.
  • Extract expand-volume.ps1 into a static file and copy it unchanged onto the VHD to preserve its signature.
  • Remove the obsolete local CSE ZIP creation script.

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.

Copilot AI balanced review requested due to automatic review settings November 27, 2026 02:29
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   21 suites   1m 1s ⏱️
819 tests 819 ✅ 0 💤 0 ❌
846 runs  846 ✅ 0 💤 0 ❌

Results for commit 8b16595.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread .pipelines/scripts/windows_build_vhd.sh Resolved
Copilot AI balanced review requested due to automatic review settings November 27, 2026 02:41
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
test 0% ❌
windows 27% ❌
parts_windows Package 1 74% ➖
staging_cse_windows Package 1 72% ➖
debug 0% ❌
provisioningscripts 2% ❌
Summary 40% (2077 / 7290) ❌

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 30% ❌
Summary 30% (5129 / 16919) ❌

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/Azure/agentbaker/aks-live-patching/pkg/status 100% ✔
github.com/Azure/agentbaker/apiserver 52% ❌
github.com/Azure/agentbaker/cmd 0% ❌
github.com/Azure/agentbaker/cmd/starter 0% ❌
github.com/Azure/agentbaker/fuzz/api 0% ❌
github.com/Azure/agentbaker/hotfix/render-nodecustomdata 35% ❌
github.com/Azure/agentbaker/pkg/agent 79% ➖
github.com/Azure/agentbaker/pkg/agent/datamodel 78% ➖
github.com/Azure/agentbaker/pkg/agent/toggles 0% ❌
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 87% ✔
github.com/Azure/agentbaker/aks-node-controller 73% ➖
github.com/Azure/agentbaker/aks-node-controller/common 100% ✔
github.com/Azure/agentbaker/aks-node-controller/helpers 68% ➖
github.com/Azure/agentbaker/aks-node-controller/parser 88% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/gpu 100% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/nodeconfigutils 91% ✔
github.com/Azure/agentbaker/aks-node-controller/utils 0% ❌
Summary 84% (6297 / 8227) ✔

This branch has not been deployed

No deployments
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.

2 participants