Terminal shell in container
Description
A shell was used as the entrypoint/exec point into a container with an attached terminal. Parent process may have legitimately already exited and be null (read container_entrypoint macro). Common when using "kubectl exec" in Kubernetes. Correlate with k8saudit exec logs if possible to find user or serviceaccount token used (fuzzy correlation by namespace and pod name). Rather than considering it a standalone rule, it may be best used as generic auditing rule while examining other triggered rules in this container/tty.
Query · falco
spawned_process and container and shell_procs and proc.tty != 0 and container_entrypoint and not user_expected_terminal_shell_in_container_conditions
Rule dependencies
Depends on
-
composes · Falco macro
containerA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
container_entrypointA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
shell_procsA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
spawned_processA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
user_expected_terminal_shell_in_container_conditionsA shared condition, not a detection — not indexed on this site.
Analyst notes
A shell was spawned in a container with an attached terminal | evt_type=%evt.type user=%user.name user_uid=%user.uid user_loginuid=%user.loginuid process=%proc.name proc_exepath=%proc.exepath parent=%proc.pname command=%proc.cmdline terminal=%proc.tty exe_flags=%evt.arg.flags