Skip to content

Commit 3bedbe7

Browse files
committed
docs(ocsf): document why protocol_name and rule_type remain String
Add inline comments explaining the intentional decision to keep these fields as String rather than typed enums: protocol_name is free-form per the OCSF spec, and rule_type is a project-specific extension with runtime-dynamic values from the policy engine.
1 parent 5e134ca commit 3bedbe7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crates/openshell-ocsf/src/objects/connection.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ use serde::{Deserialize, Serialize};
99
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1010
pub struct ConnectionInfo {
1111
/// Protocol name (e.g., "tcp", "udp").
12+
///
13+
/// Kept as `String` because the OCSF spec defines this as free-form
14+
/// `string_t`, and sandbox integration passes runtime-dynamic values.
1215
pub protocol_name: String,
1316
}
1417

crates/openshell-ocsf/src/objects/firewall_rule.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ pub struct FirewallRule {
1212
pub name: String,
1313

1414
/// Rule type / engine (e.g., "mechanistic", "opa", "iptables").
15+
///
16+
/// Kept as `String` because this is a project-specific extension field
17+
/// (not OCSF-enumerated) with runtime-dynamic values from the policy engine.
1518
#[serde(rename = "type")]
1619
pub rule_type: String,
1720
}

0 commit comments

Comments
 (0)