In this hands-on guide, you’ll learn how to install Falco on an Ubuntu VM running a Kubernetes cluster, generate security alerts, and view them directly in your terminal. Falco is a runtime security tool for detecting anomalous activity in your containers and hosts.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Ubuntu-based virtual machine (18.04+).
- Kubernetes cluster up and running.
kubectlconfigured to talk to your cluster.- Root or sudo privileges.
1. Install Falco on Ubuntu
First, add the Falco repository, import its GPG key, update package lists, install kernel headers, and then install Falco:Installing kernel headers is required for the Falco DKMS module to build against your running kernel.
2. Verify the Installation
-
Check Falco service status
Falco may run as a daemon or via a container, depending on your setup.
-
Inspect the configuration directory
You should see:
File/Directory Description falco_rules.yaml Default rule definitions falco_rules.local.yaml Local overrides for custom rules k8s_audit_rules.yaml Kubernetes audit-event rules rules.available/ Available community-contributed rules rules.d/ Custom rule fragments -
Stream Falco logs
3. Generate a Kubernetes Alert
Open two terminal windows:-
Terminal A: Stream Falco logs
-
Terminal B: Trigger an alert
%proc.cmdline, %user.name, %container.name, %k8s.pod.name, %k8s.ns.name, and %container.image.
4. Inspect the Alert Rule
Falco’s built-in rules are defined infalco_rules.yaml. To view the rule that detects terminal shells in containers:
in_container and lists such as shell_binaries are defined elsewhere in the configuration. For full details on writing and customizing rules, see the Falco documentation.
5. Next Steps
We recommend integrating Falco with a centralized dashboard or SIEM to manage alerts at scale. In the next tutorial, we’ll cover:- Deploying Falco Manager and Falco Plugins.
- Sending alerts to a web UI (e.g., Grafana, Kibana).
- Custom rule authoring for advanced threat detection.