mirror of
https://github.com/carlospolop/hacktricks
synced 2025-01-01 15:58:49 +00:00
2.7 KiB
2.7 KiB
Monitoring with Falco
This tutorial was taken from https://madhuakula.com/kubernetes-goat/scenarios/scenario-18.html#scenario-information
Scenario Information
This scenario is deploy runtime security monitoring & detection for containers and kubernetes resources.
- To get started with this scenario you can deploy the below helm chart with version 3
NOTE: Make sure you run the follwing deployment using Helm with v3.
helm repo add falcosecurity https://falcosecurity.github.io/charts
helm repo update
helm install falco falcosecurity/falco
Scenario Solution
Falco
, the cloud-native runtime security project, is the de facto Kubernetes threat detection engine. Falco was created by Sysdig in 2016 and is the first runtime security project to join CNCF as an incubation-level project. Falco detects unexpected application behavior and alerts on threats at runtime.
Falco uses system calls to secure and monitor a system, by:
- Parsing the Linux system calls from the kernel at runtime
- Asserting the stream against a powerful rules engine
- Alerting when a rule is violated
Falco ships with a default set of rules that check the kernel for unusual behavior such as:
- Privilege escalation using privileged containers
- Namespace changes using tools like
setns
- Read/Writes to well-known directories such as /etc, /usr/bin, /usr/sbin, etc
- Creating symlinks
- Ownership and Mode changes
- Unexpected network connections or socket mutations
- Spawned processes using execve
- Executing shell binaries such as sh, bash, csh, zsh, etc
- Executing SSH binaries such as ssh, scp, sftp, etc
- Mutating Linux coreutils executables
- Mutating login binaries
- Mutating shadowutil or passwd executables such as shadowconfig, pwck, chpasswd, getpasswd, change, useradd, etc, and others.
- Get more details about the falco deployment
kubectl get pods --selector app=falco
- Manually obtaining the logs from the falco systems
kubectl logs -f -l app=falco
- Now, let's spin up a hacker container and read senstive file and see if that detects by Falco
kubectl run --rm --restart=Never -it --image=madhuakula/hacker-container -- bash
- Read the sensitive file
cat /etc/shadow