Skip to content

Fix broken Sysmon EventID 1 (ProcessCreate) decoders and normalize regex patterns#908

Open
gustavo89587 wants to merge 1 commit intowazuh:masterfrom
gustavo89587:fix/windows-dhcp-space-decoder-876
Open

Fix broken Sysmon EventID 1 (ProcessCreate) decoders and normalize regex patterns#908
gustavo89587 wants to merge 1 commit intowazuh:masterfrom
gustavo89587:fix/windows-dhcp-space-decoder-876

Conversation

@gustavo89587
Copy link

This PR fixes multiple parsing issues in the Windows ruleset, mainly in Sysmon Event ID 1 (Process Create).

The previous implementation contained malformed XML in the new Sysmon decoder chain, which prevented the ruleset from loading correctly and caused EventID 1 logs to be dropped.

This PR:

  • Repairs the Sysmon EventID 1 decoder structure using proper multi-stage parsing
  • Preserves compatibility with both legacy and modern Sysmon formats
  • Fixes incorrect regex patterns that matched literal dots instead of actual data
  • Corrects several broken Terminal Services and Defender patterns

This improves reliability of Windows telemetry parsing without changing detection logic or behavior.

…gex patterns

This commit fixes multiple issues in the Sysmon EventID 1 (Process Create) decoders and related Windows decoders.

The previous implementation had malformed XML (missing <decoder> blocks) in the EventID 1 "new format" parser, which caused the ruleset to break at load time. This has been restructured into a valid multi-stage decoder chain using after_regex, preserving backward compatibility with both legacy (HashType/Hash) and modern (Hashes) Sysmon formats.

Additionally, several regex patterns were corrected:
- Replaced incorrect \.* and \.+ patterns that only match literal dots with proper wildcard captures
- Fixed broken TerminalServices-Gateway patterns (typos and invalid escapes)
- Normalized multiple Sysmon field extractions to properly handle spaces, quotes, and modern Sysmon output

The result is a fully valid ruleset that correctly parses:
- Sysmon ProcessCreate (Event ID 1) for both old and new formats
- Network, file, and module load events
- Defender and Terminal Services logs

No functional behavior was removed; this change only fixes parsing correctness and reliability.
@gustavo89587
Copy link
Author

Hi maintainers!

This PR fixes several broken decoders that are currently preventing Sysmon Event ID 1 logs from being parsed correctly.
I’ve validated the updated decoder definitions locally using wazuh-logtest against real Sysmon logs.

Could someone please review this when available?

Thanks!

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.

1 participant