Skip to main content

Crate goliath_normalize

Crate goliath_normalize 

Source
Expand description

Declarative source definitions that turn raw log records into OCSF events.

A source definition says, in YAML, how a log source’s bytes split into records, how a record decodes, which kind of record it is, and where each of its fields goes in OCSF. People who know a log source can write one without writing Rust. The model is docs/adr/0007-source-and-parser-model.md.

Nothing a source sends is dropped. A record that cannot become an event is a DeadLetter with its raw bytes intact. A field whose value does not convert is kept as written under unmapped and reported as an Issue, and the event still goes on to detection.

Definitions shipped with this crate live in sources/, each with fixtures of raw records and the events they must produce.

§Example

use goliath_normalize::{Normalizer, Outcome, SYSMON};

let sysmon = Normalizer::from_yaml(SYSMON)?;
let raw = br##"{"Event": {
    "System": {
        "Provider": { "#attributes": { "Name": "Microsoft-Windows-Sysmon" } },
        "EventID": 1,
        "TimeCreated": { "#attributes": { "SystemTime": "2026-09-24T10:15:30.1234567Z" } },
        "Computer": "WS-07"
    },
    "EventData": { "Image": "C:\\Windows\\notepad.exe", "ProcessId": "42", "RuleName": "-" }
}}"##;

sysmon.normalize(raw, |outcome| match outcome {
    Outcome::Event(normalized) => {
        assert_eq!(normalized.event["class_uid"], 1007);
        assert_eq!(normalized.event["process"]["pid"], 42);
        assert_eq!(normalized.event["time"], 1_790_244_930_123_i64);
        // Nothing is dropped: fields the definition does not map are kept.
        assert_eq!(normalized.event["unmapped"]["RuleName"], "-");
    }
    other => panic!("{other:?}"),
});

Re-exports§

pub use definition::SourceDefinition;
pub use error::DefinitionError;
pub use normalizer::DeadLetter;
pub use normalizer::EventId;
pub use normalizer::Issue;
pub use normalizer::Normalized;
pub use normalizer::Normalizer;
pub use normalizer::Outcome;
pub use normalizer::Stage;
pub use wire::Envelope;
pub use wire::WireError;

Modules§

definition
The source definition file format.
error
Error types.
normalizer
Source definitions compiled for use, and records through them.
wire
How outcomes travel between roles.

Constants§

AUDITD
The Linux audit log definition shipped with this crate.
BUILTIN
Every definition shipped with this crate, by name.
CLOUDTRAIL
The definition for AWS CloudTrail shipped with this crate: console sign-ins and API calls.
ENTRA
The Microsoft Entra ID sign-in log definition shipped with this crate.
FALCO
The Falco source definition shipped with this crate.
M365
The Microsoft 365 unified audit log definition shipped with this crate: Entra ID sign-ins, accounts, groups, roles, and every other operation of every workload.
OKTA
The Okta System Log definition shipped with this crate: sign-ins, accounts, factors, groups, privileges, and every other event type.
SURICATA
The Suricata EVE definition shipped with this crate: alerts as Detection Findings, and DNS, HTTP, TLS, flow, file, SMB, SSH, anomaly, and drop records.
SYSMON
The Sysmon source definition shipped with this crate.
SYSMON_FLAT
The definition for Sysmon events as flat JSON lines, as NXLog-based pipelines and the OTRF Security Datasets write them.
WINDOWS_SECURITY
The Windows Security event log definition shipped with this crate: logons, Kerberos, process creation, account and group changes.
ZEEK
The Zeek definition shipped with this crate: connections, DNS, HTTP, TLS, certificates, SMB files, DCE/RPC, Kerberos, RDP, and SSH.

Functions§

builtin
The shipped definition named name, if there is one.