What is Falco?
Two default Falco rules that alert on privileged containers and containers with sensitive mounts could be bypassed by naming a container image repository so that it matched the allow-list prefixes or suffixes. An attacker with permission to launch pods could then run a privileged container or mount sensitive host paths without triggering an alert.
darkbit.io
Published on darkbit.io
Recently, when doing a bit of research of how Falco rules work, we discovered a default rule that alerts when privileged containers or containers that mount sensitive file paths are run inside a Kubernetes cluster could be “bypassed” if the image name was cleverly formatted.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The allow-list macros used prefix and suffix string matches on the image repository name, so any repository that started with 'quay.io/sysdig' or ended with 'sysdig/agent' was treated as trusted.
Impact
An attacker or malicious developer with permission to launch pods could run privileged containers or mount sensitive host paths without Falco alerting, unless admission control or other rules prevented it.
What the attacker needed
RBAC permission to launch pods; no admission control blocking arbitrary images; Falco with unmodified default rules; ability to create a free image repository
The fix
The default rules were updated to require a trailing slash after the trusted prefix and to disable the suffix-based user allow-list, closing the loophole.
How it was found
- Create a free or low-cost image repository whose name starts with the trusted prefix or ends with the trusted suffix.
- Push a container image of your choosing to that repository.
- Run the image in a Kubernetes cluster with the privileged flag set or with a sensitive host path mounted.
- Observe that Falco does not generate an alert for the privileged container or sensitive mount.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Falco is a security tool that watches what happens inside a Kubernetes cluster and raises alerts for suspicious actions, such as starting a container with extra powers. Its default rules trust certain image names, and the check was too loose: a name that merely started or ended with a trusted string was accepted. So someone who could create a container with a look-alike name could avoid the alert.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.