Skip to content

Add IP-layer byte counts (ip_bytes, ip_bytes_in, ip_bytes_out) to network_traffic#1673

Open
flying-coyote wants to merge 2 commits into
ocsf:mainfrom
flying-coyote:add-network-traffic-ip-bytes
Open

Add IP-layer byte counts (ip_bytes, ip_bytes_in, ip_bytes_out) to network_traffic#1673
flying-coyote wants to merge 2 commits into
ocsf:mainfrom
flying-coyote:add-network-traffic-ip-bytes

Conversation

@flying-coyote

Copy link
Copy Markdown

Summary

The Network Traffic object's bytes / bytes_in / bytes_out are defined in the dictionary as payload byte counts (bytes_in = "bytes sent from the destination to the source"). There is no attribute for the IP-layer byte count — payload plus the IP and transport (TCP/UDP) headers — which common network sensors emit as a distinct value.

The most widely deployed open network sensor, Zeek, reports both for every connection in conn.log:

  • orig_bytes / resp_bytes — payload bytes
  • orig_ip_bytes / resp_ip_bytes — IP-layer bytes (header-inclusive)

Today a producer mapping Zeek (or any sensor with IP-layer counters) must either drop the IP-layer count or overload bytes_* with it, which silently breaks any consumer that assumes bytes_* is payload, and makes the two byte models non-comparable across producers.

Change

Adds three attributes to objects/network_traffic.json (and the dictionary), mirroring the existing payload trio so the object stays symmetric:

New attribute Maps (Zeek conn.log) Meaning
ip_bytes_out orig_ip_bytes IP-layer bytes source → destination (outbound), headers included
ip_bytes_in resp_ip_bytes IP-layer bytes destination → source (inbound), headers included
ip_bytes sum total IP-layer bytes, both directions
  • Direction convention matches the existing bytes_in / bytes_out (in = destination → source, out = source → destination).
  • All three are long_t, requirement: optional.
  • Descriptions explicitly state the distinction from the payload bytes_* so the difference is unambiguous in the rendered schema.

Precedent

Follows #1316, which added the Zeek-derived history and missing_bytes attributes to the same object — this fills the remaining IP-byte gap on that path.

…work_traffic

The Network Traffic object's bytes/bytes_in/bytes_out are defined as payload byte
counts. There is no attribute for the IP-layer byte count (payload plus IP and
transport headers), which common network sensors emit as a distinct value: Zeek
conn.log reports both orig_bytes/resp_bytes (payload) and orig_ip_bytes/resp_ip_bytes
(IP-layer) for every connection. Today a producer must drop the IP-layer count or
overload bytes_*, which breaks consumers that assume bytes_* is payload.

This adds ip_bytes, ip_bytes_in, ip_bytes_out to objects/network_traffic.json and the
dictionary, paralleling the existing payload trio with descriptions that state the
distinction. Direction matches bytes_in/bytes_out (in = destination to source, out =
source to destination). All optional, long_t. Follows the precedent of ocsf#1316, which
added Zeek-derived history/missing_bytes to the same object.

Signed-off-by: flyingcoyote <flyingcoyote@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants