Repository navigation
test: add offline eMudhra host trust checks - #9879
Open
Artur Khantimirov (r2k1) wants to merge 1 commit into
Open
Artur Khantimirov (r2k1) wants to merge 1 commit into
Artur Khantimirov (r2k1) wants to merge 1 commit into
Conversation
Check Linux CA bundles and Windows installed/cached roots before accepting a VHD. Require a positive control and fail on the two signing roots or unreadable trust data. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 685d2bf4-2f4b-4b28-8841-a476cf1672ef
Contributor
Windows Unit Test Results 3 files 18 suites 1m 8s ⏱️ Results for commit 809061d. |
Contributor
Contributor
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Live Windows PowerShell 5.1 and remote VHD validation remain pending for mandatory checks that can block image release jobs.
No open issues 🎉
What changed in this PR
Adds offline eMudhra host trust checks to AgentBaker’s Linux and Windows VHD content tests, without changing trust stores or node provisioning.
Changes:
- Rejects emSign ECC Root CA - G3 and AAA Certificate Services roots, using DigiCert Global Root G2 as a read-control.
- Adds ShellSpec and Pester coverage for root detection, missing trust data, and read failures.
- Documents the conservative root-removal policy and its host-only scope.
| File | Description |
|---|---|
vhdbuilder/packer/test/windows-vhd-content-test.tests.ps1 |
Tests installed and cached root checks with mocked Windows stores. |
vhdbuilder/packer/test/windows-vhd-content-test.ps1 |
Gates content tests on installed roots and the cached AuthRoot list. |
vhdbuilder/packer/test/linux-vhd-content-test.sh |
Checks CA bundles before test setup can upgrade packages. |
vhdbuilder/packer/README.md |
Explains the policy, scope, and limitations. |
spec/vhdbuilder/packer/test/linux_vhd_content_test_helpers_spec.sh |
Tests Linux root detection and missing or unreadable bundles. |
Review effort: Balanced
This branch has not been deployed
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.
What this PR does / why we need it:
Summary
Add offline host-OS checks for the eMudhra incident to the existing Linux and Windows VHD content tests.
Host OS only: no component or container checks, downloads, certificate fixtures, native helper, or trust-store changes. The patch adds 104 lines, including 36 lines in the pipeline test scripts.
Evidence
shellspec --shell bash spec/vhdbuilder/packer/test/linux_vhd_content_test_helpers_spec.sh spec/vhdbuilder/packer/test/run_test_spec.sh— passed, 41 examples.pwsh -NoLogo -NoProfile -Command 'function global:curl.exe { "127.0.0.1" }; Import-Module Pester -RequiredVersion 5.7.1; $c = New-PesterConfiguration; $c.Run.Path = "./vhdbuilder/packer/test/windows-vhd-content-test.tests.ps1"; $c.Run.Exit = $true; Invoke-Pester -Configuration $c'— passed, 15 tests, using mocked Windows stores on macOS.git diff --check— passed. No new POSIX findings compared with the parent.809061d99a6bc916c0df0a1253e7a784dae5053f.Test, Scan, and Cleanuptasks, and the E2E stage succeeded. Ubuntu 22.04 log 600 confirms Run Command used the PR merge SHA4e67bb482539a31e2431303aa807219781eaa042and completed the content tests after the mandatory root guard. The earlier Ubuntu 22.04 build retry recovered.TestLivePatchingUsesVHDInsteadOfCustomDatasize assertion:87404is not less than87380. The focused commandgo test ./pkg/agent -run '^TestLivePatchingUsesVHDInsteadOfCustomData$' -count=1also failed locally, at87988. The PR leavespkg,parts,go.mod, andgo.sumunchanged from parentf3163c3013e53591c930cb64bbcafc2c6b390b9b, where this failure was previously reproduced. No assertion was weakened.2022-containerd,2025-gen2,2025-gen2-tl) failed inRun VHD cache test; logs 69, 86, and 93 show the same error. The new helper stopped becauseEncodedCtldoes not exist underHKLM:\SOFTWARE\Microsoft\SystemCertificates\AuthRoot\AutoUpdate. This exposes an unavailable-data assumption in the check; none reached a certificate-trust verdict. This is not evidence of compromise. Other Windows variants and all Windows E2E stages were skipped. The check remains fail-closed.Merge Danger
Door: two-way; revert the added test assertions.
Blast Radius: CI.
This is a conservative root-removal policy, not full chain verification. It can block VHD jobs even when intermediate blocklists, revocation, or another mechanism already protects the OS. It deliberately covers both signing-root paths, including AAA. It does not change node provisioning or OS trust stores.
Which issue(s) this PR fixes:
N/A. Related advisory: GO-2026-6809.