Repository navigation
Add Linux auditd log parser - #36
Conversation
New AuditdParser in ax-normalize for /var/log/audit/audit.log. Each line is type=<TYPE> msg=audit(<epoch>:<serial>): key=value ... (optionally node=<host> prefixed). We pull the distinctive audit message ID out of msg=audit(...) — epoch as a Float (for coll.cusum / cadence on bursty activity) and serial as the event id — then parse the remaining key=value fields. type and syscall are the categorical columns dist reads as exec/syscall mix drift. Field values are bare (type-inferred, syscall=2 -> Int, exit=-13 -> Int), double-quoted (comm="cat"), or single-quoted (auditd USER_* records carry a msg='...' payload with spaces) — quoted values kept verbatim as Str. The audit ID is split out with split_once (no index arithmetic), so the record splitting has no off-by-one mutation surface. Detected by the unmistakable msg=audit( signature (STRONG, beats logfmt's TEXT); claims no extension (audit.log is too generic). A line without a valid msg=audit(...) is a clean Parse error. Mutation gate: 0 surviving mutants on the new file. The extensions() -> empty-slice mutant is a documented equivalent (same as Zeek/Journal/Eve/CloudTrail). Closes #12 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds a complete Linux auditd log parser to the anomalyx Changesauditd Log Parser Addition
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Implements the auditd plugin — issue #12.
What
/var/log/audit/audit.loglines aretype=<TYPE> msg=audit(<epoch>:<serial>): key=value ...(optionallynode=<host>prefixed).
AuditdParserpulls the distinctive audit message ID out ofmsg=audit(...)—epochas aFloat(forcoll.cusum/ cadence on burstyactivity) and
serialas the event id — then parses the remainingkey=valuefields.
typeandsyscallare the categorical columnsdistreads asexec/syscall mix drift.
Field values are bare (type-inferred:
syscall=2→Int,exit=-13→Int),double-quoted (
comm="cat"), or single-quoted (auditdUSER_*records carry amsg='...'payload with spaces) — quoted values kept verbatim asStr. Theaudit ID is split out with
split_once(no index arithmetic), so the recordsplit has no off-by-one mutation surface.
Routing
msg=audit(signature (STRONG, beats logfmt'sTEXT).audit.logis too generic to hijack).Errors
A line without a valid
msg=audit(...)(missing marker, no:separator,non-numeric serial) is a clean
AxError::Parse.Gates
fmt/clippy -D warnings/ full workspace tests green (both feature sets).auditd.rs(4 loop-bound timeouts inthe field scanner). The
extensions()→ empty-slice mutant is a documentedequivalent (same as Zeek/Journal/Eve/CloudTrail).
audit.logslice routes asauditdwithepoch/serial/syscalltyped.
Closes #12
🤖 Generated with Claude Code
Summary by CodeRabbit