هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
Know it before you install
The driver (modern eBPF, the default) sends kernel events to Falco. Rules (YAML) have a condition (with macros and lists), an output text and a priority. Falco ships a ready rule set; you add your own in local files. Outputs send alerts to stdout/journald, files, HTTP, or through Falcosidekick to Slack, Teams, SIEMs and more.
| Item | Value |
|---|---|
| Package | falco (repository falco.org / download.falco.org) |
| Service | falco-modern-bpf.service (modern eBPF driver) |
| Config | /etc/falco/falco.yaml |
| Rules | /etc/falco/falco_rules.yaml (shipped, do not edit), /etc/falco/falco_rules.local.yaml and /etc/falco/rules.d/ (yours) |
| Rule updates | falcoctl (falcoctl-artifact-follow.service) |
| Needs | a kernel with BTF (most kernels ≥ 5.8, RHEL 9/10, Ubuntu 22.04+) |
Install on RHEL, Rocky, Alma and Fedora
rpm --import https://falco.org/repo/falcosecurity-packages.asc
curl -fsSL -o /etc/yum.repos.d/falcosecurity.repo https://falco.org/repo/falcosecurity-rpm.repo
FALCO_FRONTEND=noninteractive FALCO_DRIVER_CHOICE=modern_ebpf dnf -y install falco
systemctl enable --now falco-modern-bpf.service
journalctl -u falco-modern-bpf -n 20Install on Ubuntu and Debian
curl -fsSL https://falco.org/repo/falcosecurity-packages.asc | gpg --dearmor -o /usr/share/keyrings/falco-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/falco-archive-keyring.gpg] https://download.falco.org/packages/deb stable main" > /etc/apt/sources.list.d/falcosecurity.list
apt-get update
FALCO_FRONTEND=noninteractive FALCO_DRIVER_CHOICE=modern_ebpf apt-get install -y falco
systemctl enable --now falco-modern-bpf.serviceThe two variables skip the driver dialog and choose the modern eBPF driver (no kernel module to build).
First configuration: outputs
Change these parts of falco.yaml — JSON alerts are easy for log tools and SIEMs:
json_output: true
json_include_output_property: true
priority: notice
stdout_output:
enabled: true
file_output:
enabled: true
keep_alive: false
filename: /var/log/falco/events.json
http_output:
enabled: false
url: http://127.0.0.1:2801/
rules_files:
- /etc/falco/falco_rules.yaml
- /etc/falco/falco_rules.local.yaml
- /etc/falco/rules.d| Setting | Why |
|---|---|
json_output | One JSON object per alert — easy to ship to Loki, Elasticsearch or a SIEM. |
priority: notice | Ignore lower-priority rules (less noise). |
file_output | A local file a log shipper (Fluent Bit, Alloy) can read. |
http_output → Falcosidekick | Send alerts to Slack, Teams, Alertmanager, Elasticsearch, … |
rules_files order | Your local files come after the shipped rules, so they can change them. |
Test it: start a shell in a container and read a sensitive file — Falco should alert:
docker run --rm -it alpine sh -c 'cat /etc/shadow'
journalctl -u falco-modern-bpf -n 5 --output cat
{"output":"… Sensitive file opened for reading by non-trusted program (file=/etc/shadow … container_name=…)","priority":"Warning","rule":"Read sensitive file untrusted", …}Your own rule
Alert on any shell in the containers of the shop namespace (or with the shop image), and on writes below /etc inside containers:
- list: shell_binaries_shop
items: [bash, sh, zsh, ash, dash]
- rule: Shell in shop container
desc: A shell started inside a shop container (possible attack or manual change)
condition: >
spawned_process and container
and proc.name in (shell_binaries_shop)
and (k8s.ns.name = "shop" or container.image.repository endswith "/shop")
output: >
Shell in shop container (user=%user.name cmd=%proc.cmdline container=%container.name
image=%container.image.repository pod=%k8s.pod.name ns=%k8s.ns.name)
priority: WARNING
tags: [container, shell, mitre_execution]
- rule: Write below etc in container
desc: A process in a container wrote a file below /etc
condition: open_write and container and fd.name startswith /etc/
output: File below /etc written in container (file=%fd.name cmd=%proc.cmdline container=%container.name)
priority: ERROR
tags: [container, filesystem, mitre_persistence]Check the rules, then restart:
Tune noise without editing the shipped file — append an exception to an existing rule in your local file:
- rule: Read sensitive file untrusted
exceptions:
- name: backup_agent
fields: [proc.name, fd.name]
values:
- [restic, /etc/shadow]
override:
exceptions: appendKubernetes install
In a cluster, Falco runs as a DaemonSet (one Pod per node) — with Falcosidekick and its UI:
helm repo add falcosecurity https://falcosecurity.github.io/charts
helm repo update
helm upgrade --install falco falcosecurity/falco -n falco --create-namespace --set driver.kind=modern_ebpf --set falcosidekick.enabled=true --set falcosidekick.webui.enabled=true --set tty=true
kubectl -n falco get pods
kubectl -n falco logs -l app.kubernetes.io/name=falco -c falco --tail 20Custom rules go in the chart values (customRules:).
Daily use: the commands and the real uses
journalctl -u falco-modern-bpf -f
tail -f /var/log/falco/events.json | jq -r '.priority + " " + .rule'
falco --list | head
falco -L | grep -i shell
falcoctl artifact list
falcoctl artifact install falco-rules:4
systemctl status falcoctl-artifact-followReal uses at work:
- Detect attacks at runtime: shells in containers, reverse shells, privilege escalation, crypto miners, reads of secrets.
- Compliance evidence (PCI, SOC 2): file integrity and process monitoring.
- Feed a SIEM / incident response; with Falco Talon or other tools, react automatically (for example isolate a Pod).
- CKS exam tasks: find which container did something from Falco output.
Make it safe
Security checklist:
- Keep the shipped rules updated with
falcoctl; never editfalco_rules.yaml— use local files. - Send alerts off the host (a SIEM or Alertmanager) — an attacker on the host can delete local logs.
- Tune with exceptions, not by turning rules off; review new noise each week.
- Protect the Falco config and service (root only); alert when Falco stops.
- Use it together with prevention: Pod Security, least privilege, read-only root file systems, NetworkPolicies.
Update and remove
Fix common problems
| Problem | Cause | Fix |
|---|---|---|
| Falco does not start: driver / BPF error | Kernel without BTF or too old for modern eBPF. | Update the kernel, or choose the kmod / ebpf driver (falcoctl driver config --type kmod). |
| No alerts in the test | Wrong service (falco.service vs falco-modern-bpf), or priority too high. | systemctl status falco-modern-bpf; lower priority; check rules_files. |
| Too many alerts | Normal tools trigger rules. | Add exceptions in a local file; raise priority. |
LOAD_ERR_COMPILE_CONDITION | A typo in your rule (field, macro or list name). | falco --validate FILE; check field names with falco --list. |
k8s.* fields are empty | No container/Kubernetes metadata on this host. | Run Falco in the cluster (Helm chart), or match on container.* fields. |
| High CPU on busy nodes | Very many syscalls or heavy rules. | Tune rules, use the base syscall set, check falco metrics. |
Next steps
- Quick how-to: Detect a shell in a container with Falco.
- Command page: falco.
- Learn it for the CKS: Detect behaviour with Falco. Practise: Lab: audit logging and catching a shell with Falco.
- At work: Runtime threat detection.
- Where alerts go: Fluent Bit, Loki, Alertmanager.
1Where do you put your own Falco rules and exceptions, and why not in falco_rules.yaml?
In falco_rules.local.yaml or rules.d/; the shipped file is replaced at every rules update.