Add win-fix-code-integrity - #151
Conversation
Finds the driver that Code Integrity is blocking and disables that driver, instead of turning off the protection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cf64bab1-6099-4e7e-aef4-57ffea10ce6b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cf64bab1-6099-4e7e-aef4-57ffea10ce6b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cf64bab1-6099-4e7e-aef4-57ffea10ce6b
Automated review using the supplied PR Review AgentReviewed head: ff8230f837d10eda1dc398f8c32ef32f2b2c7c03 This is the supplied agent's static analysis, not a maintainer decision or a fresh repair/boot test. Findings have not been independently reproduced. No source or Azure resources were changed during review. The original report is retained locally; only leading process narration and local prompt-path provenance were normalized for posting. Finding text is unchanged. Full automated review reportPR Review: #151 — Add win-fix-code-integrityGenerated: 2026-09-10 Reviewed from the pinned packet snapshots only. Changed files: FindingsCritical
Init sourcing ( Warning
Info
Operational Risk Assessment
Overall Risk: Medium 🟡 ValidationAssessed by reading the pinned head snapshot; results agree with the launcher's deterministic checks.
Recommendationrequest changes The design is sound and unusually disciplined — evidence-gated repair, protections left enabled by default, boot-critical and platform drivers reported rather than disabled, verification re-read from fresh state at 724 rather than trusting the writes. Nothing here blocks merge on the Critical criteria. But eight warnings stand, three of them substantive and mechanical to fix: the missing This is an automated review against the pinned snapshots, not a human maintainer approval. Severity assignments follow the supplied prompt's criteria; findings where the consequence could not be established from the source are marked as such. Provenance
|
Addresses the PR151 review findings.
- Trust comes from Test-OfflineFileSignature, so a valid Microsoft
Authenticode signature protects a driver whose CompanyName is blank. The
CompanyName claim is still honoured on top of it, so nothing previously
excluded becomes eligible.
- A named image that is missing, empty, unreadable or not parseable is a
manual lead, not an automatic Start=4.
- Get-KernelDriverInventory throws when the Services key or a service key
cannot be read, instead of returning a clean, empty inventory.
- Get-ProtectionState reads every value through Get-OfflineRegistryDword,
so a denied read or a wrong value type throws rather than being reported
as "protection off". An absent value still means unconfigured.
- A refusal older than 30 days, or one with no readable timestamp, is
reported for a decision and never authorises a write.
- The main flow follows the helper caller contract: a labelled single-pass
loop, a top-level finally that releases discovery-owned drive letters and
flushes the buffered helper log, and the status returned after cleanup.
- The opt-in branch backs up SOFTWARE as well as SYSTEM before mounting.
- An empty log is classified by the NoMatchingEventsFound error identity
instead of an English message.
- The header no longer claims a BCD backup or Secure Boot/testsigning
repairs the script does not perform, and map.json records the recency and
checkability limits on automatic repair.
Validated with the local mocked harness (41 checks, no registry, disk or hive
access) and the log-ordering audit. The Azure create/run/restore acceptance
cycle was performed previously against the pre-review script.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Review findings implementedPublication head: f46f475b1dd4a4ce19d9c7fe00ae9de95fcb553b The earlier automated report remains a static review of
Testing scope, stated plainly — this is W9's honest answer: the changes above were Original review provenance
|
What this adds
win-fix-code-integrity- one scenario script and its ownmap.jsonentry.Finds the driver that Code Integrity is blocking and disables that driver, instead of turning off the protection.
The catalog entry a support engineer reads when choosing it:
How it works
Runs against the broken OS disk attached to a rescue VM by "az vm repair create". It answers the question "which driver is stopping this VM from booting" using evidence taken from the offline disk, and disables only the driver that evidence names. Memory Integrity, Credential Guard and VBS stay enabled.
The rule this script is built around: a protection being enabled is not a fault. Millions of VMs run Memory Integrity and Credential Guard without trouble, so "HVCI is on" is never reported as a problem and never triggers a change. Something is only repaired when there is positive evidence that it is what broke this particular VM.
Parameters
detectOnlydisableProtectionwindowsDriveConventions followed
.\src\windows\common\setup\init.ps1and returns$STATUS_SUCCESSor$STATUS_ERROR.Write-Host.az vm run-commandkeeps only the last 4096 characters of the output stream, so a summary printed first is the first thing a long run loses.Testing
Historical product-path acceptance: the recorded
az vm repair run --run-on-repair --previewbatch covered a healthy zero-write baseline, a blocked driver named from the offline CI log,
repair, independent verification, an idempotent rerun, and a successful boot after
az vm repair restore. Memory Integrity and Credential Guard stayed enabled. Later Gen2Secure Boot/vTPM experiments established that boot-manager overrides are context, not a
proven no-boot fault; the script reflects that correction.
September 10 integration: writing callers now use strict control-set selection from #146.
The shared registry suite passed 140/140 on PS5.1 and PS7; 33 native synthetic-hive assertions
covered selector validation, cross-scope lifecycle and a write persisted only to ControlSet002.
Those are helper/integration results, not a new full per-generation scenario acceptance run.
Series
First wave of four independent scenario PRs. The shared helpers in #143, #146 and #147 are
already merged. This PR adds no helper files and changes no existing scenario; its only existing
file change is appending this run-id to
map.json, preserving every upstream entry.