Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/openshell-driver-mxc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ uuid = { workspace = true }
openshell-mxc-boundary = { path = "../openshell-mxc-boundary" }
openshell-isolation-interface = { path = "../openshell-isolation-interface" }
openshell-sandbox-backend = { path = "../openshell-sandbox-backend" }
windows = { workspace = true }
windows = { workspace = true, features = ["Win32_System_Kernel", "Win32_System_Performance", "Win32_System_SystemInformation"] }

[dev-dependencies]
anyhow = { workspace = true }
Expand Down
28 changes: 21 additions & 7 deletions crates/openshell-driver-mxc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,24 @@ binaries. This requires elevation or Performance Log Users membership. It checks
the shipped config and coverage classifier before requiring all seven event types
in the durable JSONL output; the ordinary E2E scenarios do not check this path.

On the ARM64 test host (Windows build 28120, MXC 1.0.0), Sandboxing ETW records
come from the shared Appinfo broker rather than the driver-owned executor.
The consumer cannot correlate these records using the executor's PID and process
generation, so live audit qualification currently fails even though the workload
completes. The executor diagnostic log redacts its container identity. A trusted
broker-to-launch correlation is needed; treating the shared broker PID as a
sandbox identity would misattribute concurrent sandboxes and is not supported.
On some Windows builds (observed on ARM64, Windows build 28000), Sandboxing ETW records
come from the shared Appinfo broker rather than the driver-owned executor, so they
cannot be matched to a sandbox by the executor's PID and process generation. The
consumer attributes them through the `ProcessLaunched` record instead. That record
names the process the OS started inside the sandbox, and it is attributed to a
sandbox only when that process is a child of a live, registered executor (checked by
the executor's process start key) and was created no later than the record was
emitted. The record carries no start key for the child, so the creation-time bound
is what rules out a PID that was reused before the record reached the consumer
(records arrive about a second after they are emitted); when the bound cannot be
established, the record is not attributed. The record's activity id then attributes
the rest of the create burst. On a host that shows this behaviour, live audit
qualification passes with all seven event types. Treating the shared broker PID as a sandbox identity would
misattribute concurrent sandboxes and is not supported.

Records that cannot be attributed are counted. The provider is system-wide, so some
may belong to another gateway or consumer: a record that waited while this gateway
had a live sandbox counts as possible loss and raises a warning that does not claim
a confirmed gap, and one that arrived while it had none is counted separately and
never warned about. Pending records are replayed and counted when the session stops,
before the final warning.
11 changes: 7 additions & 4 deletions crates/openshell-driver-mxc/examples/run-ocsf-audit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,16 @@ gateway_id = 'mxc-ocsf-audit'

$cmdExe = Join-Path $env:SystemRoot "System32\cmd.exe"
if (-not (Test-Path $cmdExe -PathType Leaf)) { throw "cmd.exe not found at '$cmdExe'" }
$helloPathCommand = $helloPath.Replace('\', '/')
New-Item -ItemType Directory -Force $ShareDir | Out-Null
$batch = Join-Path $ShareDir 'audit-workload.cmd'
Set-Content -LiteralPath $batch -Encoding ASCII -Value ('@echo hello from openshell ocsf audit > "{0}"' -f $helloPathCommand)
# Run the workload inline, writing hello.txt relative to its working directory
# (the share), so the command needs no path and works when -ShareDir contains
# spaces. A batch file the host writes into the share before the sandbox starts
# cannot be run by the sandbox (Windows reports a sharing violation), which made
# this script report "audit workload did not produce its artifact" even when
# the audit trail was complete.
$driverConfig = @{
mxc = @{
command = @($cmdExe, '/d', '/c', $batch)
command = @($cmdExe, '/d', '/c', 'echo hello from openshell ocsf audit 1> hello.txt')
cwd = $shareDirPolicy
}
} | ConvertTo-Json -Compress -Depth 4
Expand Down
Loading
Loading