feat: add Windows 11 support via built-in sudo#7
Open
Conversation
Add Windows as a third supported platform alongside Linux and macOS. Uses the Windows 11 24H2+ built-in sudo command with UAC elevation for privilege escalation. - WindowsSudoExecutor: executes commands via sudo cmd /c - Windows blocklist patterns: format, diskpart, bcdedit, registry system hive edits, PowerShell Remove-Item -Recurse -Force, cipher - DI registration with OperatingSystem.IsWindows() branch - PowerShell install/uninstall scripts - CI: Windows added to unit test matrix + build job - CD: Windows x64 build + zip release artifact - Documentation updated throughout
Owner
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Reviewed: WindowsSudoExecutor implementation, Windows blocklist patterns (format, diskpart, bcdedit, registry, PowerShell, cipher), DI registration, CI/CD pipeline changes, install/uninstall scripts, and documentation updates. Audited against CLAUDE.md rules (British spellings, XML comments, security considerations, code style), git history for regressions, prior PR feedback, and code comment compliance. Notable observations that fell below the reporting threshold:
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Extends the build-windows job to create a zip artifact, then adds a test-install-windows job that extracts the zip, runs install.ps1, and verifies the installed binary is on PATH and responds to --help.
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.
Summary
sudocommand with UAC elevationWindowsSudoExecutorimplementsIPrivilegedExecutor, executing commands viasudo cmd /c <command>format,diskpart,bcdedit, registry system hive edits (reg add/delete HKLM\SYSTEM|SOFTWARE|SAM|SECURITY), PowerShellRemove-Item -Recurse -Force, andcipherscripts/install.ps1,scripts/uninstall.ps1)build-windows-binaryjob + zip release artifact (sudo-mcp-win-x64-vVERSION.zip)Details
Executor
WindowsSudoExecutorfollows the same pattern asPkexecExecutor(Linux) andSudoExecutor(macOS). It spawnssudo cmd /c <command>and handles Windows-specific error messages (sudo not found, access denied, UAC cancelled). Requires Windows 11 24H2+ with sudo enabled in Developer Settings.Blocklist
Four new
[GeneratedRegex]patterns with 1-second ReDoS timeout:FormatDrive—format C:and variantsBcdeditAny— anybcdeditsubcommandRegSystemHive—reg add/delete/importtargetingHKLM\SYSTEM|SOFTWARE|SAM|SECURITYPowerShellRecursiveDelete—powershell/pwsh Remove-Item -Recurse -Force(flags in any order via lookaheads)Six new blocked binaries:
diskpart(.exe),bcdedit(.exe),cipher(.exe)CI/CD
SudoMcp.exevsSudoMcp).zip(not.tar.gz) since that's standard on WindowsTest plan
windows-latest🤖 Generated with Claude Code