Non sudo setuid
Description
Detect attempts to change users through the use of setuid, with exceptions for sudo/su. The users "root" and "nobody" using setuid on themselves are also excluded, as setuid calls in these cases typically involve reducing privileges. By setting the setuid bit, an attacker could execute code in a different user's context, potentially with higher privileges. One drawback is the potential for noise, as many applications legitimately use this approach.
Query · falco
evt.type=setuid and (known_user_in_container or not container) and not (user.name=root or user.uid=0) and not somebody_becoming_themselves and not proc.name in (known_setuid_binaries, userexec_binaries, mail_binaries, docker_binaries,
nomachine_binaries)
and not proc.name startswith "runc:" and not java_running_sdjagent and not nrpe_becoming_nagios and not user_known_non_sudo_setuid_conditions
Rule dependencies
Depends on
-
composes · Falco macro
containerA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
java_running_sdjagentA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
known_user_in_containerA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
nrpe_becoming_nagiosA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
somebody_becoming_themselvesA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
user_known_non_sudo_setuid_conditionsA shared condition, not a detection — not indexed on this site.
Analyst notes
Unexpected setuid call by non-sudo, non-root program | arg_uid=%evt.arg.uid 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