Falco Runtime Security for Kubernetes

The security landscape of cloud-native environments is characterized by extreme dynamism and a high volume of ephemeral assets, creating a necessity for visibility that extends beyond static configuration analysis. Falco serves as a cloud-native security tool that provides runtime security across hosts, containers, Kubernetes, and broader cloud environments. It is specifically engineered to detect and alert on abnormal behavior and potential security threats in real-time. At its architectural core, Falco operates as a monitoring and detection agent that observes events—primarily Linux kernel events and other data sources processed through plugins—and delivers real-time alerts based on a set of custom rules.

To ensure these alerts are actionable, Falco enhances raw events by integrating contextual metadata derived from container runtimes and Kubernetes. This allows security operators to see not just that a system call occurred, but which specific pod, namespace, and container were involved in the event. Falco was created in 2016 by Sysdig and subsequently donated to the Cloud Native Computing Foundation (CNCF) in 2017. Its maturity and industry adoption were formally recognized when it became a CNCF graduated project in 2024.

The implementation of Falco addresses the fundamental challenges of the cloud era, where flexibility and dynamism in application development introduce new security vulnerabilities. By providing deep visibility into the runtime, Falco helps organizations protect their workloads from zero-day bugs and software supply chain compromises. This capability is why 60% of Fortune 500 companies utilize Falco for threat detection, deploying it across major cloud platforms and large-scale on-premise installations.

Architectural Foundations and Technical Vision

Falco is built upon a heritage of detection and forensics, drawing from the same technical vision that led to the creation of Wireshark over twenty years ago. This vision centers on the necessity of observing exactly what is happening within hosts and containers to ensure security. Falco translates this approach into the cloud-native era by monitoring events coming from Linux kernel events, such as system calls, which are the primary interface between applications and the underlying hardware.

The system is designed to be multi-platform, running on both x64 and ARM CPUs, ensuring compatibility across a wide array of hardware architectures. Its technical implementation leverages eBPF (extended Berkeley Packet Filter) to monitor system activity for adverse behavior, allowing for high-performance telemetry without requiring heavy modifications to the kernel.

In addition to kernel-level monitoring, Falco expands its visibility through the following data sources:

  • Kubernetes audit logs, which are monitored with event source and data enrichment to detect API-level threats.
  • Cloud events, which are monitored through APIs and specific Falco plugins.
  • Third-party integrations via plugins that monitor cloud services such as GitHub, Okta, or AWS CloudTrail.

Deployment Strategies and Prerequisites

When deploying Falco within a Kubernetes environment, the choice of installation method significantly impacts the security posture and isolation of the tool. There are two primary architectural patterns for deployment.

The most secure approach is to install Falco directly on the host system. This method ensures that Falco remains isolated from the Kubernetes cluster. In the event that the Kubernetes environment is compromised, the security agent remains untouched and capable of reporting the breach. In this configuration, Falco alerts can be consumed via read-only agents running within Kubernetes.

Alternatively, Falco can be run directly within Kubernetes. While this simplifies deployment and management via Kubernetes primitives, it means that if the cluster is fully compromised, the isolation between the security tool and the compromised environment is reduced.

To get started with a Kubernetes-based deployment, the following prerequisites must be met:

  • A functioning Kubernetes setup (this can be a managed service like AWS EKS, Google GKE, Azure AKS, or a local installation using minikube).
  • The kubectl command-line tool installed on the client machine.
  • Helm, the Kubernetes package manager, installed on the client machine.

The installation process via Helm involves adding the official falcosecurity repository and updating the local chart cache:

helm repo add falcosecurity https://falcosecurity.github.io/charts

helm repo update

Runtime Threat Detection and Rule Engine

The primary value of Falco lies in its ability to identify security threats, potential compliance violations, and suspicious or anomalous activity through a rule-based engine. Falco provides a set of default threat detection rules that are ready for use out-of-the-box, though these can be tuned and customized to meet the specific needs of a given environment. These default rules are maintained in a public repository at https://github.com/falcosecurity/falco/tree/master/rules.

Falco's streaming approach to detection is a fundamental layer of defense. By analyzing events in real-time rather than relying on logs after the fact, Falco minimizes storage costs and complexity while enabling a rapid response to attacks. This is particularly critical for detecting zero-day bugs in the software supply chain where traditional signature-based detection fails.

The following table summarizes the core capabilities provided by the Falco rule engine:

Capability Description Impact
Real-Time Detection Streaming analysis of unexpected behavior and configuration changes. Minimizes the window between compromise and detection.
Custom Rule Support Ability to implement community-created or organization-specific rules. Allows for tailoring security to specific application behaviors.
Data Enrichment Integration of Kubernetes and container runtime metadata into alerts. Provides immediate context (pod, namespace) for faster incident response.
Multi-Source Monitoring Integration of kernel events, audit logs, and cloud APIs. Eliminates blind spots across the entire cloud-native stack.

Practical Detection Scenarios and Analysis

