# Falco Runtime Security

> Falco for container runtime security with Sidekick for alerts.

- Category: Security & Networking
- Difficulty: advanced
- Components: falco, falcosidekick, falcosidekick-ui
- Tags: falco, runtime-security, container-security, monitoring, alerting
- Source: https://docker.recipes/security/falco-runtime-security

## Overview

Falco is an open-source runtime security tool originally developed by Sysdig and now maintained by the Cloud Native Computing Foundation (CNCF). It acts as a behavioral activity monitor designed to detect anomalous activity in applications by monitoring kernel system calls and alerting on suspicious behaviors based on configurable rules. Falco excels at identifying container escapes, privilege escalations, unauthorized file access, and network anomalies in real-time.

This stack combines Falco's core detection engine with Falcosidekick, which serves as an event forwarding hub that can route Falco alerts to over 50 different outputs including Slack, PagerDuty, Elasticsearch, and webhooks. The Falcosidekick UI provides a web-based dashboard for visualizing security events, viewing rule violations, and analyzing threat patterns over time. Together, these components create a comprehensive runtime security monitoring solution that not only detects threats but also ensures they reach the right people through appropriate channels.

Security teams at organizations running containerized workloads will find this stack invaluable for maintaining runtime visibility and compliance. Unlike static security scanning tools that only analyze images before deployment, this combination provides continuous monitoring of actual runtime behavior, making it essential for detecting zero-day exploits, insider threats, and sophisticated attacks that bypass traditional perimeter defenses. The multi-channel alerting ensures critical security events never go unnoticed.

## Features

- Real-time kernel syscall monitoring with eBPF and kernel module drivers for comprehensive container behavior analysis
- Pre-built detection rules for MITRE ATT&CK techniques including container escapes, privilege escalation, and lateral movement
- Multi-output alert routing through Falcosidekick supporting Slack, Teams, PagerDuty, SIEM systems, and custom webhooks
- Web-based security dashboard with event visualization, rule violation statistics, and historical trend analysis
- Custom rule engine supporting Falco's domain-specific language for creating organization-specific security policies
- Integration with container orchestrators including Docker, Kubernetes, and containerd for runtime context enrichment
- JSON-formatted structured logging with detailed process genealogy and container metadata for forensic analysis
- High-performance event processing capable of monitoring thousands of containers with minimal performance impact

## Use cases

- Enterprise security teams implementing runtime threat detection for production Kubernetes clusters and container environments
- Financial institutions requiring real-time monitoring for regulatory compliance and detecting unauthorized access to sensitive data
- DevSecOps teams building security-first CI/CD pipelines with runtime behavioral analysis and automated incident response
- Cloud service providers offering managed container platforms with built-in security monitoring and tenant isolation verification
- Healthcare organizations protecting HIPAA-compliant containerized applications from insider threats and data exfiltration
- Government agencies monitoring classified workloads for advanced persistent threats and supply chain attacks
- Managed service providers delivering security operations center (SOC) services with centralized threat detection across multiple clients

## Prerequisites

- Linux host with kernel headers installed and either eBPF support (kernel 4.14+) or ability to load kernel modules
- Docker Engine with privileged container support enabled for Falco's kernel-level system call monitoring
- Minimum 512MB RAM for Falco engine plus additional memory based on container density and event volume
- Understanding of Linux system calls, container security concepts, and familiarity with security incident response procedures
- Network access on ports 2801 (Falcosidekick API) and 2802 (Falcosidekick UI) with appropriate firewall configurations
- Administrative privileges to mount host filesystems and access Docker socket for comprehensive container visibility

## docker-compose.yml

```yaml
services:
  falco:
    image: falcosecurity/falco:latest
    container_name: falco
    restart: unless-stopped
    privileged: true
    volumes:
      - /var/run/docker.sock:/host/var/run/docker.sock:ro
      - /dev:/host/dev:ro
      - /proc:/host/proc:ro
      - /boot:/host/boot:ro
      - /lib/modules:/host/lib/modules:ro
      - /usr:/host/usr:ro
      - /etc:/host/etc:ro
    networks:
      - falco-network

  falcosidekick:
    image: falcosecurity/falcosidekick:latest
    container_name: falcosidekick
    restart: unless-stopped
    ports:
      - "${SIDEKICK_PORT:-2801}:2801"
    environment:
      - WEBUI_URL=http://falcosidekick-ui:2802
    depends_on:
      - falco
    networks:
      - falco-network

  falcosidekick-ui:
    image: falcosecurity/falcosidekick-ui:latest
    container_name: falcosidekick-ui
    restart: unless-stopped
    ports:
      - "${UI_PORT:-2802}:2802"
    depends_on:
      - falcosidekick
    networks:
      - falco-network

networks:
  falco-network:
    driver: bridge
```

## .env

```bash
# Falco Runtime Security
SIDEKICK_PORT=2801
UI_PORT=2802
```

## Usage notes

- Sidekick UI at http://localhost:2802
- Requires privileged mode
- Monitors syscalls in real-time
- Configure alerting outputs in Sidekick

## Troubleshooting

- Falco fails to start with 'unable to load kernel module': Install kernel headers matching your kernel version or enable eBPF support with FALCO_BPF_PROBE environment variable
- High CPU usage and performance degradation: Tune Falco rules to reduce noise by disabling overly verbose rules or adjusting syscall sampling rates in falco.yaml configuration
- Falcosidekick UI shows no events despite Falco running: Verify Falco is configured to send events to Falcosidekick by adding '--http_output.url=http://falcosidekick:2801' to Falco startup parameters
- Permission denied errors accessing /dev, /proc, or /sys: Ensure Falco container runs in privileged mode and all required host paths are mounted with appropriate read permissions
- Missing events from specific containers: Check that Docker socket is properly mounted and Falco has visibility into the container runtime by verifying /var/run/docker.sock accessibility
- Falcosidekick webhook delivery failures: Configure retry policies and verify target endpoint SSL certificates, network connectivity, and authentication credentials in Falcosidekick environment variables

