event-generator: Simulating Attacks to Test Falco Security RulesArticle · digest for October 23
Dramatic late-night terminal debugging scene simulating system calls inside an isolated container to test Falco rules.
Article4 sections≈ 4 min

event-generator: Simulating Attacks to Test Falco Security Rules

Imagine this scenario: a DevSecOps team spends weeks rolling out Falco runtime security monitoring across a production Kubernetes cluster. They write dozens of custom syscall audit rules and wire up alerts through Falcosidekick to Slack and their SIEM. A whole month goes by with calm, green dashboards and zero critical alerts.

Management is thrilled, yet any seasoned engineer feels a cold creeping doubt: is this thing actually working? What if a tiny typo in a complex filter expression silently broke a rule, and an attacker is reading server configs right now while the sensors stay dead quiet?

The open-source Falco project (a CNCF graduate) tackles this exact problem with a dedicated tool called event-generator. Earlier, we looked at how repository security and exploits are evolving in modern environments. Today, let's see how to build synthetic regression testing for your Falco rules in practice.

Why You Need a Synthetic Incident Generator

event-generator has one job: reproduce in a controlled environment the exact system events and behavioral patterns that your Falco rules are supposed to catch:

  • Verifying that eBPF probes and the Linux kernel module are alive and firing;
  • Testing the full alert delivery pipeline from kernel space all the way to your SIEM;
  • Regression testing: making sure rule edits or component upgrades didn't break existing detections.

There is a catch, though. To test an alert like "attempt to overwrite a binary in /bin," the utility genuinely has to try modifying files in a system directory.

That is why the maintainers insist: run event-generator strictly inside an isolated Docker container. Running the binary directly on a host OS without containerization risks corrupting system configs and destabilizing the server.

Scenario Arsenal: From Syscalls to the Kubernetes API

The tool organizes its test scenarios into three main groups:

  1. syscall (Linux kernel system calls):
    • Reading sensitive files (/etc/shadow, /etc/sudoers);
    • Attempting to append a public key to ~/.ssh/authorized_keys;
    • Container escape attempts via namespace-switching unshare syscalls;
    • Creating pseudo-devices under /dev or hidden dot-directories;
    • Executing binaries straight from memory (memfd_create or /dev/shm);
    • Running network port scanners and recon utilities.
  2. k8saudit (Kubernetes API audit events):
    • Spinning up privileged pods with security constraints stripped;
    • Binding a ClusterRole with dangerous wildcard (*) permissions;
    • Mounting sensitive host paths (/var/run/docker.sock, root filesystem);
    • Launching pods in the node's host network namespace (hostNetwork: true).
  3. helper: lightweight auxiliary network services for generating client-server traffic.
# Continuous loop simulating suspicious syscalls inside Docker
docker run -it --rm \
  --name falco-event-tester \
  falcosecurity/event-generator run syscall --loop

# Targeted check for container-escape detection
docker run -it --rm \
  falcosecurity/event-generator run syscall.ChangeNamespacePrivilegesViaUnshare

Declarative Suites: The suite Command in v0.13

In the v0.13 release (aligned with Falco 0.44.0+), the tool gained a long-requested suite command.

Previously, all test scenarios were hardcoded in the Go source. Now engineers can define custom test suites in declarative YAML files. That makes it easy to plug event-generator straight into CI/CD: every pull request to your Falco rules repo can spin up a Kind test cluster, run the suite, and assert that the expected alerts actually fire.

# Simulate creating a privileged Kubernetes pod to test API auditing
event-generator run k8saudit.CreatePrivilegedPod
Keep test environments strictly isolated

Never run broad event-generator sweeps on live production nodes outside an isolated test namespace or dedicated sandbox cluster—the resulting alert storm can easily overwhelm your on-call SOC analysts.

Practical Takeaway

Infrastructure security is built on healthy skepticism and continuous verification. event-generator turns Falco auditing from a "black box powered by hope" into a measurable, automatically tested engineering loop where every rule has proven it can catch real synthetic attacks.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 2