Skip to content

Commit 13185f6

Browse files
committed
fix(mxc): align OCSF audit example with driver config
- remove unsupported egress proxy settings - stop requiring the unavailable proxy audit event - update example documentation for supported event coverage Signed-off-by: Akber Raza <[email protected]>
1 parent 48b1043 commit 13185f6

4 files changed

Lines changed: 7 additions & 43 deletions

File tree

‎crates/openshell-driver-mxc/examples/README-ocsf-audit.txt‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ WHAT THIS PROVES / PRODUCES
1616

1717
OCSF classes you will see:
1818
[6002] Application Lifecycle - sandbox created
19-
[5019] Device Config State Change - OS policy / hardening / proxy / console
19+
[5019] Device Config State Change - OS policy / hardening / console
2020
[1007] Process Activity - in-sandbox process launch (+ executable identity)
2121
[2004] Detection Finding - MXC setup activity errors (informational)
2222

@@ -46,17 +46,14 @@ WHAT YOU GET BACK
4646
FILES IN THIS PACKAGE
4747
openshell-gateway.exe the gateway (self-contained; needs only VC++ runtime)
4848
openshell.exe the CLI
49-
mxc-ocsf-audit.toml gateway/driver config (process_container, etw_audit=true, egress proxy)
49+
mxc-ocsf-audit.toml gateway/driver config (process_container, etw_audit=true)
5050
ocsf-audit.yaml sandbox policy (read-write grant to the share dir)
5151
run-ocsf-audit.ps1 the orchestrator you run
5252
README-ocsf-audit.txt this file
5353
(wxc-exec.exe is used IN PLACE on the box; not shipped)
5454

5555
USEFUL OPTIONS
5656
-SandboxCount <n> Create n sandboxes (default 2). More sandboxes = more events.
57-
-NoProxy Skip the per-sandbox egress proxy. This omits ONLY the
58-
SandboxProxyConfigured config event; everything else is
59-
still produced. (Default is proxy ON for the full set.)
6057
-ShareDir <path> Host folder granted read-write to the workload. The script
6158
derives a disposable policy and per-sandbox config for it.
6259
-WxcExecPath <path> Path to wxc-exec.exe on this box.
@@ -69,9 +66,6 @@ NOTES
6966
that is unrelated to the OCSF audit path this example exercises.
7067
- A "supervisor session not connected" / ssh 255 message during sandbox create
7168
is EXPECTED on MXC and harmless - the agent already ran in-driver.
72-
- The proxy path requires the host-side CONNECT proxy and an absolute agent
73-
binary (the packaged config uses C:\Windows\System32\cmd.exe); the run script
74-
handles this for you.
7569
- The Sandboxing provider reports the sandbox entry-point process, not the full
7670
in-sandbox process tree. Deep process-tree auditing would need a second ETW
7771
source (Microsoft-Windows-Kernel-Process) and is out of scope for this trail.

‎crates/openshell-driver-mxc/examples/mxc-ocsf-audit.toml‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
# Detection Finding [2004] — written to a durable JSONL log, just like the Linux
1010
# OCSF pipeline.
1111
#
12-
# run-ocsf-audit.ps1 patches wxc_exec_path, backend, etw_audit and the
13-
# egress-proxy switch into a disposable copy of this file. Workload command and
14-
# cwd are sandbox-scoped and passed separately through --driver-config-json.
12+
# run-ocsf-audit.ps1 patches wxc_exec_path, backend, and etw_audit into a
13+
# disposable copy of this file. Workload command and cwd are sandbox-scoped and
14+
# passed separately through --driver-config-json.
1515

1616
[openshell.drivers.mxc]
1717
# Path to wxc-exec.exe on the box (patched by the run script; default is the
@@ -28,13 +28,3 @@ debug = false
2828

2929
# Turn ON the Plane-A ETW -> OCSF audit consumer. This is the core of the example.
3030
etw_audit = true
31-
32-
# Per-sandbox governed egress. Enabling this makes the driver start a host CONNECT
33-
# proxy and hand MXC a `network.proxy` redirect, which is what makes MXC emit the
34-
# SandboxProxyConfigured event — the config event mapped to OCSF CONFIG [5019]
35-
# that completes full event coverage. Requires backend = process_container and a
36-
# loopback (127.0.0.1) seed address; the driver allocates a unique ephemeral port
37-
# per sandbox from this seed. Run-ocsf-audit.ps1 disables this when passed
38-
# -NoProxy.
39-
egress_proxy = true
40-
egress_proxy_addr = "127.0.0.1:18080"

‎crates/openshell-driver-mxc/examples/ocsf-audit.yaml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
# Minimal filesystem policy granting the workload folder read-write; everything
77
# else is default-deny. run-ocsf-audit.ps1 copies this policy into the result
88
# bundle and replaces the default grant with -ShareDir for that run.
9-
#
10-
# No network_policies block is needed here: the per-sandbox egress proxy is driven
11-
# by `egress_proxy = true` in mxc-ocsf-audit.toml (that is what makes MXC emit the
12-
# SandboxProxyConfigured event we map to OCSF), not by a policy rule.
139
version: 1
1410

1511
filesystem_policy:

‎crates/openshell-driver-mxc/examples/run-ocsf-audit.ps1‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
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).
@@ -38,8 +35,6 @@ param(
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

10094
try {
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`netw_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`negress_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)
369354
verdict : $verdict
370355
event coverage : $coreObserved of $coreExpected expected event types fired (+ $findingsObserved anomaly finding(s))
371356
queue 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)' })
373357
workload output : $(if ($workloadCompleted) { $helloPath } else { '(missing)' })
374358
wxc_exec : $WxcExecPath
375359
backend : process_container

0 commit comments

Comments
 (0)