Skip to content

feat: Sigma detection processing via Zircolite#544

Merged
kevoreilly merged 2 commits intoCAPESandbox:masterfrom
wmetcalf:feat/sigma-processing
Mar 11, 2026
Merged

feat: Sigma detection processing via Zircolite#544
kevoreilly merged 2 commits intoCAPESandbox:masterfrom
wmetcalf:feat/sigma-processing

Conversation

@wmetcalf
Copy link
Contributor

Summary

  • Add modules/processing/sigma.py - processing module that scans EVTX and Sysmon logs against Sigma rulesets using Zircolite
  • Add modules/signatures/all/sigma_events.py - behavioral signature that promotes sigma detections into the signatures view with MITRE ATT&CK TTP mapping
  • Add data/sigma/filters.json - JSON-based filter system for suppressing sandbox-caused false positives (per-package, per-event/detection scope, regex field matching with boolean logic)
  • Add systemd/cape-sigma-update.service and .timer - daily automatic Sigma rule updates via Zircolite
  • Add docs/sigma-integration.md - installation, configuration, and troubleshooting guide

Features

  • Configurable Zircolite path and multiple comma-separated rulesets via processing.conf
  • Per-package rule suppression via [sigma_suppress_rules] config section
  • Advanced JSON filter system with regex field matching, boolean match_logic expressions, event vs detection scope, suppress and set_score actions
  • Security hardening: zip slip protection, symlink rejection, zip bomb limits (5GB), 50MB output cap, subprocess timeout

Requirements

  • Zircolite installed at configurable path (default /opt/zircolite/)
  • EVTX auxiliary module enabled (collects Windows event logs)
  • Optional: Sysmon auxiliary module for additional coverage
  • Companion PR needed in core CAPEv2 for web UI eventlogs template and enhanced evtx.py collector

Add sigma processing module that scans EVTX and Sysmon logs against
Sigma rulesets using Zircolite. Includes JSON-based filter system for
suppressing sandbox false positives, per-package rule suppression,
configurable rulesets, and security hardening (zip slip protection,
zip bomb limits, symlink rejection, output caps).

New files:
- modules/processing/sigma.py - main processing module
- modules/signatures/all/sigma_events.py - behavioral signature
- data/sigma/filters.json - default sandbox FP filters
- systemd/cape-sigma-update.service/.timer - daily rule updates
- docs/sigma-integration.md - install and configuration guide
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands CAPEv2's detection capabilities by integrating Sigma rules via Zircolite. It introduces new modules for processing and managing Sigma detections, along with a flexible filter system to reduce false positives. The inclusion of automatic rule updates and detailed documentation ensures ease of use and maintainability.

Highlights

  • Sigma Rule Integration: This PR introduces Sigma rule detection processing using Zircolite, enhancing CAPEv2's malware analysis capabilities by scanning EVTX and Sysmon logs against Sigma rulesets.
  • New Modules and Data: It adds a processing module (modules/processing/sigma.py), a signature module (modules/signatures/all/sigma_events.py), and a filter system (data/sigma/filters.json) to manage and suppress false positives.
  • Automatic Updates: The PR includes systemd service and timer files for daily automatic Sigma rule updates, ensuring the rulesets are current.
  • Documentation: A comprehensive guide (docs/sigma-integration.md) is added, detailing installation, configuration, and troubleshooting for the Sigma integration.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Activity
  • Added processing module for Sigma rule detection.
  • Implemented signature module to promote Sigma detections.
  • Introduced JSON-based filter system for suppressing false positives.
  • Added systemd service and timer for automatic Sigma rule updates.
  • Created documentation for Sigma integration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

wmetcalf added a commit to wmetcalf/CAPEv2 that referenced this pull request Mar 10, 2026
Enhanced evtx.py auxiliary module:
- Collect 20+ additional Windows event log channels (PowerShell,
  Defender, BITS, Firewall, NTLM, AppLocker, WMI, Task Scheduler, etc.)
- Enable command line logging (ProcessCreationIncludeCmdLine_Enabled)
- Configure log sizes (100MB per channel)
- Use audit policy GUIDs instead of English names (non-English support)
- Quote channel names in wevtutil calls

New event logs web UI:
- Three-tab layout: Sigma Detections, Sysmon Events, EVTX Events
- Sigma tab shows rule title, severity, ID, description, matched events
- Sigma query shown on expand (not cluttering collapsed view)
- Severity badge coloring (critical/high/medium/low/informational)
- MITRE ATT&CK technique display per detection

Systemd units for daily Sigma rule updates via Zircolite.

Companion to CAPESandbox/community#544 which adds the sigma processing
module and behavioral signature.
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive Sigma detection processing capability via Zircolite, enhancing CAPEv2's ability to analyze EVTX and Sysmon logs for threats. The implementation includes robust features such as configurable rulesets, per-package rule suppression, and an advanced JSON-based filter system with regex matching and boolean logic. Security hardening measures like zip slip protection and zip bomb limits are commendable additions. The documentation is clear and thorough, guiding users through installation, configuration, and troubleshooting. Overall, this is a well-designed and significant feature addition.

Group=cape
WorkingDirectory=/opt/zircolite
ExecStart=/etc/poetry/bin/poetry --directory /opt/CAPEv2/ run python zircolite.py --update-rules
ExecStartPost=/bin/bash -c 'for f in /opt/zircolite/rules/*.json; do dest="/opt/CAPEv2/data/sigma/$(basename "$f")"; [ -f "$dest" ] && cp "$f" "$dest"; done'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The ExecStartPost command for copying Sigma rules only copies a file if the destination file already exists ([ -f "$dest" ]). This logic might prevent newly added Sigma rule JSON files (that didn't exist in data/sigma previously) from being copied from the Zircolite rules directory to the CAPEv2 data directory. It's generally safer to copy all updated rules, regardless of whether a corresponding file already exists at the destination, to ensure all new rules are deployed.

ExecStartPost=/bin/bash -c 'for f in /opt/zircolite/rules/*.json; do dest="/opt/CAPEv2/data/sigma/$(basename "$f")"; cp "$f" "$dest"; done'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in eec91df — removed the [ -f "$dest" ] guard so newly generated rulesets are also copied to data/sigma/.

Remove the [ -f "$dest" ] guard so newly generated rulesets from
Zircolite are also deployed to data/sigma/.
@kevoreilly kevoreilly merged commit acd45cf into CAPESandbox:master Mar 11, 2026
2 checks passed
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