Skip to content

Commit b13cf5a

Browse files
committed
chore(mxc): address rebase follow-ups
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent 48263d1 commit b13cf5a

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

‎crates/openshell-ocsf/src/tracing_layers/event_bridge.rs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ pub fn emit_ocsf_event(event: OcsfEvent) {
4848

4949
/// Store an `OcsfEvent` in the thread-local bridge so OCSF layers
5050
/// (`OcsfJsonlLayer` / `OcsfShorthandLayer`) can `clone_current_event()` it
51-
/// during tracing dispatch. Pair with [`clear_current_event`] after the emit.
51+
/// during tracing dispatch.
52+
///
53+
/// Pair with [`clear_current_event`] after the emit.
5254
///
5355
/// Exposed so callers that need to attach extra tracing fields to the *same*
5456
/// event (e.g. the gateway's per-sandbox `sandbox_id` routing field — see
@@ -67,7 +69,9 @@ pub fn clear_current_event() {
6769
});
6870
}
6971

70-
/// Emit an `OcsfEvent` that is BOTH picked up by the structured OCSF layers
72+
/// Emit an `OcsfEvent` through the structured and routed output paths.
73+
///
74+
/// The event is picked up by the structured OCSF layers
7175
/// (via the thread-local bridge → `OcsfJsonlLayer` writes full JSON) AND
7276
/// routed by the gateway's `TracingLogBus` (via the `sandbox_id` + `message`
7377
/// tracing fields → per-sandbox stream / stdout shorthand).

‎crates/openshell-server/src/tracing_setup.rs‎

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,17 @@ pub fn install(
7979
}))
8080
.init();
8181

82-
match jsonl_dir {
83-
Some(dir) => tracing::info!(
82+
if let Some(dir) = jsonl_dir {
83+
tracing::info!(
8484
target: "openshell_server",
8585
ocsf_jsonl_dir = %dir.display(),
8686
"OCSF JSONL audit log enabled (openshell-ocsf.<date>.log, daily rotation, keep 3)"
87-
),
88-
None => tracing::debug!(
87+
);
88+
} else {
89+
tracing::debug!(
8990
target: "openshell_server",
9091
"OCSF JSONL audit log disabled"
91-
),
92+
);
9293
}
9394

9495
(
@@ -114,14 +115,12 @@ fn build_ocsf_jsonl_layer() -> (
114115
Option<OcsfJsonlLayer<tracing_appender::rolling::RollingFileAppender>>,
115116
Option<std::path::PathBuf>,
116117
) {
117-
let disabled = std::env::var("OPENSHELL_OCSF_JSON")
118-
.map(|v| {
119-
matches!(
120-
v.trim().to_ascii_lowercase().as_str(),
121-
"0" | "false" | "off" | "no"
122-
)
123-
})
124-
.unwrap_or(false);
118+
let disabled = std::env::var("OPENSHELL_OCSF_JSON").is_ok_and(|v| {
119+
matches!(
120+
v.trim().to_ascii_lowercase().as_str(),
121+
"0" | "false" | "off" | "no"
122+
)
123+
});
125124
if disabled {
126125
return (None, None);
127126
}

‎docs/observability/logging.mdx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ CLASS:ACTIVITY [SEVERITY] ACTION DETAILS [CONTEXT]
9797
- Config: description of what changed
9898
- Finding: quoted title with the stable finding type, optional confidence, and source-specific context attributes when available
9999

100-
MXC ETW process-launch events record the executable name but omit command-line arguments from both OCSF JSON and shorthand. Arguments can legitimately contain credentials, signed URLs, or PII.
101-
102100
**Context** in brackets provides structured fields such as policy provenance, source-specific attributes, and denial reasons.
103101

104102
### Examples

0 commit comments

Comments
 (0)