2323# powershell -NoProfile -ExecutionPolicy Bypass -File .\run-ocsf-audit.ps1 `
2424# -WxcExecPath C:\mxc-kit\bin\wxc-exec.exe
2525#
26- # By default the per-sandbox egress proxy is ON so the full event set (including
27- # SandboxProxyConfigured) is produced. Pass -NoProxy to omit only that one event.
28- #
2926# The deliverable is the OCSF audit log (openshell-ocsf.<date>.log) inside the
3027# results-*.zip the script produces. Pass -ShareOut '\\server\share' to also copy
3128# the bundle to a shared location (off by default).
3835 [string ] $ShareDir = " C:\work\openshell-mxc-demo" ,
3936 # How many sandboxes to create (each drives a full event burst).
4037 [int ] $SandboxCount = 2 ,
41- # Disable the per-sandbox egress proxy (omits the SandboxProxyConfigured event).
42- [switch ] $NoProxy ,
4338 # Gateway bind port (matches the gateway default) + CLI registration name.
4439 [int ] $Port = 17670 ,
4540 [string ] $GatewayName = " openshell-mxc-ocsf" ,
@@ -95,7 +90,6 @@ $helloPath = Join-Path $ShareDir "hello.txt"
9590$gw = $null
9691$gatewayEtwSessions = @ ()
9792$passed = $true
98- $proxyOn = -not $NoProxy
9993
10094try {
10195 # 1. Validate artifacts + privilege.
@@ -133,12 +127,6 @@ try {
133127 } else {
134128 $tomlText = [regex ]::Replace($tomlText , ' (?m)^\[openshell\.drivers\.mxc\]\s*$' , " [openshell.drivers.mxc]`r`n etw_audit = true" )
135129 }
136- $proxyVal = if ($proxyOn ) { ' true' } else { ' false' }
137- if ($tomlText -match ' (?m)^\s*#?\s*egress_proxy\s*=' ) {
138- $tomlText = [regex ]::Replace($tomlText , ' (?m)^\s*#?\s*egress_proxy\s*=.*$' , " egress_proxy = $proxyVal " )
139- } else {
140- $tomlText = [regex ]::Replace($tomlText , ' (?m)^\[openshell\.drivers\.mxc\]\s*$' , " [openshell.drivers.mxc]`r`n egress_proxy = $proxyVal " )
141- }
142130 Set-Content $toml - Value $tomlText - Encoding UTF8
143131
144132 $shareDirPolicy = $ShareDir.Replace (' \' , ' /' )
@@ -168,7 +156,7 @@ try {
168156 $driverConfig
169157 }
170158
171- Info " backend=process_container etw_audit=true egress_proxy= $proxyVal "
159+ Info " backend=process_container etw_audit=true"
172160 Info " workload cwd=$shareDirPolicy policy grant=$shareDirPolicy "
173161
174162 # 3. Port must be free. Auto-clear a stale OUR-gateway; refuse anything else.
@@ -326,9 +314,7 @@ finally {
326314 # Event-type coverage (detected from the human-readable shorthand lines).
327315 function Seen ([string ]$pat ) { [bool ]($logText | Select-String - Pattern $pat - Quiet) }
328316
329- # Expected happy-path ETW->OCSF event types for THIS run. The egress-proxy
330- # event only fires when the proxy is enabled, so it only counts toward the
331- # expected total when -NoProxy was NOT passed.
317+ # Expected happy-path ETW->OCSF event types for this run.
332318 $coreEvents = [ordered ]@ {
333319 " sandbox lifecycle (start)" = Seen " (?i)ocsf:.*LIFECYCLE:"
334320 " OS policy enforced" = Seen " (?i)ocsf:.*OS policy enforced"
@@ -338,7 +324,6 @@ finally {
338324 " console reference plumbed" = Seen " (?i)ocsf:.*console reference plumbed"
339325 " process launch (executable identity)" = Seen " (?i)ocsf:.*PROC:LAUNCH"
340326 }
341- if ($proxyOn ) { $coreEvents [" egress proxy configured" ] = Seen " (?i)ocsf:.*proxy configured" }
342327
343328 # Findings are anomaly / fallback signals - reported separately, NOT part of
344329 # the expected-coverage denominator (a clean run may emit none).
@@ -369,7 +354,6 @@ user : $env:USERNAME (admin=$admin perfLogUsers=$plu)
369354verdict : $verdict
370355event coverage : $coreObserved of $coreExpected expected event types fired (+ $findingsObserved anomaly finding(s))
371356queue overload : $ ( if ($consumerOverloaded ) { ' YES - ETW records dropped; audit coverage gap' } else { ' no dropped ETW records observed' })
372- proxy : $ ( if ($proxyOn ) { ' on (full event set)' } else { ' off (-NoProxy; omits egress proxy event)' })
373357workload output : $ ( if ($workloadCompleted ) { $helloPath } else { ' (missing)' })
374358wxc_exec : $WxcExecPath
375359backend : process_container
0 commit comments