-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(mxc): add Windows ETW-to-OCSF audit trail #3015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
2015c2b
feat(mxc): ETW->OCSF audit consumer + Windows OCSF JSONL parity (cp6 P1)
jamieknvidia 337dc8f
feat(mxc): map remaining Sandboxing ETW events to OCSF
jamieknvidia 2ae8620
fix(mxc): seed ETW attribution under registry lock + Device tests
jamieknvidia e28cffe
fix(mxc-etw): buffer+replay racing events and harden attribution keys
jamieknvidia 416be51
docs(mxc-etw): note cmd_line is captured raw with no privacy filtering
jamieknvidia 65647db
fix(mxc-etw): open ETW trace on caller thread so start_session report…
jamieknvidia 2251252
fix(mxc-etw): guard pending-event replay against PID recycling
jamieknvidia 6a9f3db
fix(mxc-etw): surface unexpected ProcessTrace termination (review #4)
jamieknvidia 8bde61c
feat(mxc-ocsf): add ETW->OCSF audit-trail example kit; fix proxy-con…
jamieknvidia 6ca7343
feat(mxc-ocsf): clearer audit report + client-safe run-ocsf-audit.ps1
jamieknvidia 5cdf440
fix(mxc): configure OCSF audit workloads per sandbox
araza008 6f05a7d
fix(mxc): omit command arguments from OCSF audit logs
araza008 64f6325
feat(etw): enhance ETW session management with distinct naming for co…
araza008 28281e4
fix(etw): bound the audit queue during overload
araza008 f98aede
fix(etw): harden sandbox audit attribution
araza008 48b1043
chore(mxc): address rebase follow-ups
drew 13185f6
fix(mxc): align OCSF audit example with driver config
araza008 742fc56
fix(etw): redact command-line secrets in DecodedEtwEvent summary
araza008 043415d
fix(etw): enhance PID resolution and event attribution logic for ETW …
araza008 21b4c4a
fix(ocsf): restrict gateway-local JSONL sink to Windows/MXC path with…
araza008 ef0f3eb
address rebase issues
araza008 0ba0dfe
fix(mxc): address ETW audit review feedback
drew f443a0a
Merge branch 'main' into akberr/etw-to-ocsf-mapping
araza008 f6c029f
fix(mxc): resolve main merge conflicts and OCSF integration
drew ce4220a
fix(mxc): fail closed across ambiguous PID reuse
drew 333c114
chore: merge main into MXC audit branch
drew ac559fe
fix(mxc): bind ETW attribution to process generation
drew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
74 changes: 74 additions & 0 deletions
74
crates/openshell-driver-mxc/examples/README-ocsf-audit.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| OpenShell MXC - ETW -> OCSF audit-trail example | ||
| =============================================== | ||
|
|
||
| WHAT THIS PROVES / PRODUCES | ||
| The full Windows OCSF audit path on this box: | ||
| gateway -> MXC driver -> process_container sandbox | ||
| -> the OS "Sandboxing" ETW provider fires as the sandbox is created | ||
| -> the gateway's in-process consumer decodes each event, attributes it to | ||
| an OpenShell sandbox_id, and maps it to OCSF | ||
| -> events are written to a durable JSONL audit log AND printed as | ||
| human-readable shorthand. | ||
|
|
||
| The deliverable is the OCSF log: openshell-ocsf.<date>.log, one OCSF event | ||
| object per line - the same schema and medium the Linux OpenShell pipeline | ||
| produces (Windows is at functional parity). | ||
|
|
||
| OCSF classes you will see: | ||
| [6002] Application Lifecycle - sandbox created | ||
| [5019] Device Config State Change - OS policy / hardening / console | ||
| [1007] Process Activity - in-sandbox process launch (+ executable identity) | ||
| [2004] Detection Finding - MXC setup activity errors (informational) | ||
|
|
||
| PREREQUISITES (on this test box) | ||
| - wxc-exec.exe present (default expected: C:\mxc-kit\bin\wxc-exec.exe) | ||
| - process_container backend live (it was for our earlier runs) | ||
| - Run ELEVATED (Run as administrator) OR from an account in the | ||
| 'Performance Log Users' group. Opening the real-time ETW session needs this; | ||
| without it the run fails fast with a clear message. | ||
|
|
||
| HOW TO RUN | ||
| 1. Open an ELEVATED PowerShell in THIS folder. | ||
| 2. Run: | ||
| powershell -NoProfile -ExecutionPolicy Bypass -File .\run-ocsf-audit.ps1 | ||
| If wxc-exec is somewhere else: | ||
| ... -File .\run-ocsf-audit.ps1 -WxcExecPath "D:\path\to\wxc-exec.exe" | ||
|
|
||
| WHAT YOU GET BACK | ||
| The script prints PASS/FAIL + an event-type coverage count and class breakdown, | ||
| points you at the OCSF audit log, and creates: | ||
| results-<timestamp>.zip | ||
| It contains the OCSF audit log (openshell-ocsf.<date>.log), the full transcript, | ||
| the gateway logs (with the human-readable OCSF shorthand), a summary, and the | ||
| exact config + policy used. To auto-copy the bundle to a shared location, pass | ||
| -ShareOut '\\server\share' (off by default; results stay local otherwise). | ||
|
|
||
| FILES IN THIS PACKAGE | ||
| openshell-gateway.exe the gateway (self-contained; needs only VC++ runtime) | ||
| openshell.exe the CLI | ||
| mxc-ocsf-audit.toml gateway/driver config (process_container, etw_audit=true) | ||
| ocsf-audit.yaml sandbox policy (read-write grant to the share dir) | ||
| run-ocsf-audit.ps1 the orchestrator you run | ||
| README-ocsf-audit.txt this file | ||
| (wxc-exec.exe is used IN PLACE on the box; not shipped) | ||
|
|
||
| USEFUL OPTIONS | ||
| -SandboxCount <n> Create n sandboxes (default 2). More sandboxes = more events. | ||
| -ShareDir <path> Host folder granted read-write to the workload. The script | ||
| derives a disposable policy and per-sandbox config for it. | ||
| -WxcExecPath <path> Path to wxc-exec.exe on this box. | ||
| -ShareOut <path> Copy the results bundle to a shared location | ||
| (e.g. \\server\share). Off by default (results stay local). | ||
| -KeepRunning Leave the gateway running afterward for inspection. | ||
|
|
||
| NOTES | ||
| - The control plane between CLI and gateway runs with --disable-tls on loopback; | ||
| that is unrelated to the OCSF audit path this example exercises. | ||
| - A "supervisor session not connected" / ssh 255 message during sandbox create | ||
| is EXPECTED on MXC and harmless - the agent already ran in-driver. | ||
| - The Sandboxing provider reports the sandbox entry-point process, not the full | ||
| in-sandbox process tree. Deep process-tree auditing would need a second ETW | ||
| source (Microsoft-Windows-Kernel-Process) and is out of scope for this trail. | ||
| - MXC process audit events record the executable basename only. Command-line | ||
| arguments are omitted from OCSF JSON and shorthand because they can contain | ||
| credentials, signed URLs, or PII. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # MXC gateway config for the ETW -> OCSF audit-trail example. | ||
| # | ||
| # Goal: exercise the in-process ETW consumer (Plane A) end-to-end so that | ||
| # creating a sandbox produces a full OCSF audit trail — Application Lifecycle | ||
| # [6002], Device Config State Change [5019], Process Activity [1007] and | ||
| # Detection Finding [2004] — written to a durable JSONL log, just like the Linux | ||
| # OCSF pipeline. | ||
| # | ||
| # run-ocsf-audit.ps1 patches wxc_exec_path, backend, and etw_audit into a | ||
| # disposable copy of this file. Workload command and cwd are sandbox-scoped and | ||
| # passed separately through --driver-config-json. | ||
|
|
||
| [openshell.drivers.mxc] | ||
| # Path to wxc-exec.exe on the box (patched by the run script; default is the | ||
| # location observed on the MXC test boxes). | ||
| wxc_exec_path = "C:\\mxc-kit\\bin\\wxc-exec.exe" | ||
|
|
||
| # One-shot AppContainer. This is the backend whose Sandboxing ETW the consumer | ||
| # captures. (isolation_session is "dark" — it emits no provider events.) | ||
| backend = "process_container" | ||
|
|
||
| default_configuration_id = "composable" | ||
|
|
||
| debug = false | ||
|
|
||
| # Turn ON the Plane-A ETW -> OCSF audit consumer. This is the core of the example. | ||
| etw_audit = true | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # ocsf-audit.yaml — sandbox policy for the MXC ETW -> OCSF audit-trail example. | ||
| # | ||
| # Minimal filesystem policy granting the workload folder read-write; everything | ||
| # else is default-deny. run-ocsf-audit.ps1 copies this policy into the result | ||
| # bundle and replaces the default grant with -ShareDir for that run. | ||
| version: 1 | ||
|
|
||
| filesystem_policy: | ||
| include_workdir: false | ||
| read_only: [] | ||
| read_write: | ||
| - "C:/work/openshell-mxc-demo" |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.