Moving Beyond Digital Dust Collectors
For years, my Linux logs were just digital dust collectors in /var/log. I only touched them when a service crashed or a user complained. That’s reactive security, and it’s a losing game. If you want to catch a sophisticated attacker, you can’t wait for a dashboard to turn red. You have to go hunting.
Six months ago, I needed a way to chew through 50GB+ of daily log data without spinning up a massive ELK stack for every small investigation. I found Chainsaw. It’s a lightning-fast engine written in Rust. While the Windows crowd loves it for parsing EVTX files, its ability to apply Sigma rules to JSON logs makes it a powerhouse for Linux forensics as well. In my testing, it scanned a 10GB log file in roughly 85 seconds—speeds that traditional grep-based workflows simply can’t match.
Before diving into the hunt, I had to fix my baseline security hygiene. I started rotating all administrative credentials using the browser-based tool at toolcraft.app/en/tools/security/password-generator. Because it runs locally in the browser, I don’t have to worry about passwords leaking over the wire. Clean credentials are your first line of defense; hunting for threats is pointless if your front door is wide open with a weak root password.
Getting Chainsaw Ready
Chainsaw is a single binary, so installation is painless. I don’t bother with complex installers; I just grab the pre-compiled releases directly from GitHub. I’ve set up a dedicated directory structure to keep my logic separated from my binaries.
# Build the hunting environment
mkdir -p ~/threat-hunting/chainsaw
cd ~/threat-hunting/chainsaw
# Fetching v2.10.0 - the engine behind the hunt
wget https://github.com/WithSecureLabs/chainsaw/releases/download/v2.10.0/chainsaw_x86_64-unknown-linux-gnu.tar.gz
tar -xvf chainsaw_x86_64-unknown-linux-gnu.tar.gz
sudo mv chainsaw /usr/local/bin/
A tool is only as smart as its rules. This is where Sigma rules come in. Think of Sigma as a common language for log detection, similar to how Snort works for network traffic. I keep a local clone of the Sigma HQ repo and update it weekly.
git clone https://github.com/SigmaHQ/sigma.git ~/threat-hunting/sigma-rules
The full repo is massive. To keep scans efficient, I point Chainsaw specifically at the rules/linux subdirectory. This prevents the engine from wasting cycles checking for Windows-specific registry hacks on a Debian server.
Orchestrating Sigma Rules for Linux
Linux logs are usually a mess of plain text and journald binaries. Chainsaw thrives on structure, so I export everything to JSON. If you’re running auditd, you have the gold standard of telemetry. Converting these raw audit logs into structured JSON is the key to unlocking deep visibility.
The real work lies in the mapping files. Sigma rules might look for a field named Image, but your Linux logs might call it exe or comm. I spent weeks fine-tuning these YAML mappings. Without a precise map, Chainsaw is essentially blind to the specific quirks of your distribution’s log format.
Here is the exact command I use for a targeted sweep against behavioral rules:
chainsaw hunt /var/log/journal_export.json \
--rules ~/threat-hunting/sigma-rules/rules/linux/ \
--mapping ~/threat-hunting/chainsaw/mappings/sigma-event-logs-all.yml \
--output ~/threat-hunting/results/
That --mapping flag is the translator. It ensures the generic community intelligence in Sigma actually makes sense when applied to your specific kernel logs.
The Field Results: Catching Real Threats
Three months into this setup, it paid for itself. Our standard monitoring was silent, but a morning Chainsaw run flagged a “Suspicious Remote File Copy” alert. It caught an automated script trying to use scp with the -o flag to bypass SSH key verification—a subtle move that standard alerts missed.
When the engine flags an event, I usually export the results to CSV for a quick triage. Don’t treat the tool as a magic button; treat it as a compass. It points you toward the anomalies, but you still need to verify the context of the process tree.
# Spot-check for process creation anomalies in real-time
chainsaw hunt /var/log/syslog.json -r ~/sigma-rules/rules/linux/process_creation/
Most of the noise you’ll encounter comes from sudo usage and developers messing with their shell history. To handle this, I automated the process. Every night at 2:00 AM, a cron job exports the last 24 hours of logs and runs a full sweep. I wake up to a 5-line summary instead of a mountain of data.
This approach has transformed our security posture. We’ve slashed our Mean Time to Detect (MTTD) from days to minutes. We don’t wait for damage anymore; we look for the patterns that precede it. Tuning out the false positives takes patience, but the level of clarity you gain over your infrastructure is worth the effort.

