File pattern matching rules using the YARA format for malware detection.
Panguard Guard uses YARA rules for file-based threat detection. YARA is the industry standard for identifying and classifying malware based on binary and textual patterns within files.
YARA rules describe patterns that identify malware families, suspicious tools, and unwanted software. Unlike Sigma rules (which match log events), YARA rules match file content — scanning executables, scripts, documents, and other files for known malicious patterns.
Add custom YARA rules by placing .yar or .yara files in the custom rules directory:
Copy
Ask AI
{dataDir}/yara-rules/custom/*.yar
Where {dataDir} defaults to ~/.panguard-guard.
Copy
Ask AI
mkdir -p ~/.panguard-guard/yara-rules/custom
Custom YARA rules are loaded on the next scan cycle. For immediate testing, run panguard scan --yara-only to trigger a targeted scan with your new rules.
When the native YARA library is not available, Panguard falls back to a JavaScript-based regex engine that provides basic pattern matching.
Feature
Detail
Performance
Adequate for small file sets
Compatibility
Supports string matching and basic conditions
Limitations
No YARA modules, limited hex pattern support
Requirements
None (built into Panguard)
The native engine is strongly recommended for production deployments. Panguard will log a warning at startup if it falls back to the regex engine. Install YARA with your package manager: brew install yara (macOS), apt install yara (Debian/Ubuntu), or yum install yara (CentOS/RHEL).
YARA scans are CPU-intensive for large files. Panguard automatically skips files larger than 50 MB by default. Adjust this with panguard config set rules.yaraMaxFileSize "100MB".