Skip to content

Add XPAV-derived detection rules for cryptominer, webshell, and container escape#343

Open
JNC4 wants to merge 1 commit intofalcosecurity:mainfrom
JNC4:xpav-detection-rules
Open

Add XPAV-derived detection rules for cryptominer, webshell, and container escape#343
JNC4 wants to merge 1 commit intofalcosecurity:mainfrom
JNC4:xpav-detection-rules

Conversation

@JNC4
Copy link

@JNC4 JNC4 commented Jan 30, 2026

Summary

This PR adds 6 new sandbox-level detection rules derived from the XPAV project, a behavioral threat detection daemon for Linux. These rules focus on threat vectors not currently covered by existing Falco rules.

New Rules

Cryptominer Detection:

  • Known Cryptominer Process Executed - Detects execution of common miner binaries (xmrig, ethminer, cgminer, etc.) by matching process names. Complements the existing stratum protocol detection rule.

Web Server Abuse (Webshell Detection):

  • Web Server Spawned Shell - Detects shells (bash, sh, etc.) spawned from web server processes (nginx, apache, php-fpm). Strong indicator of webshell exploitation.
  • Web Server Spawned Suspicious Child Process - Detects suspicious children (curl, wget, netcat, python, perl) from web servers. Indicates web application exploitation.
  • Reverse Shell from Web Server - Detects common reverse shell patterns (/dev/tcp, nc -e, python socket imports) spawned from web servers.

Container Escape:

  • Privileged Container Device Access - Detects container processes accessing raw block devices (/dev/sda, /dev/nvme, /dev/mem), which can be used to escape container isolation.
  • Container Access to Host Sensitive Paths - Detects container access to /host, /rootfs, /hostfs paths indicating exposed host filesystem.

Why These Rules?

The web server abuse rules address a significant gap in Falco's current ruleset. Webshells are one of the most common persistence mechanisms used by attackers after compromising web applications (MITRE T1505.003), yet Falco doesn't have specific detection for web server processes spawning shells or suspicious children.

Design Decisions

  • All rules tagged maturity_sandbox as appropriate for new contributions
  • Each rule includes user_known_* macros for environment-specific tuning
  • Descriptions include anti-pattern guidance and tuning recommendations
  • MITRE ATT&CK technique IDs included in all rules
  • Web server list is comprehensive but can be extended via list override

Testing

Rules have been validated for:

  • Correct syntax (falco -V)
  • Detection of intended behaviors in lab environment
  • No overlap with existing stable/incubating rules

Related

  • Detection patterns derived from: https://github.com/JNC4/xpav
  • MITRE ATT&CK: T1496 (Resource Hijacking), T1505.003 (Web Shell), T1059 (Command Interpreter), T1611 (Escape to Host)

@poiana
Copy link

poiana commented Jan 30, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JNC4
Once this PR has been reviewed and has the lgtm label, please assign darryk10 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana requested review from Kaizhe and loresuso January 30, 2026 09:14
@poiana
Copy link

poiana commented Jan 30, 2026

Welcome @JNC4! It looks like this is your first PR to falcosecurity/rules 🎉

@poiana poiana added the size/L label Jan 30, 2026
…iner escape

This PR adds 6 new detection rules derived from the XPAV project
(https://github.com/JNC4/xpav), focusing on threat vectors not
covered by existing Falco rules:

**Cryptominer Detection:**
- Known Cryptominer Process Executed: Detects common miner binaries
  (xmrig, ethminer, etc.) - complements existing stratum protocol rule

**Web Server Abuse (Webshell Detection):**
- Web Server Spawned Shell: Detects shells spawned from nginx/apache/php-fpm
- Web Server Spawned Suspicious Child: Detects curl/wget/nc from web servers
- Reverse Shell from Web Server: Detects common reverse shell patterns

**Container Escape:**
- Privileged Container Device Access: Detects raw block device access
- Container Access to Host Sensitive Paths: Detects /host /rootfs access

All rules include:
- MITRE ATT&CK technique mapping
- Tuning macros (user_known_*) for customization
- Detailed descriptions with anti-pattern guidance
- Appropriate priority levels

These rules address the gap in web server/webshell detection which
is a common attack vector not currently covered by Falco's ruleset.

Signed-off-by: Julius C <jnc4mail@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants