Add win-fix-firewall-service - #149
Edwin Bernal Microsoft (EdwinBernal1) merged 6 commits into
Conversation
Repairs the Windows Defender Firewall service on an offline disk, so a VM that boots but drops every inbound connection - RDP included - can be reached again.
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: 3dc0afab305e7b254ec24c3048678ff3de0845f4 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: #149 — Add win-fix-firewall-serviceGenerated: 2026-09-10 Changed files reviewed (pinned snapshots only): FindingsCriticalNone found. Warning
Info
Operational Risk Assessment
Overall Risk: Medium 🟡 Validation
Checks marked "packet"/"launcher" above were executed by the review launcher, not by me. Everything else in this report is assessed from the pinned head and base source. Recommendationrequest changes The design is sound and unusually well evidenced, the offline-target gating and privileged-read approach are correct, and the healthy-machine zero-write property holds for every case except the one identified. Three items should be resolved before merge: the REG_SZ deletion trigger must not fire on a firewall start failure that a This is an automated review produced by the |
…ller contract
Addresses the PR149 review findings.
- A correctly typed REG_SZ DebugedLoopbackApps value is now always
preserved. Only a value of the wrong registry type is repairable. The
offline System log is read for context and can never authorise a
deletion, which removes the failure mode where an old crash record
deleted a value that was healthy at the time of the run.
- NoMatchingEventsFound is told apart from a genuine read failure by
error identity, so an unreadable log is reported as unreadable instead
of as "no crashes found".
- 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.
- Offline paths use Join-OfflinePath/Test-OfflinePath so a stale drive
letter cannot throw.
- The header, the closing guidance and the map.json description describe
what the script actually does, including that the SYSTEM hive .bak file
survives "az vm repair restore".
Validated with the local mocked harness (45 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: dbe0846a95a27bf49683b058e23798abdd8b34af The earlier automated report remains a static review of
Testing scope, stated plainly: these changes were validated with the local mocked harness Original review provenance
|
Edwin Bernal Microsoft (EdwinBernal1)
left a comment
There was a problem hiding this comment.
Reviewed the current head after the prior findings were addressed. Automatic repair is now limited to a wrong-type DebugedLoopbackApps value and explicitly disabled MpsSvc/BFE services; correctly typed REG_SZ content is preserved. The script backs up the hive before writes, revalidates the active control set, verifies the resulting state, and fails on incomplete cleanup. The catalog entry is consistent. I found no new blocking issue.
Residual validation gap: only the CLA check is reported by GitHub. This review did not independently rerun the live Server 2022 firewall-service scenarios described in the PR.
VMRepair Script Test Report: win-fix-firewall-service.ps1Tip ✅ APPROVE — Overall Score 94/100 (Grade A)All script-level gates PASS. Fault repaired end-to-end on both offline OS disks; every convention audit item satisfied; SummaryOverall Score: 94/100 (Grade: A) — APPROVE
Fault Injection Results
Testing PerformedStrategy: Fault injection with break → offline-repair → verify cycle (rescue VM + peer-VNet oracle)
Convention Audit (all PASS)
Opportunities for Improvement6 points recoverable (current 94 → potential 100)
Non-blocking Observations (docs / cosmetic)
Validation EvidenceBefore (Scenario A · WS2022 build 20348 · post-injection): After (Scenario A · offline repair applied · WS2022 hive re-verified): After (Scenario B · WS2019 · disk-swap-back + boot): Review Checklist
Test Artifacts
Recommendation: merge. Nothing in this PR blocks release; the observations above are all optional / cosmetic. Generated by VMRepairMint Script Testing sub-agent | Head SHA validated: |
6edc1bd
into
Azure:main
What this adds
win-fix-firewall-service- one scenario script and its ownmap.jsonentry.Repairs the Windows Defender Firewall service on an offline disk, so a VM that boots but drops every inbound connection - RDP included - can be reached again.
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".
This is the VM that looks alive and answers nothing. It boots, the guest agent reports Ready, Remote Desktop Services is running and 3389 is listening - and from another machine on the same virtual network every port is a timeout, ICMP included. The listener is fine. Nothing reaches it, because the Windows Defender Firewall service is not running and the boot-time filters that Windows installs before it starts are still in force, blocking everything.
Parameters
detectOnlywindowsDriveConventions 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 (September 1): four
az vm repair run --run-on-repair --previewcycles exercised the wrong registry type anddisabled MpsSvc/BFE cases, broken-disk detect-only behavior, healthy detect/repair zero-write
runs, and restored-VM verification (7/7 checks). In-VNet TCP probes measured RDP reachable
before the break, unreachable while the firewall service failed, and reachable after repair.
Other blocked ports stayed blocked: the firewall was repaired, not switched off.
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, access failures and lifecycle cleanup. These do not replace or
claim a fresh full Gen1/Gen2 scenario acceptance matrix.
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.