Skip to main content
Now that Falco is installed on your cluster nodes, you can detect and alert on suspicious behavior. This guide walks you through verifying the installation, testing Falco with an nginx pod, and writing custom rules.

Prerequisites

  • A running Kubernetes cluster
  • Falco installed on each node (via systemd or DaemonSet)
  • kubectl configured to communicate with your cluster

1. Verifying Falco Installation

First, ensure Falco is active on each node. If you installed Falco directly on the host:
You should see output similar to:
If Falco is deployed as a DaemonSet, use kubectl get pods -n falco-driver-loader to verify all Falco pods are running.

2. Deploying and Testing with nginx

  1. Deploy an nginx pod
    Expected response:
  2. Check pod status and its node
  3. Stream Falco logs
    In a separate terminal, SSH into the node running the nginx pod:
  4. Trigger an alert
    Back in your first terminal, open a shell inside the nginx container:
    Inside the container, read a sensitive file:
Falco will immediately log alerts for the shell spawn and file access events.

3. Falco Architecture

The image is a diagram illustrating the architecture of Falco, showing the interaction between applications, system calls, the Falco kernel module, eBPF, libraries, policy engine, and Falco rules, leading to various outputs.
This diagram shows:
  • Applications generate system calls
  • Falco’s kernel module/eBPF captures events
  • Libraries forward events to the policy engine
  • Rules define alert conditions
  • Outputs include stdout, alerts, notifications

4. Falco Rules Overview

Falco rules are defined in a YAML file. Each file can include:
  • rules: Alert definitions
  • lists: Named collections of values
  • macros: Reusable filter expressions

4.1 Anatomy of a Rule

Every rule requires these five keys:
Example
Built-in rule that detects a shell inside a container:

5. Creating a Custom Rule

Let’s write a simple rule to catch any shell launched in a container:

6. Sysdig Filters Reference

Falco evaluates these filters against each captured system event.

7. Extending Detection with Lists

To monitor multiple shell types, define a list:
Update the rule to reference the list:

8. Simplifying with Macros

Falco’s built-in macro container is shorthand for container.id != host. Use it to make rules more concise:
For a complete list of macros and filters, see the Falco documentation.

Watch Video

Practice Lab