If we use Grafana Loki and Promtail as our logging aggregation tools, there is the benefit of both YARA and ClamAV scanners (which it was requested that I look into) having the ability to be connected and log to stdout or a local file.
This would be how we centralize both script output and server logs into one human-readable place.
Note that this benefit is also noted in the logging aggregation issue since it applies to both.
If we use Grafana Loki and Promtail as our logging aggregation tools, there is the benefit of both YARA and ClamAV scanners (which it was requested that I look into) having the ability to be connected and log to stdout or a local file.
Example Command: `echo "[ALERT] $(date): $(basename "$file") matched rule: $rule_name" >> /var/log/scanner.log`
- Promtail then sends `/var/log/scanner.log` to Loki.
- **This would be how we centralize both script output and server logs into one human-readable place.**
Note that this benefit is also noted in the logging aggregation issue since it applies to both.
Slightly higher learning curve, but extremely flexible
False positives
Low, but misses novel or obfuscated attacks
Depends on your rules; can detect very specific threats
Integration for OCF
Great for quick file upload checks (“is this file malicious?”)
Great for deeper inspection of PHP, JS, or plugin code (“is this suspicious?”)
Extensibility
Limited to what’s in the database
Completely customizable (you can write rules that fit OCF’s threat patterns)
## **Comparisons between ClamAV and YARA:**
| Feature | **ClamAV** | **YARA** |
| ----------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **Primary use case** | Detect *known* malware, trojans, infected binaries or webshells using a massive prebuilt signature database | Detect *custom or suspicious code patterns* (webshells, obfuscation, insecure snippets) that **you define yourself** |
| **Signatures source** | Comes with its own maintained virus definition DB (download via `freshclam`) | You write or import `.yar` rule files manually |
| **Scope** | Binary files, email attachments, generic malware | Source code, scripts, config files, anything text-based |
| **Ease of use** | Very easy: `clamscan /path` or `clamd` daemon | Slightly higher learning curve, but extremely flexible |
| **False positives** | Low, but misses novel or obfuscated attacks | Depends on your rules; can detect very specific threats |
| **Integration for OCF** | Great for quick file upload checks (“is this file malicious?”) | Great for deeper inspection of PHP, JS, or plugin code (“is this *suspicious*?”) |
| **Extensibility** | Limited to what’s in the database | Completely customizable (you can write rules that fit OCF’s threat patterns) |
Based on our objectives, we'd use ClamAV for broad, automated “known malware” screening at upload time
This tool answers the question: “Has this file been seen in the wild as malware?”
More tailored to quick, general malware filtering
YARA
Based on our objectives, we'd use YARA for custom, code-specific detection of suspicious behavior (e.g., PHP shells, eval(base64), etc.) that commonly affect WordPress uploads.
This tool answers the question: “Does this file look like a PHP backdoor or insecure script?”
More tailored to being used as our core policy and insight tool — the one that drives understanding and prevention.
In general, for the purposes of our project goals...
YARA is the better long-term fit, because:
You can define rules tailored to WordPress vulnerabilities and OCF’s past incidents.
You can evolve the rule set over time as you learn what students upload.
It complements the logging system beautifully (since YARA’s output is textual and can feed directly into Loki).
## **ClamAV**
- Based on our objectives, we'd use ClamAV for broad, automated “known malware” screening at upload time
- This tool answers the question: “Has this file been seen in the wild as malware?”
- More tailored to quick, general malware filtering
## **YARA**
- Based on our objectives, we'd use YARA for custom, code-specific detection of suspicious behavior (e.g., PHP shells, eval(base64), etc.) that commonly affect WordPress uploads.
- **This tool answers the question: “Does this file look like a PHP backdoor or insecure script?”**
- More tailored to being used as our core policy and insight tool — the one that drives understanding and prevention.
## In general, for the purposes of our project goals...
**YARA is the better long-term fit, because:**
- You can define rules tailored to WordPress vulnerabilities and OCF’s past incidents.
- You can evolve the rule set over time as you learn what students upload.
- It complements the logging system beautifully (since YARA’s output is textual and can feed directly into Loki).
Look into preset online rule sets for YARA, specifically catered to Wordpress
We can implement YARA with these rules once the Docker is done
### Meeting 3 Notes:
- Look into preset online rule sets for YARA, specifically catered to Wordpress
- We can implement YARA with these rules once the Docker is done
### Links to Preset YARA Rules for Detecting WordPress (& Other Resources):
- [Preset Rules on GitHub](https://github.com/pressidium/pressidium-yara-rules)
- [YARA Rules Guide: What They Are & How to Write Them](https://www.veeam.com/blog/yara-rules-malware-detection-analysis.html)
- [YARA's Documentation](https://yara.readthedocs.io/en/latest/)
- [How to Write YARA Rules that Minimize False Positives](https://intezer.com/blog/yara-rules-minimize-false-positives/)
This repo is archived. You cannot comment on issues.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Use the
sig-detectionbranchIf we use Grafana Loki and Promtail as our logging aggregation tools, there is the benefit of both YARA and ClamAV scanners (which it was requested that I look into) having the ability to be connected and log to stdout or a local file.
Example Command:
echo "[ALERT] $(date): $(basename "$file") matched rule: $rule_name" >> /var/log/scanner.log/var/log/scanner.logto Loki.Note that this benefit is also noted in the logging aggregation issue since it applies to both.
Comparisons between ClamAV and YARA:
freshclam).yarrule files manuallyclamscan /pathorclamddaemonClamAV
YARA
In general, for the purposes of our project goals...
YARA is the better long-term fit, because:
Meeting 3 Notes:
Links to Preset YARA Rules for Detecting WordPress (& Other Resources):