Skip to content

Add Windows Event Log (EVTX) parser - #37

Merged
copyleftdev merged 1 commit into
mainfrom
feat/evtx
May 31, 2026
Merged

copyleftdev merged 1 commit into
mainfrom
feat/evtx

Conversation

@copyleftdev

Copy link
Copy Markdown
Owner

Implements the EVTX plugin — issue #13 (the binary Windows Event Log format).

What

The BinXML chunk decoding is delegated to the evtx crate, which yields one
serde_json::Value per event plus the record id and timestamp. EvtxParser
flattens each event into dotted columns (Event.System.EventID,
Event.System.Provider.#attributes.Name, Event.EventData.TargetUserName, …)
and synthesizes eventRecordId and timestampEpoch (Unix seconds, via jiff's
as_second). That gives the detectors what the issue asks for:
Event.System.EventID for rare event-ID point detection and logon dist
drift, timestampEpoch for off-hours contextual (--period 24).

Determinism

The evtx crate decodes chunks in parallel but yields records in file order,
and parsing is pure — so output is byte-identical regardless of thread count.

Feature gating

Behind the default-on evtx feature (mirrors the polars-gated binary
readers), so the text-only --no-default-features build stays lean and
dependency-light. Verified both builds compile and test.

Routing

  • Binary magic ElfFile\0 (confidence MAGIC); extension .evtx.

Testing

  • A hand-built valid empty EVTX header (4096-byte file header, no chunks)
    roundtrips to zero rows — exercising the real crate integration.
  • The per-record extraction is unit-tested via record_to_row on EVTX-shaped
    JSON (a records fixture would require committing a binary blob; the extraction
    is the only hand-written, mutation-relevant logic).
  • Bad magic / truncated input are clean AxError::Parse.

Gates

  • fmt / clippy -D warnings / full workspace tests green (default and
    --no-default-features).
  • Mutation gate: 0 surviving mutants on evtx.rs (clean first pass).

Closes #13

🤖 Generated with Claude Code

New EvtxParser in ax-normalize for the binary Windows Event Log format. The
BinXML chunk decoding is delegated to the evtx crate, which yields one
serde_json::Value per event plus the record id and timestamp; we flatten each
event into dotted columns (Event.System.EventID,
Event.System.Provider.#attributes.Name, Event.EventData.TargetUserName, ...) and
synthesize eventRecordId and timestampEpoch (Unix seconds, via jiff's
as_second). That gives Event.System.EventID for rare event-ID point detection /
logon dist drift and timestampEpoch for off-hours contextual (--period 24).

Binary magic ElfFile\0 (confidence MAGIC); extension .evtx. The evtx crate
decodes chunks in parallel but yields records in file order, so output is
deterministic. Behind the default-on evtx feature (mirrors the polars-gated
binary readers), so the text-only --no-default-features build stays lean.

Testing: a hand-built valid empty EVTX header roundtrips to zero rows (the crate
integration), the per-record extraction is unit-tested via record_to_row on
EVTX-shaped JSON (a real records fixture would need a committed binary blob), and
bad magic / truncated input are clean Parse errors.

Mutation gate: 0 surviving mutants on the new file.

Closes #13

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@copyleftdev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 50 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: baeb32c3-833f-4959-b2fd-b6494df99af7

📥 Commits

Reviewing files that changed from the base of the PR and between f358611 and 58c5b2b.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • crates/ax-normalize/Cargo.toml
  • crates/ax-normalize/src/parser.rs
  • crates/ax-normalize/src/parsers/evtx.rs
  • crates/ax-normalize/src/parsers/mod.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/evtx

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@copyleftdev
copyleftdev merged commit 2a589a1 into main May 31, 2026
2 checks passed
@copyleftdev
copyleftdev deleted the feat/evtx branch May 31, 2026 06:39
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.

Add an EVTX parser (Windows Event Log)

1 participant