mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-31 06:01:52 +00:00
rule(Change thread namespace): Require proc name
In some cases, dropped events around the time a new container is started can result in missing the exec/clone for a process that does a setns to enter the namespace of a container. Here's an example from an oss capture: ``` 282273 09:01:22.098095673 30 runc:[0:PARENT] (168555) < setns res=0 282283 09:01:22.098138869 30 runc:[0:PARENT] (168555) < setns res=0 282295 09:01:22.098179685 30 runc:[0:PARENT] (168555) < setns res=0 517284 09:01:30.128723777 13 <NA> (168909) < setns res=0 517337 09:01:30.129054963 13 <NA> (168909) < setns res=0 517451 09:01:30.129560037 2 <NA> (168890) < setns res=0 524597 09:01:30.162741004 19 <NA> (168890) < setns res=0 527433 09:01:30.179786170 18 runc:[0:PARENT] (168927) < setns res=0 527448 09:01:30.179852428 18 runc:[0:PARENT] (168927) < setns res=0 535566 09:01:30.232420372 25 nsenter (168938) < setns res=0 537412 09:01:30.246200357 0 nsenter (168941) < setns res=0 554163 09:01:30.347158783 17 nsenter (168950) < setns res=0 659908 09:01:31.064622960 12 runc:[0:PARENT] (169023) < setns res=0 659919 09:01:31.064665759 12 runc:[0:PARENT] (169023) < setns res=0 732062 09:01:31.608297074 4 nsenter (169055) < setns res=0 812985 09:01:32.217527319 6 runc:[0:PARENT] (169077) < setns res=0 812991 09:01:32.217579396 6 runc:[0:PARENT] (169077) < setns res=0 813000 09:01:32.217632211 6 runc:[0:PARENT] (169077) < setns res=0 ``` When this happens, it can cause false positives for the "Change thread namespace" rule as it allows certain process names like "runc", "containerd", etc to perform setns calls. Other rules already use the proc_name_exists macro to require that the process name exists. This change adds proc_name_exists to the Change Thread Namespace rule as well. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
parent
5d71d70a14
commit
7a4d790458
@ -1607,6 +1607,7 @@
|
||||
as a part of creating a container) by calling setns.
|
||||
condition: >
|
||||
evt.type=setns and evt.dir=<
|
||||
and proc_name_exists
|
||||
and not (container.id=host and proc.name in (docker_binaries, k8s_binaries, lxd_binaries, nsenter))
|
||||
and not proc.name in (sysdigcloud_binaries, sysdig, calico, oci-umount, cilium-cni, network_plugin_binaries)
|
||||
and not proc.name in (user_known_change_thread_namespace_binaries)
|
||||
|
Loading…
Reference in New Issue
Block a user