Running Kubernetes in production for over six months with Falco as my last line of defense has let me sleep a lot easier during on-call shifts. If you’re operating a K8s cluster and still wondering whether runtime monitoring is worth setting up, this post shares my real-world experience—from early stumbles to configuring Falco so it runs smoothly.
A Wake-Up Call in Production Kubernetes
Six months ago, my team’s microservices stack looked pretty well armored. Every container image was scanned for vulnerabilities with Trivy before hitting the registry. Kubernetes RBAC was locked down tight, and a WAF sat in front of our Ingress. We thought we were safe—until reality hit.
One Monday morning, outbound traffic from a backend pod suddenly spiked to 5x normal levels. Digging in, we discovered the app had been hit by an RCE vulnerability in a third-party library that had just been disclosed. The attacker had broken into the container, spawned a shell, and downloaded a cryptomining script running in the background, pushing CPU usage to 95%. Worse, they were trying to read environment variables containing database secrets. For nearly two hours, our security alerting stayed completely silent.
After auditing security across more than 10 systems of various sizes, I noticed a common pattern. Most teams spend 90% of their effort locking the doors at build and deploy time. Once containers are actually running (runtime), almost everyone is flying blind.
Why Traditional Defenses Fall Short at Runtime
To see where the gap lies, look at how containers actually operate under the hood:
- Image scanning is only a point-in-time check: Scanning images in CI/CD only catches CVEs known at build time. If a new zero-day drops today, or an attacker exploits a logic flaw in your code to run system commands, image scanners are powerless.
- Kubernetes Audit Logs sit outside the container: K8s API Server logs only record cluster-level calls like creating a pod or deleting a deployment. Once an attacker comes in through your app’s HTTP endpoint to run OS commands inside the container, the K8s API has no idea.
- Containers share the Linux kernel with the host: At its core, a container is just a process isolated by namespaces and cgroups. Every action—from opening bash and reading
/etc/shadowto opening an outbound connection—must go through system calls (syscalls) sent to the Linux kernel.
Without something sitting at the kernel level listening to that stream of syscalls, a container can be compromised right under your nose.
Three Approaches to Runtime Monitoring on Kubernetes
When tackling this blind spot, I tried three different approaches:
- Writing custom scripts to collect logs and inspect processes: This is far too manual and easily degrades node performance. Pods on K8s spin up and down constantly, making it nearly impossible for homegrown scripts to keep up.
- Injecting a sidecar container into every Pod: Giving each pod its own monitoring sidecar sounds neat on paper, but it burns through RAM and CPU fast. Once a cluster grows to 200–300 pods, managing the YAML alone becomes a nightmare.
- Centralized kernel-level monitoring with Falco: Falco (a CNCF Graduated project) runs as a DaemonSet, meaning you only need one pod per node. Using eBPF, it reads syscalls directly from the Linux kernel without touching application code or attaching sidecars.
In production across our 12-node cluster, Falco has a very light footprint: under 150MB of RAM per node on average, with detection latency measured in milliseconds. The only downside that tends to discourage newcomers is that the default ruleset is quite sensitive. On day one, our team’s chat channel got flooded with over 300 false positives in just two hours because we hadn’t tuned it yet.
Installing and Tuning Falco on Kubernetes
Using the official Helm Chart is the fastest and easiest way to deploy and upgrade Falco. I chose the modern_ebpf driver for nodes running Linux kernel 5.8 or newer (with BTF enabled) so we wouldn’t have to deal with compiling kernel modules.
Step 1: Install Falco with Helm
Point kubectl at the target cluster, then run the following commands to create the falco namespace and install Falco along with Falcosidekick (which forwards alerts to Slack, Telegram, or Webhooks):
helm repo add falcosecurity https://falcosecurity.github.io/charts
helm repo update
helm upgrade --install falco falcosecurity/falco \
--namespace falco \
--create-namespace \
--set driver.kind=modern_ebpf \
--set tty=true \
--set falcosidekick.enabled=true
Wait about 1–2 minutes for Kubernetes to pull the images and spin up the DaemonSet. Then check the pod status:
kubectl get pods -n falco
Once all pods show Running (one Falco pod per worker node), the foundation is ready.
Step 2: Simulate an Attacker to Test Detection
Right after installation, verify that Falco actually catches suspicious activity. Spin up a temporary Nginx pod and try reading the sensitive /etc/shadow file:
kubectl run test-nginx --image=nginx:alpine --restart=Never
kubectl exec -it test-nginx -- sh -c "cat /etc/shadow"
Check the Falco pod logs immediately:
kubectl logs -n falco -l app.kubernetes.io/name=falco -c falco --tail=20
You should immediately see a Warning or Notice alert on screen. The log records the timestamp, the test-nginx pod name, namespace, executing user, and the exact cat /etc/shadow command you just ran. When you’re done testing, clean up the temporary pod with kubectl delete pod test-nginx.
Step 3: Write Custom Rules to Cut Down Noise
By default, Falco fires alerts even when DevOps engineers use kubectl exec to check logs or when CI/CD tools run routine tasks. To reduce noise, I created a dedicated, stricter ruleset for the production namespace.
Create a custom-rules.yaml file to catch any shell spawned (bash, sh, ash, zsh) inside pods in the production namespace:
customRules:
custom-k8s-rules.yaml: |-
- rule: Detect Shell in Production Pod
desc: Detect shell execution inside a container in the production environment
condition: >
spawned_process and
container and
k8s.ns.name = "production" and
proc.name in (bash, sh, ash, zsh)
output: >
Shell opened in production pod
(user=%user.name pod=%k8s.pod.name ns=%k8s.ns.name cmd=%proc.cmdline image=%container.image.repository)
priority: CRITICAL
tags: [container, shell, production]
Load this new rule file into your running Helm release:
helm upgrade falco falcosecurity/falco \
--namespace falco \
--reuse-values \
-f custom-rules.yaml
Step 4: Forward Alerts to Slack
Nobody has time to stare at kubectl logs all day. Since we enabled falcosidekick in Step 1, all you need to do is pass your Slack Webhook URL during a Helm upgrade:
helm upgrade falco falcosecurity/falco \
--namespace falco \
--reuse-values \
--set falcosidekick.config.slack.webhookurl="https://hooks.slack.com/services/YOUR/WEBHOOK/URL" \
--set falcosidekick.config.slack.minimumpriority="warning"
Setting minimumpriority to warning or higher is plenty. Your security Slack channel will stay clean and only ping you when something genuinely suspicious happens.
Hard-Earned Lessons Before Going to Production
- Always test new rules on staging first: A single misplaced parenthesis in a
conditionwill cause the Falco pod to crash on startup. - Think twice before enabling auto-kill on pods: Falco is strictly a detection engine. If you want automated blocking or pod isolation, you’ll need to pair it with Falco Talon or NetworkPolicy. Even then, start in alert-only mode when rolling out so a false positive doesn’t take down a live service.
- Check your nodes’ kernel versions carefully: For older Linux distros running kernels below 5.8, switch
driver.kindfrommodern_ebpftoebpf(orkmod) to avoid probe-loading failures.
Setting up Falco takes only about 15 minutes, plus a few afternoons of tuning rules to fit your workloads. In return, you get a security camera running straight inside the Linux kernel, ready to sound the alarm the second an intruder steps foot inside a container.