Falco's effectiveness is demonstrated through its ability to detect specific, high-risk behaviors within a Kubernetes cluster. The following scenarios illustrate how Falco translates kernel and API events into security alerts.

Terminal Shell Spawning in Pods

One of the most common indicators of a compromise is the spawning of a terminal shell within a running pod. This is often an indicator that an attacker has gained execution capabilities and is attempting to interact with the container manually.

To replicate this scenario, a user might execute the following command:

kubectl exec -it mysql-db-d5dc6b85d-77hrm -- bash -il

Falco detects this event and generates a notice. The resulting detection log provides a detailed breakdown of the event:

18:08:40.584075795: Notice A shell was spawned in a container with an attached terminal (user=root user_loginuid=-1 k8s.ns=default k8s.pod=mysql-db-d5dc6b85d-77hrm container=3fc8155f9d1a shell=bash parent=runc cmdline=bash -il terminal=34816 container_id=3fc8155f9d1a image=mysql) k8s.ns=default k8s.pod=mysql-db-d5dc6b85d-77hrm container=3fc8155f9d1a

This alert is critical because it identifies the user (root), the specific pod (mysql-db-d5dc6b85d-77hrm), the namespace (default), and the shell used (bash), allowing the security team to pinpoint the exact point of entry.

Kubernetes API Server Reconnaissance

Attackers often use reconnaissance tools to map the permissions and structure of a Kubernetes environment. A prime example is the use of kube-recon, a tool designed for initial reconnaissance.

The simulation involves running the tool as follows:

kubectl run kuberecon --tty -i --image octarinesec/kube-recon

Once inside the container, the attacker runs the reconnaissance tool:

./kube-recon

The tool performs several actions, including testing K8S API permissions, running Nmap on discovered IPs, and attempting to download an EICAR test file. Falco monitors these attempts to contact the Kubernetes API Server from within a container and triggers an alert, effectively stopping the reconnaissance phase of an attack.

Namespace Change and Privilege Escalation

Attempts to change a program or thread's namespace are highly suspicious and often associated with container escape attempts. This is typically detected when a program attempts to use the setns system call.

To test this, a user might download and run the amicontained tool:

cd /tmp; curl -L -o amicontained https://github.com/genuinetools/amicontained/releases/download/v0.4.7/amicontained-linux-amd64; chmod 555 amicontained; ./amicontained

The amicontained tool checks for namespaces, AppArmor profiles, and capabilities. Falco detects the namespace change attempt and generates a critical notice:

18:43:37.288344192: Notice Namespace change (setns) by unexpected program (user=root user_loginuid=-1 command=amicontained parent=bash k8s.ns=default k8s.pod=kuberecon container=c6112967b4f2 container_id=c6112967b4f2 image=octarinesec/kube-recon:latest) k8s.ns=default k8s.pod=kuberecon container=c6112967b4f2

In high-load environments, Falco may also report internal system events, such as syscall drops, which indicate that the system is under extreme pressure:

Mon Nov 9 18:43:37 2020: Falco internal: syscall event drop. 9 system calls dropped in last second.

18:43:37.970973376: Critical Falco internal: syscall event drop. 9 system calls dropped in last second. (ebpf_enabled=0 n_drops=9 n_drops_buffer=0 n_drops_bug=0 n_drops_pf=9 n_evts=15232)

Comprehensive Analysis of Runtime Security Impact

The implementation of Falco within a Kubernetes ecosystem transforms the security model from a perimeter-based approach to a runtime-centric approach. Traditional security often focuses on "shifting left"—scanning images for vulnerabilities and auditing manifests for misconfigurations. While these are necessary, they are insufficient because they cannot detect threats that emerge after a container has started.

Falco fills this gap by providing an "observability-driven security" model. The impact of this is evident in several key areas:

First, the reduction of security blind spots is significant. By monitoring system calls directly from the kernel, Falco can detect anomalies that do not appear in application logs. For example, if a process suddenly starts modifying sensitive files in /etc or opens an unexpected network connection, Falco triggers an alert immediately.

Second, the integration of contextual metadata prevents "alert fatigue." A raw system call alert stating that a file was opened is useless in a cluster with thousands of containers. By enriching the alert with the pod name, namespace, and image version, Falco allows operators to immediately categorize the event.

Third, the open-source nature of the project ensures that the threat detection logic is not a "black box." Because the rules are community-driven and auditable, organizations can verify exactly what behaviors are being flagged and can extend the ruleset to cover proprietary application behaviors.

Finally, the use of eBPF allows Falco to maintain a low performance overhead while providing deep visibility. This is crucial for production environments where security cannot come at the cost of application latency. The ability to deploy via Helm and integrate with existing cloud-native stacks (GKE, EKS, AKS) makes it a scalable solution for organizations of all sizes.

Sources

  1. Infracloud - Introduction to Kubernetes Security with Falco
  2. Falco Documentation
  3. Sysdig - What is Falco
  4. Sysdig - Open Source Falco
  5. Falco Official Website

Related Posts