summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-08-13 23:20:20 +0900
committertanaka takashi <isazaka@gmail.com>2026-08-13 23:20:20 +0900
commite07183ee6d3e57da325213e898cdcd6687320f53 (patch)
treea05a71ec3ed419d54f450a0105ec22973c66a66b /scripts
parent9337ac3e5edd42bb17f5e2ade6c2de02c7ef576d (diff)
test(security): close on-demand elevation acceptance gaps
Add an actual-process acceptance harness for the administrative Named Pipe boundary. Exercise production pipe creation and peer PID inspection, remote-form client rejection, Task and protocol identity mismatch, duplicate network application, oversized frames, and an intentional helper-crash recovery point without adding test-only operations to the privileged protocol. Add a reusable PowerShell attack-matrix runner that preserves the helper parent-image check and drives the self-contained published helper through real UAC. Refactor the client pipe setup into internal diagnostic hooks while leaving the production DACL, PIPE_REJECT_REMOTE_CLIENTS, PID comparison, and helper lifetime behavior unchanged. Record the completed UAC rejection, HTTP MCP server-continuity, helper crash, startup Recovery rejection/success, loopback restoration, WFP residue, and regression evidence. Promote the three on-demand elevation traceability rows from PARTIAL to PASS and capture the 80-test Windows Security/Recovery result and final Bundle checksum. Verified: Release build warning/error 0; Core 105 PASS; Planner 10 PASS; administrative boundary 4 PASS; Windows Security/Recovery 80 PASS with skip 0; actual IPC attack matrix PASS; actual Task-time and Recovery-time UAC rejection PASS; Journal/backup/main/helper residue 0; fresh self-contained Bundle show PASS.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Verify-AdminIpcAttackMatrix.ps132
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/Verify-AdminIpcAttackMatrix.ps1 b/scripts/Verify-AdminIpcAttackMatrix.ps1
new file mode 100644
index 0000000..c0703f0
--- /dev/null
+++ b/scripts/Verify-AdminIpcAttackMatrix.ps1
@@ -0,0 +1,32 @@
+param(
+ [string]$Configuration = 'Release',
+ [string]$BundlePath = 'build\Release\publish\agent-sandbox-mcp-1.0.0-win-x64'
+)
+
+$ErrorActionPreference = 'Stop'
+$repository = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
+$harnessDirectory = Join-Path $repository "build\$Configuration\Agent.Admin.AcceptanceHarness\net10.0-windows10.0.26100.0"
+$sourceAppHost = Join-Path $harnessDirectory 'Agent.Admin.AcceptanceHarness.exe'
+$testAppHost = Join-Path $harnessDirectory 'agent-mcp.exe'
+$helper = Join-Path ([IO.Path]::GetFullPath((Join-Path $repository $BundlePath))) 'admin\agent-mcp-admin.exe'
+
+if (-not (Test-Path -LiteralPath $sourceAppHost) -or -not (Test-Path -LiteralPath $helper)) {
+ throw 'Build the solution and publish the Release Bundle before running this acceptance matrix.'
+}
+
+# The helper independently requires the parent image name agent-mcp.exe. Renaming only
+# the test apphost preserves its embedded managed DLL target while exercising that check.
+Copy-Item -LiteralPath $sourceAppHost -Destination $testAppHost -Force
+
+& $testAppHost local-peer
+if ($LASTEXITCODE -ne 0) { throw 'Local peer PID authentication failed.' }
+& $testAppHost remote-peer
+if ($LASTEXITCODE -ne 0) { throw 'Remote-form Named Pipe rejection failed.' }
+
+Write-Host 'Four UAC prompts follow. Approve each prompt to test the real elevated helper.' -ForegroundColor Yellow
+foreach ($scenario in 'wrong-task', 'wrong-version', 'double-apply', 'oversized') {
+ & $testAppHost $scenario $helper
+ if ($LASTEXITCODE -ne 0) { throw "Administrative IPC scenario '$scenario' failed." }
+}
+
+Write-Output 'Administrative IPC actual-Process attack matrix PASS.'