Add PIDs to falco_rules.yaml rules

Signed-off-by: Kyle Smith Hanna <kyle.smithhanna@spyderbat.com>
This commit is contained in:
spyder-kyle 2022-09-16 10:31:34 -05:00 committed by poiana
parent 3aa9267b48
commit 38c823533c

View File

@ -367,7 +367,7 @@
desc: Detect any new ssh connection to a host other than those in an allowed group of hosts desc: Detect any new ssh connection to a host other than those in an allowed group of hosts
condition: (inbound_outbound) and ssh_port and not allowed_ssh_hosts condition: (inbound_outbound) and ssh_port and not allowed_ssh_hosts
enabled: false enabled: false
output: Disallowed SSH Connection (command=%proc.cmdline connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id image=%container.image.repository) output: Disallowed SSH Connection (command=%proc.cmdline pid=%proc.pid connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [network, mitre_remote_service] tags: [network, mitre_remote_service]
@ -397,7 +397,7 @@
(fd.snet in (allowed_outbound_destination_networks)) or (fd.snet in (allowed_outbound_destination_networks)) or
(fd.sip.name in (allowed_outbound_destination_domains))) (fd.sip.name in (allowed_outbound_destination_domains)))
enabled: false enabled: false
output: Disallowed outbound connection destination (command=%proc.cmdline connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id image=%container.image.repository) output: Disallowed outbound connection destination (command=%proc.cmdline pid=%proc.pid connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [network] tags: [network]
@ -418,7 +418,7 @@
(fd.cnet in (allowed_inbound_source_networks)) or (fd.cnet in (allowed_inbound_source_networks)) or
(fd.cip.name in (allowed_inbound_source_domains))) (fd.cip.name in (allowed_inbound_source_domains)))
enabled: false enabled: false
output: Disallowed inbound connection source (command=%proc.cmdline connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id image=%container.image.repository) output: Disallowed inbound connection source (command=%proc.cmdline pid=%proc.pid connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [network] tags: [network]
@ -461,7 +461,7 @@
and not exe_running_docker_save and not exe_running_docker_save
and not user_known_shell_config_modifiers and not user_known_shell_config_modifiers
output: > output: >
a shell configuration file has been modified (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pcmdline=%proc.pcmdline file=%fd.name container_id=%container.id image=%container.image.repository) a shell configuration file has been modified (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid pcmdline=%proc.pcmdline file=%fd.name container_id=%container.id image=%container.image.repository)
priority: priority:
WARNING WARNING
tags: [file, mitre_persistence] tags: [file, mitre_persistence]
@ -479,7 +479,7 @@
(not proc.name in (shell_binaries)) (not proc.name in (shell_binaries))
enabled: false enabled: false
output: > output: >
a shell configuration file was read by a non-shell program (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline file=%fd.name container_id=%container.id image=%container.image.repository) a shell configuration file was read by a non-shell program (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid file=%fd.name container_id=%container.id image=%container.image.repository)
priority: priority:
WARNING WARNING
tags: [file, mitre_discovery] tags: [file, mitre_discovery]
@ -495,7 +495,7 @@
not user_known_cron_jobs not user_known_cron_jobs
enabled: false enabled: false
output: > output: >
Cron jobs were scheduled to run (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline Cron jobs were scheduled to run (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid
file=%fd.name container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) file=%fd.name container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
priority: priority:
NOTICE NOTICE
@ -874,7 +874,7 @@
and not exe_running_docker_save and not exe_running_docker_save
and not user_known_update_package_registry and not user_known_update_package_registry
output: > output: >
Repository files get updated (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pcmdline=%proc.pcmdline file=%fd.name newpath=%evt.arg.newpath container_id=%container.id image=%container.image.repository) Repository files get updated (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid pcmdline=%proc.pcmdline file=%fd.name newpath=%evt.arg.newpath container_id=%container.id image=%container.image.repository)
priority: priority:
NOTICE NOTICE
tags: [filesystem, mitre_persistence] tags: [filesystem, mitre_persistence]
@ -896,7 +896,7 @@
and not user_known_write_below_binary_dir_activities and not user_known_write_below_binary_dir_activities
output: > output: >
File below a known binary directory opened for writing (user=%user.name user_loginuid=%user.loginuid File below a known binary directory opened for writing (user=%user.name user_loginuid=%user.loginuid
command=%proc.cmdline file=%fd.name parent=%proc.pname pcmdline=%proc.pcmdline gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository) command=%proc.cmdline pid=%proc.pid file=%fd.name parent=%proc.pname pcmdline=%proc.pcmdline gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository)
priority: ERROR priority: ERROR
tags: [filesystem, mitre_persistence] tags: [filesystem, mitre_persistence]
@ -952,7 +952,7 @@
and not user_known_write_monitored_dir_conditions and not user_known_write_monitored_dir_conditions
output: > output: >
File below a monitored directory opened for writing (user=%user.name user_loginuid=%user.loginuid File below a monitored directory opened for writing (user=%user.name user_loginuid=%user.loginuid
command=%proc.cmdline file=%fd.name parent=%proc.pname pcmdline=%proc.pcmdline gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository) command=%proc.cmdline pid=%proc.pid file=%fd.name parent=%proc.pname pcmdline=%proc.pcmdline gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository)
priority: ERROR priority: ERROR
tags: [filesystem, mitre_persistence] tags: [filesystem, mitre_persistence]
@ -969,7 +969,7 @@
enabled: true enabled: true
output: > output: >
Read monitored file via directory traversal (username=%user.name useruid=%user.uid user_loginuid=%user.loginuid program=%proc.name exe=%proc.exepath Read monitored file via directory traversal (username=%user.name useruid=%user.uid user_loginuid=%user.loginuid program=%proc.name exe=%proc.exepath
command=%proc.cmdline parent=%proc.pname file=%fd.name fileraw=%fd.nameraw parent=%proc.pname command=%proc.cmdline pid=%proc.pid parent=%proc.pname file=%fd.name fileraw=%fd.nameraw parent=%proc.pname
gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository returncode=%evt.res cwd=%proc.cwd) gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository returncode=%evt.res cwd=%proc.cwd)
priority: WARNING priority: WARNING
tags: [filesystem, mitre_discovery, mitre_exfiltration, mitre_credential_access] tags: [filesystem, mitre_discovery, mitre_exfiltration, mitre_credential_access]
@ -990,7 +990,7 @@
enabled: false enabled: false
output: > output: >
ssh-related file/directory read by non-ssh program (user=%user.name user_loginuid=%user.loginuid ssh-related file/directory read by non-ssh program (user=%user.name user_loginuid=%user.loginuid
command=%proc.cmdline file=%fd.name parent=%proc.pname pcmdline=%proc.pcmdline container_id=%container.id image=%container.image.repository) command=%proc.cmdline pid=%proc.pid file=%fd.name parent=%proc.pname pcmdline=%proc.pcmdline container_id=%container.id image=%container.image.repository)
priority: ERROR priority: ERROR
tags: [filesystem, mitre_discovery] tags: [filesystem, mitre_discovery]
@ -1276,7 +1276,7 @@
- rule: Write below etc - rule: Write below etc
desc: an attempt to write to any file below /etc desc: an attempt to write to any file below /etc
condition: write_etc_common condition: write_etc_common
output: "File below /etc opened for writing (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline parent=%proc.pname pcmdline=%proc.pcmdline file=%fd.name program=%proc.name gparent=%proc.aname[2] ggparent=%proc.aname[3] gggparent=%proc.aname[4] container_id=%container.id image=%container.image.repository)" output: "File below /etc opened for writing (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid parent=%proc.pname pcmdline=%proc.pcmdline file=%fd.name program=%proc.name gparent=%proc.aname[2] ggparent=%proc.aname[3] gggparent=%proc.aname[4] container_id=%container.id image=%container.image.repository)"
priority: ERROR priority: ERROR
tags: [filesystem, mitre_persistence] tags: [filesystem, mitre_persistence]
@ -1373,7 +1373,7 @@
and not known_root_conditions and not known_root_conditions
and not user_known_write_root_conditions and not user_known_write_root_conditions
and not user_known_write_below_root_activities and not user_known_write_below_root_activities
output: "File below / or /root opened for writing (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline parent=%proc.pname file=%fd.name program=%proc.name container_id=%container.id image=%container.image.repository)" output: "File below / or /root opened for writing (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid parent=%proc.pname file=%fd.name program=%proc.name container_id=%container.id image=%container.image.repository)"
priority: ERROR priority: ERROR
tags: [filesystem, mitre_persistence] tags: [filesystem, mitre_persistence]
@ -1391,7 +1391,7 @@
condition: sensitive_files and open_read and server_procs and not proc_is_new and proc.name!="sshd" and not user_known_read_sensitive_files_activities condition: sensitive_files and open_read and server_procs and not proc_is_new and proc.name!="sshd" and not user_known_read_sensitive_files_activities
output: > output: >
Sensitive file opened for reading by trusted program after startup (user=%user.name user_loginuid=%user.loginuid Sensitive file opened for reading by trusted program after startup (user=%user.name user_loginuid=%user.loginuid
command=%proc.cmdline parent=%proc.pname file=%fd.name parent=%proc.pname gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository) command=%proc.cmdline pid=%proc.pid parent=%proc.pname file=%fd.name parent=%proc.pname gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository)
priority: WARNING priority: WARNING
tags: [filesystem, mitre_credential_access] tags: [filesystem, mitre_credential_access]
@ -1461,7 +1461,7 @@
and not user_read_sensitive_file_containers and not user_read_sensitive_file_containers
output: > output: >
Sensitive file opened for reading by non-trusted program (user=%user.name user_loginuid=%user.loginuid program=%proc.name Sensitive file opened for reading by non-trusted program (user=%user.name user_loginuid=%user.loginuid program=%proc.name
command=%proc.cmdline file=%fd.name parent=%proc.pname gparent=%proc.aname[2] ggparent=%proc.aname[3] gggparent=%proc.aname[4] container_id=%container.id image=%container.image.repository) command=%proc.cmdline pid=%proc.pid file=%fd.name parent=%proc.pname gparent=%proc.aname[2] ggparent=%proc.aname[3] gggparent=%proc.aname[4] container_id=%container.id image=%container.image.repository)
priority: WARNING priority: WARNING
tags: [filesystem, mitre_credential_access, mitre_discovery] tags: [filesystem, mitre_credential_access, mitre_discovery]
@ -1485,7 +1485,7 @@
and not exe_running_docker_save and not exe_running_docker_save
and not amazon_linux_running_python_yum and not amazon_linux_running_python_yum
and not user_known_write_rpm_database_activities and not user_known_write_rpm_database_activities
output: "Rpm database opened for writing by a non-rpm program (command=%proc.cmdline file=%fd.name parent=%proc.pname pcmdline=%proc.pcmdline container_id=%container.id image=%container.image.repository)" output: "Rpm database opened for writing by a non-rpm program (command=%proc.cmdline pid=%proc.pid file=%fd.name parent=%proc.pname pcmdline=%proc.pcmdline container_id=%container.id image=%container.image.repository)"
priority: ERROR priority: ERROR
tags: [filesystem, software_mgmt, mitre_persistence] tags: [filesystem, software_mgmt, mitre_persistence]
@ -1524,7 +1524,7 @@
and not user_known_db_spawned_processes and not user_known_db_spawned_processes
output: > output: >
Database-related program spawned process other than itself (user=%user.name user_loginuid=%user.loginuid Database-related program spawned process other than itself (user=%user.name user_loginuid=%user.loginuid
program=%proc.cmdline parent=%proc.pname container_id=%container.id image=%container.image.repository) program=%proc.cmdline pid=%proc.pid parent=%proc.pname container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [process, database, mitre_execution] tags: [process, database, mitre_execution]
@ -1535,7 +1535,7 @@
desc: an attempt to modify any file below a set of binary directories. desc: an attempt to modify any file below a set of binary directories.
condition: bin_dir_rename and modify and not package_mgmt_procs and not exe_running_docker_save and not user_known_modify_bin_dir_activities condition: bin_dir_rename and modify and not package_mgmt_procs and not exe_running_docker_save and not user_known_modify_bin_dir_activities
output: > output: >
File below known binary directory renamed/removed (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline File below known binary directory renamed/removed (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid
pcmdline=%proc.pcmdline operation=%evt.type file=%fd.name %evt.args container_id=%container.id image=%container.image.repository) pcmdline=%proc.pcmdline operation=%evt.type file=%fd.name %evt.args container_id=%container.id image=%container.image.repository)
priority: ERROR priority: ERROR
tags: [filesystem, mitre_persistence] tags: [filesystem, mitre_persistence]
@ -1553,7 +1553,7 @@
and not exe_running_docker_save and not exe_running_docker_save
output: > output: >
Directory below known binary directory created (user=%user.name user_loginuid=%user.loginuid Directory below known binary directory created (user=%user.name user_loginuid=%user.loginuid
command=%proc.cmdline directory=%evt.arg.path container_id=%container.id image=%container.image.repository) command=%proc.cmdline pid=%proc.pid directory=%evt.arg.path container_id=%container.id image=%container.image.repository)
priority: ERROR priority: ERROR
tags: [filesystem, mitre_persistence] tags: [filesystem, mitre_persistence]
@ -1594,7 +1594,7 @@
and not user_known_change_thread_namespace_activities and not user_known_change_thread_namespace_activities
enabled: false enabled: false
output: > output: >
Namespace change (setns) by unexpected program (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline Namespace change (setns) by unexpected program (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid
parent=%proc.pname %container.info container_id=%container.id image=%container.image.repository:%container.image.tag) parent=%proc.pname %container.info container_id=%container.id image=%container.image.repository:%container.image.tag)
priority: NOTICE priority: NOTICE
tags: [process, mitre_privilege_escalation, mitre_lateral_movement] tags: [process, mitre_privilege_escalation, mitre_lateral_movement]
@ -1741,7 +1741,7 @@
and not user_shell_container_exclusions and not user_shell_container_exclusions
output: > output: >
Shell spawned by untrusted binary (user=%user.name user_loginuid=%user.loginuid shell=%proc.name parent=%proc.pname Shell spawned by untrusted binary (user=%user.name user_loginuid=%user.loginuid shell=%proc.name parent=%proc.pname
cmdline=%proc.cmdline pcmdline=%proc.pcmdline gparent=%proc.aname[2] ggparent=%proc.aname[3] cmdline=%proc.cmdline pid=%proc.pid pcmdline=%proc.pcmdline gparent=%proc.aname[2] ggparent=%proc.aname[3]
aname[4]=%proc.aname[4] aname[5]=%proc.aname[5] aname[6]=%proc.aname[6] aname[7]=%proc.aname[7] container_id=%container.id image=%container.image.repository) aname[4]=%proc.aname[4] aname[5]=%proc.aname[5] aname[6]=%proc.aname[6] aname[7]=%proc.aname[7] container_id=%container.id image=%container.image.repository)
priority: DEBUG priority: DEBUG
tags: [shell, mitre_execution] tags: [shell, mitre_execution]
@ -1925,7 +1925,7 @@
and not falco_privileged_containers and not falco_privileged_containers
and not user_privileged_containers and not user_privileged_containers
and not redhat_image and not redhat_image
output: Privileged container started (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline %container.info image=%container.image.repository:%container.image.tag) output: Privileged container started (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid %container.info image=%container.image.repository:%container.image.tag)
priority: INFO priority: INFO
tags: [container, cis, mitre_privilege_escalation, mitre_lateral_movement] tags: [container, cis, mitre_privilege_escalation, mitre_lateral_movement]
@ -1949,7 +1949,7 @@
and excessively_capable_container and excessively_capable_container
and not falco_privileged_containers and not falco_privileged_containers
and not user_privileged_containers and not user_privileged_containers
output: Excessively capable container started (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline %container.info image=%container.image.repository:%container.image.tag cap_permitted=%thread.cap_permitted) output: Excessively capable container started (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid %container.info image=%container.image.repository:%container.image.tag cap_permitted=%thread.cap_permitted)
priority: INFO priority: INFO
tags: [container, cis, mitre_privilege_escalation, mitre_lateral_movement] tags: [container, cis, mitre_privilege_escalation, mitre_lateral_movement]
@ -1995,7 +1995,7 @@
and sensitive_mount and sensitive_mount
and not falco_sensitive_mount_containers and not falco_sensitive_mount_containers
and not user_sensitive_mount_containers and not user_sensitive_mount_containers
output: Container with sensitive mount started (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline %container.info image=%container.image.repository:%container.image.tag mounts=%container.mounts) output: Container with sensitive mount started (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid %container.info image=%container.image.repository:%container.image.tag mounts=%container.mounts)
priority: INFO priority: INFO
tags: [container, cis, mitre_lateral_movement] tags: [container, cis, mitre_lateral_movement]
@ -2015,7 +2015,7 @@
desc: > desc: >
Detect the initial process started by a container that is not in a list of allowed containers. Detect the initial process started by a container that is not in a list of allowed containers.
condition: container_started and container and not allowed_containers condition: container_started and container and not allowed_containers
output: Container started and not in allowed list (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline %container.info image=%container.image.repository:%container.image.tag) output: Container started and not in allowed list (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid %container.info image=%container.image.repository:%container.image.tag)
priority: WARNING priority: WARNING
tags: [container, mitre_lateral_movement] tags: [container, mitre_lateral_movement]
@ -2030,7 +2030,7 @@
- rule: System user interactive - rule: System user interactive
desc: an attempt to run interactive commands by a system (i.e. non-login) user desc: an attempt to run interactive commands by a system (i.e. non-login) user
condition: spawned_process and system_users and interactive and not user_known_system_user_login condition: spawned_process and system_users and interactive and not user_known_system_user_login
output: "System user ran an interactive command (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline container_id=%container.id image=%container.image.repository)" output: "System user ran an interactive command (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid container_id=%container.id image=%container.image.repository)"
priority: INFO priority: INFO
tags: [users, mitre_remote_access_tools] tags: [users, mitre_remote_access_tools]
@ -2048,7 +2048,7 @@
and not user_expected_terminal_shell_in_container_conditions and not user_expected_terminal_shell_in_container_conditions
output: > output: >
A shell was spawned in a container with an attached terminal (user=%user.name user_loginuid=%user.loginuid %container.info A shell was spawned in a container with an attached terminal (user=%user.name user_loginuid=%user.loginuid %container.info
shell=%proc.name parent=%proc.pname cmdline=%proc.cmdline terminal=%proc.tty container_id=%container.id image=%container.image.repository) shell=%proc.name parent=%proc.pname cmdline=%proc.cmdline pid=%proc.pid terminal=%proc.tty container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [container, shell, mitre_execution] tags: [container, shell, mitre_execution]
@ -2124,7 +2124,7 @@
and not user_expected_system_procs_network_activity_conditions and not user_expected_system_procs_network_activity_conditions
output: > output: >
Known system binary sent/received network traffic Known system binary sent/received network traffic
(user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline connection=%fd.name container_id=%container.id image=%container.image.repository) (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid connection=%fd.name container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [network, mitre_exfiltration] tags: [network, mitre_exfiltration]
@ -2163,7 +2163,7 @@
enabled: false enabled: false
output: > output: >
Program run with disallowed HTTP_PROXY environment variable Program run with disallowed HTTP_PROXY environment variable
(user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline env=%proc.env parent=%proc.pname container_id=%container.id image=%container.image.repository) (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid env=%proc.env parent=%proc.pname container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [host, users] tags: [host, users]
@ -2179,7 +2179,7 @@
enabled: false enabled: false
output: > output: >
Interpreted program received/listened for network traffic Interpreted program received/listened for network traffic
(user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline connection=%fd.name container_id=%container.id image=%container.image.repository) (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid connection=%fd.name container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [network, mitre_exfiltration] tags: [network, mitre_exfiltration]
@ -2190,7 +2190,7 @@
enabled: false enabled: false
output: > output: >
Interpreted program performed outgoing network connection Interpreted program performed outgoing network connection
(user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline connection=%fd.name container_id=%container.id image=%container.image.repository) (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid connection=%fd.name container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [network, mitre_exfiltration] tags: [network, mitre_exfiltration]
@ -2229,7 +2229,7 @@
enabled: false enabled: false
output: > output: >
Unexpected UDP Traffic Seen Unexpected UDP Traffic Seen
(user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline connection=%fd.name proto=%fd.l4proto evt=%evt.type %evt.args container_id=%container.id image=%container.image.repository) (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid connection=%fd.name proto=%fd.l4proto evt=%evt.type %evt.args container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [network, mitre_exfiltration] tags: [network, mitre_exfiltration]
@ -2289,7 +2289,7 @@
and not user_known_non_sudo_setuid_conditions and not user_known_non_sudo_setuid_conditions
output: > output: >
Unexpected setuid call by non-sudo, non-root program (user=%user.name user_loginuid=%user.loginuid cur_uid=%user.uid parent=%proc.pname Unexpected setuid call by non-sudo, non-root program (user=%user.name user_loginuid=%user.loginuid cur_uid=%user.uid parent=%proc.pname
command=%proc.cmdline uid=%evt.arg.uid container_id=%container.id image=%container.image.repository) command=%proc.cmdline pid=%proc.pid uid=%evt.arg.uid container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [users, mitre_privilege_escalation] tags: [users, mitre_privilege_escalation]
@ -2321,7 +2321,7 @@
not user_known_user_management_activities not user_known_user_management_activities
output: > output: >
User management binary command run outside of container User management binary command run outside of container
(user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline parent=%proc.pname gparent=%proc.aname[2] ggparent=%proc.aname[3] gggparent=%proc.aname[4]) (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid parent=%proc.pname gparent=%proc.aname[2] ggparent=%proc.aname[3] gggparent=%proc.aname[4])
priority: NOTICE priority: NOTICE
tags: [host, users, mitre_persistence] tags: [host, users, mitre_persistence]
@ -2345,7 +2345,7 @@
and not fd.name in (allowed_dev_files) and not fd.name in (allowed_dev_files)
and not fd.name startswith /dev/tty and not fd.name startswith /dev/tty
and not user_known_create_files_below_dev_activities and not user_known_create_files_below_dev_activities
output: "File created below /dev by untrusted program (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline file=%fd.name container_id=%container.id image=%container.image.repository)" output: "File created below /dev by untrusted program (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid file=%fd.name container_id=%container.id image=%container.image.repository)"
priority: ERROR priority: ERROR
tags: [filesystem, mitre_persistence] tags: [filesystem, mitre_persistence]
@ -2367,7 +2367,7 @@
- rule: Contact EC2 Instance Metadata Service From Container - rule: Contact EC2 Instance Metadata Service From Container
desc: Detect attempts to contact the EC2 Instance Metadata Service from a container desc: Detect attempts to contact the EC2 Instance Metadata Service from a container
condition: outbound and fd.sip="169.254.169.254" and container and not ec2_metadata_containers condition: outbound and fd.sip="169.254.169.254" and container and not ec2_metadata_containers
output: Outbound connection to EC2 instance metadata service (command=%proc.cmdline connection=%fd.name %container.info image=%container.image.repository:%container.image.tag) output: Outbound connection to EC2 instance metadata service (command=%proc.cmdline pid=%proc.pid connection=%fd.name %container.info image=%container.image.repository:%container.image.tag)
priority: NOTICE priority: NOTICE
tags: [network, aws, container, mitre_discovery] tags: [network, aws, container, mitre_discovery]
@ -2384,7 +2384,7 @@
desc: Detect attempts to contact the Cloud Instance Metadata Service from a container desc: Detect attempts to contact the Cloud Instance Metadata Service from a container
condition: outbound and fd.sip="169.254.169.254" and container and not user_known_metadata_access condition: outbound and fd.sip="169.254.169.254" and container and not user_known_metadata_access
enabled: false enabled: false
output: Outbound connection to cloud instance metadata service (command=%proc.cmdline connection=%fd.name %container.info image=%container.image.repository:%container.image.tag) output: Outbound connection to cloud instance metadata service (command=%proc.cmdline pid=%proc.pid connection=%fd.name %container.info image=%container.image.repository:%container.image.tag)
priority: NOTICE priority: NOTICE
tags: [network, container, mitre_discovery] tags: [network, container, mitre_discovery]
@ -2430,7 +2430,7 @@
not k8s_containers and not k8s_containers and
k8s_api_server and k8s_api_server and
not user_known_contact_k8s_api_server_activities not user_known_contact_k8s_api_server_activities
output: Unexpected connection to K8s API Server from container (command=%proc.cmdline %container.info image=%container.image.repository:%container.image.tag connection=%fd.name) output: Unexpected connection to K8s API Server from container (command=%proc.cmdline pid=%proc.pid %container.info image=%container.image.repository:%container.image.tag connection=%fd.name)
priority: NOTICE priority: NOTICE
tags: [network, k8s, container, mitre_discovery] tags: [network, k8s, container, mitre_discovery]
@ -2446,7 +2446,7 @@
- rule: Unexpected K8s NodePort Connection - rule: Unexpected K8s NodePort Connection
desc: Detect attempts to use K8s NodePorts from a container desc: Detect attempts to use K8s NodePorts from a container
condition: (inbound_outbound) and fd.sport >= 30000 and fd.sport <= 32767 and container and not nodeport_containers condition: (inbound_outbound) and fd.sport >= 30000 and fd.sport <= 32767 and container and not nodeport_containers
output: Unexpected K8s NodePort Connection (command=%proc.cmdline connection=%fd.name container_id=%container.id image=%container.image.repository) output: Unexpected K8s NodePort Connection (command=%proc.cmdline pid=%proc.pid connection=%fd.name container_id=%container.id image=%container.image.repository)
priority: NOTICE priority: NOTICE
tags: [network, k8s, container, mitre_port_knocking] tags: [network, k8s, container, mitre_port_knocking]
@ -2483,7 +2483,7 @@
and not pkg_mgmt_in_kube_proxy and not pkg_mgmt_in_kube_proxy
output: > output: >
Package management process launched in container (user=%user.name user_loginuid=%user.loginuid Package management process launched in container (user=%user.name user_loginuid=%user.loginuid
command=%proc.cmdline container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) command=%proc.cmdline pid=%proc.pid container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
priority: ERROR priority: ERROR
tags: [process, mitre_persistence] tags: [process, mitre_persistence]
@ -2497,7 +2497,7 @@
) )
output: > output: >
Netcat runs inside container that allows remote code execution (user=%user.name user_loginuid=%user.loginuid Netcat runs inside container that allows remote code execution (user=%user.name user_loginuid=%user.loginuid
command=%proc.cmdline container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) command=%proc.cmdline pid=%proc.pid container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
priority: WARNING priority: WARNING
tags: [network, process, mitre_execution] tags: [network, process, mitre_execution]
@ -2509,7 +2509,7 @@
condition: > condition: >
spawned_process and container and network_tool_procs and not user_known_network_tool_activities spawned_process and container and network_tool_procs and not user_known_network_tool_activities
output: > output: >
Network tool launched in container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline parent_process=%proc.pname Network tool launched in container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid parent_process=%proc.pname
container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
priority: NOTICE priority: NOTICE
tags: [network, process, mitre_discovery, mitre_exfiltration] tags: [network, process, mitre_discovery, mitre_exfiltration]
@ -2529,7 +2529,7 @@
network_tool_procs and network_tool_procs and
not user_known_network_tool_activities not user_known_network_tool_activities
output: > output: >
Network tool launched on host (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline parent_process=%proc.pname) Network tool launched on host (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid parent_process=%proc.pname)
priority: NOTICE priority: NOTICE
tags: [network, process, mitre_discovery, mitre_exfiltration] tags: [network, process, mitre_discovery, mitre_exfiltration]
@ -2565,7 +2565,7 @@
) )
output: > output: >
Grep private keys or passwords activities found Grep private keys or passwords activities found
(user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline container_id=%container.id container_name=%container.name (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid container_id=%container.id container_name=%container.name
image=%container.image.repository:%container.image.tag) image=%container.image.repository:%container.image.tag)
priority: priority:
WARNING WARNING
@ -2599,7 +2599,7 @@
not trusted_logging_images and not trusted_logging_images and
not allowed_clear_log_files not allowed_clear_log_files
output: > output: >
Log files were tampered (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline file=%fd.name container_id=%container.id image=%container.image.repository) Log files were tampered (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid file=%fd.name container_id=%container.id image=%container.image.repository)
priority: priority:
WARNING WARNING
tags: [file, mitre_defense_evasion] tags: [file, mitre_defense_evasion]
@ -2617,7 +2617,7 @@
desc: Detect process running to clear bulk data from disk desc: Detect process running to clear bulk data from disk
condition: spawned_process and clear_data_procs and not user_known_remove_data_activities condition: spawned_process and clear_data_procs and not user_known_remove_data_activities
output: > output: >
Bulk data has been removed from disk (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline file=%fd.name container_id=%container.id image=%container.image.repository) Bulk data has been removed from disk (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid file=%fd.name container_id=%container.id image=%container.image.repository)
priority: priority:
WARNING WARNING
tags: [process, mitre_persistence] tags: [process, mitre_persistence]
@ -2658,7 +2658,7 @@
not var_lib_docker_filepath and not var_lib_docker_filepath and
not proc.name in (docker_binaries) not proc.name in (docker_binaries)
output: > output: >
Shell history had been deleted or renamed (user=%user.name user_loginuid=%user.loginuid type=%evt.type command=%proc.cmdline fd.name=%fd.name name=%evt.arg.name path=%evt.arg.path oldpath=%evt.arg.oldpath %container.info) Shell history had been deleted or renamed (user=%user.name user_loginuid=%user.loginuid type=%evt.type command=%proc.cmdline pid=%proc.pid fd.name=%fd.name name=%evt.arg.name path=%evt.arg.path oldpath=%evt.arg.oldpath %container.info)
priority: priority:
WARNING WARNING
tags: [process, mitre_defense_evasion] tags: [process, mitre_defense_evasion]
@ -2671,7 +2671,7 @@
((spawned_process and proc.name in (shred, rm, mv) and proc.args contains "bash_history") or ((spawned_process and proc.name in (shred, rm, mv) and proc.args contains "bash_history") or
(open_write and fd.name contains "bash_history" and evt.arg.flags contains "O_TRUNC")) (open_write and fd.name contains "bash_history" and evt.arg.flags contains "O_TRUNC"))
output: > output: >
Shell history had been deleted or renamed (user=%user.name user_loginuid=%user.loginuid type=%evt.type command=%proc.cmdline fd.name=%fd.name name=%evt.arg.name path=%evt.arg.path oldpath=%evt.arg.oldpath %container.info) Shell history had been deleted or renamed (user=%user.name user_loginuid=%user.loginuid type=%evt.type command=%proc.cmdline pid=%proc.pid fd.name=%fd.name name=%evt.arg.name path=%evt.arg.path oldpath=%evt.arg.oldpath %container.info)
priority: priority:
WARNING WARNING
tags: [process, mitre_defense_evasion] tags: [process, mitre_defense_evasion]
@ -2698,7 +2698,7 @@
enabled: false enabled: false
output: > output: >
Setuid or setgid bit is set via chmod (fd=%evt.arg.fd filename=%evt.arg.filename mode=%evt.arg.mode user=%user.name user_loginuid=%user.loginuid process=%proc.name Setuid or setgid bit is set via chmod (fd=%evt.arg.fd filename=%evt.arg.filename mode=%evt.arg.mode user=%user.name user_loginuid=%user.loginuid process=%proc.name
command=%proc.cmdline container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) command=%proc.cmdline pid=%proc.pid container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
priority: priority:
NOTICE NOTICE
tags: [process, mitre_persistence] tags: [process, mitre_persistence]
@ -2720,7 +2720,7 @@
and not exe_running_docker_save and not exe_running_docker_save
enabled: false enabled: false
output: > output: >
Hidden file or directory created (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline Hidden file or directory created (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid
file=%fd.name newpath=%evt.arg.newpath container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) file=%fd.name newpath=%evt.arg.newpath container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
priority: priority:
NOTICE NOTICE
@ -2745,7 +2745,7 @@
and remote_file_copy_procs and remote_file_copy_procs
and not user_known_remote_file_copy_activities and not user_known_remote_file_copy_activities
output: > output: >
Remote file copy tool launched in container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline parent_process=%proc.pname Remote file copy tool launched in container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid parent_process=%proc.pname
container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
priority: NOTICE priority: NOTICE
tags: [network, process, mitre_lateral_movement, mitre_exfiltration] tags: [network, process, mitre_lateral_movement, mitre_exfiltration]
@ -2756,7 +2756,7 @@
create_symlink and create_symlink and
(evt.arg.target in (sensitive_file_names) or evt.arg.target in (sensitive_directory_names)) (evt.arg.target in (sensitive_file_names) or evt.arg.target in (sensitive_directory_names))
output: > output: >
Symlinks created over sensitive files (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline target=%evt.arg.target linkpath=%evt.arg.linkpath parent_process=%proc.pname) Symlinks created over sensitive files (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid target=%evt.arg.target linkpath=%evt.arg.linkpath parent_process=%proc.pname)
priority: WARNING priority: WARNING
tags: [file, mitre_exfiltration] tags: [file, mitre_exfiltration]
@ -2766,7 +2766,7 @@
create_hardlink and create_hardlink and
(evt.arg.oldpath in (sensitive_file_names)) (evt.arg.oldpath in (sensitive_file_names))
output: > output: >
Hardlinks created over sensitive files (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline target=%evt.arg.oldpath linkpath=%evt.arg.newpath parent_process=%proc.pname) Hardlinks created over sensitive files (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid target=%evt.arg.oldpath linkpath=%evt.arg.newpath parent_process=%proc.pname)
priority: WARNING priority: WARNING
tags: [file, mitre_exfiltration] tags: [file, mitre_exfiltration]
@ -2871,14 +2871,14 @@
desc: Miners typically connect to miner pools on common ports. desc: Miners typically connect to miner pools on common ports.
condition: net_miner_pool and not trusted_images_query_miner_domain_dns condition: net_miner_pool and not trusted_images_query_miner_domain_dns
enabled: false enabled: false
output: Outbound connection to IP/Port flagged by https://cryptoioc.ch (command=%proc.cmdline port=%fd.rport ip=%fd.rip container=%container.info image=%container.image.repository) output: Outbound connection to IP/Port flagged by https://cryptoioc.ch (command=%proc.cmdline pid=%proc.pid port=%fd.rport ip=%fd.rip container=%container.info image=%container.image.repository)
priority: CRITICAL priority: CRITICAL
tags: [network, mitre_execution] tags: [network, mitre_execution]
- rule: Detect crypto miners using the Stratum protocol - rule: Detect crypto miners using the Stratum protocol
desc: Miners typically specify the mining pool to connect to with a URI that begins with 'stratum+tcp' desc: Miners typically specify the mining pool to connect to with a URI that begins with 'stratum+tcp'
condition: spawned_process and (proc.cmdline contains "stratum+tcp" or proc.cmdline contains "stratum2+tcp" or proc.cmdline contains "stratum+ssl" or proc.cmdline contains "stratum2+ssl") condition: spawned_process and (proc.cmdline contains "stratum+tcp" or proc.cmdline contains "stratum2+tcp" or proc.cmdline contains "stratum+ssl" or proc.cmdline contains "stratum2+ssl")
output: Possible miner running (command=%proc.cmdline container=%container.info image=%container.image.repository) output: Possible miner running (command=%proc.cmdline pid=%proc.pid container=%container.info image=%container.image.repository)
priority: CRITICAL priority: CRITICAL
tags: [process, mitre_execution] tags: [process, mitre_execution]
@ -2908,7 +2908,7 @@
- rule: The docker client is executed in a container - rule: The docker client is executed in a container
desc: Detect a k8s client tool executed inside a container desc: Detect a k8s client tool executed inside a container
condition: spawned_process and container and not user_known_k8s_client_container_parens and proc.name in (k8s_client_binaries) condition: spawned_process and container and not user_known_k8s_client_container_parens and proc.name in (k8s_client_binaries)
output: "Docker or kubernetes client executed in container (user=%user.name user_loginuid=%user.loginuid %container.info parent=%proc.pname cmdline=%proc.cmdline image=%container.image.repository:%container.image.tag)" output: "Docker or kubernetes client executed in container (user=%user.name user_loginuid=%user.loginuid %container.info parent=%proc.pname cmdline=%proc.cmdline pid=%proc.pid image=%container.image.repository:%container.image.tag)"
priority: WARNING priority: WARNING
tags: [container, mitre_execution] tags: [container, mitre_execution]
@ -2918,7 +2918,7 @@
- rule: Packet socket created in container - rule: Packet socket created in container
desc: Detect new packet socket at the device driver (OSI Layer 2) level in a container. Packet socket could be used for ARP Spoofing and privilege escalation(CVE-2020-14386) by attacker. desc: Detect new packet socket at the device driver (OSI Layer 2) level in a container. Packet socket could be used for ARP Spoofing and privilege escalation(CVE-2020-14386) by attacker.
condition: evt.type=socket and evt.arg[0]=AF_PACKET and container and not proc.name in (user_known_packet_socket_binaries) condition: evt.type=socket and evt.arg[0]=AF_PACKET and container and not proc.name in (user_known_packet_socket_binaries)
output: Packet socket was created in a container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline socket_info=%evt.args container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) output: Packet socket was created in a container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid socket_info=%evt.args container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
priority: NOTICE priority: NOTICE
tags: [network, mitre_discovery] tags: [network, mitre_discovery]
@ -2949,7 +2949,7 @@
enabled: false enabled: false
output: > output: >
Network connection outside local subnet Network connection outside local subnet
(command=%proc.cmdline connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id (command=%proc.cmdline pid=%proc.pid connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id
image=%container.image.repository namespace=%k8s.ns.name image=%container.image.repository namespace=%k8s.ns.name
fd.rip.name=%fd.rip.name fd.lip.name=%fd.lip.name fd.cip.name=%fd.cip.name fd.sip.name=%fd.sip.name) fd.rip.name=%fd.rip.name fd.lip.name=%fd.lip.name fd.cip.name=%fd.cip.name fd.sip.name=%fd.sip.name)
priority: WARNING priority: WARNING
@ -2983,7 +2983,7 @@
enabled: false enabled: false
output: > output: >
Network connection outside authorized port and binary Network connection outside authorized port and binary
(command=%proc.cmdline connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id (command=%proc.cmdline pid=%proc.pid connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id
image=%container.image.repository) image=%container.image.repository)
priority: WARNING priority: WARNING
tags: [network] tags: [network]
@ -2998,7 +2998,7 @@
desc: Detect redirecting stdout/stdin to network connection in container (potential reverse shell). desc: Detect redirecting stdout/stdin to network connection in container (potential reverse shell).
condition: dup and container and evt.rawres in (0, 1, 2) and fd.type in ("ipv4", "ipv6") and not user_known_stand_streams_redirect_activities condition: dup and container and evt.rawres in (0, 1, 2) and fd.type in ("ipv4", "ipv6") and not user_known_stand_streams_redirect_activities
output: > output: >
Redirect stdout/stdin to network connection (user=%user.name user_loginuid=%user.loginuid %container.info process=%proc.name parent=%proc.pname cmdline=%proc.cmdline terminal=%proc.tty container_id=%container.id image=%container.image.repository fd.name=%fd.name fd.num=%fd.num fd.type=%fd.type fd.sip=%fd.sip) Redirect stdout/stdin to network connection (user=%user.name user_loginuid=%user.loginuid %container.info process=%proc.name parent=%proc.pname cmdline=%proc.cmdline pid=%proc.pid terminal=%proc.tty container_id=%container.id image=%container.image.repository fd.name=%fd.name fd.num=%fd.num fd.type=%fd.type fd.sip=%fd.sip)
priority: NOTICE priority: NOTICE
# The two Container Drift rules below will fire when a new executable is created in a container. # The two Container Drift rules below will fire when a new executable is created in a container.
@ -3027,7 +3027,7 @@
(evt.arg.mode contains "S_IXGRP") or (evt.arg.mode contains "S_IXGRP") or
(evt.arg.mode contains "S_IXOTH")) (evt.arg.mode contains "S_IXOTH"))
enabled: false enabled: false
output: Drift detected (chmod), new executable created in a container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline filename=%evt.arg.filename name=%evt.arg.name mode=%evt.arg.mode event=%evt.type) output: Drift detected (chmod), new executable created in a container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid filename=%evt.arg.filename name=%evt.arg.name mode=%evt.arg.mode event=%evt.type)
priority: ERROR priority: ERROR
# **************************************************************************** # ****************************************************************************
@ -3044,7 +3044,7 @@
not user_known_container_drift_activities and not user_known_container_drift_activities and
evt.rawres>=0 evt.rawres>=0
enabled: false enabled: false
output: Drift detected (open+create), new executable created in a container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline filename=%evt.arg.filename name=%evt.arg.name mode=%evt.arg.mode event=%evt.type) output: Drift detected (open+create), new executable created in a container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid filename=%evt.arg.filename name=%evt.arg.name mode=%evt.arg.mode event=%evt.type)
priority: ERROR priority: ERROR
- list: c2_server_ip_list - list: c2_server_ip_list
@ -3053,7 +3053,7 @@
- rule: Outbound Connection to C2 Servers - rule: Outbound Connection to C2 Servers
desc: Detect outbound connection to command & control servers desc: Detect outbound connection to command & control servers
condition: outbound and fd.sip in (c2_server_ip_list) condition: outbound and fd.sip in (c2_server_ip_list)
output: Outbound connection to C2 server (command=%proc.cmdline connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id image=%container.image.repository) output: Outbound connection to C2 server (command=%proc.cmdline pid=%proc.pid connection=%fd.name user=%user.name user_loginuid=%user.loginuid container_id=%container.id image=%container.image.repository)
priority: WARNING priority: WARNING
tags: [network] tags: [network]
@ -3088,7 +3088,7 @@
- rule: Sudo Potential Privilege Escalation - rule: Sudo Potential Privilege Escalation
desc: Privilege escalation vulnerability affecting sudo (<= 1.9.5p2). Executing sudo using sudoedit -s or sudoedit -i command with command-line argument that ends with a single backslash character from an unprivileged user it's possible to elevate the user privileges to root. desc: Privilege escalation vulnerability affecting sudo (<= 1.9.5p2). Executing sudo using sudoedit -s or sudoedit -i command with command-line argument that ends with a single backslash character from an unprivileged user it's possible to elevate the user privileges to root.
condition: spawned_process and user.uid != 0 and (proc.name=sudoedit or proc.name = sudo) and (proc.args contains -s or proc.args contains -i or proc.args contains --login) and (proc.args contains "\ " or proc.args endswith \) condition: spawned_process and user.uid != 0 and (proc.name=sudoedit or proc.name = sudo) and (proc.args contains -s or proc.args contains -i or proc.args contains --login) and (proc.args contains "\ " or proc.args endswith \)
output: "Detect Sudo Privilege Escalation Exploit (CVE-2021-3156) (user=%user.name parent=%proc.pname cmdline=%proc.cmdline %container.info)" output: "Detect Sudo Privilege Escalation Exploit (CVE-2021-3156) (user=%user.name parent=%proc.pname cmdline=%proc.cmdline pid=%proc.pid %container.info)"
priority: CRITICAL priority: CRITICAL
tags: [filesystem, mitre_privilege_escalation] tags: [filesystem, mitre_privilege_escalation]
@ -3098,7 +3098,7 @@
spawned_process and container spawned_process and container
and container.privileged=true and container.privileged=true
and proc.name=debugfs and proc.name=debugfs
output: Debugfs launched started in a privileged container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline %container.info image=%container.image.repository:%container.image.tag) output: Debugfs launched started in a privileged container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid %container.info image=%container.image.repository:%container.image.tag)
priority: WARNING priority: WARNING
tags: [container, cis, mitre_lateral_movement] tags: [container, cis, mitre_lateral_movement]
@ -3122,7 +3122,7 @@
and not mount_info and not mount_info
and not known_gke_mount_in_privileged_containers and not known_gke_mount_in_privileged_containers
and not user_known_mount_in_privileged_containers and not user_known_mount_in_privileged_containers
output: Mount was executed inside a privileged container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline %container.info image=%container.image.repository:%container.image.tag) output: Mount was executed inside a privileged container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid %container.info image=%container.image.repository:%container.image.tag)
priority: WARNING priority: WARNING
tags: [container, cis, mitre_lateral_movement] tags: [container, cis, mitre_lateral_movement]
@ -3136,7 +3136,7 @@
user.uid != 0 and user.uid != 0 and
(evt.rawres >= 0 or evt.res != -1) and (evt.rawres >= 0 or evt.res != -1) and
not proc.name in (user_known_userfaultfd_processes) not proc.name in (user_known_userfaultfd_processes)
output: An userfaultfd syscall was successfully executed by an unprivileged user (user=%user.name user_loginuid=%user.loginuid process=%proc.name command=%proc.cmdline %container.info image=%container.image.repository:%container.image.tag) output: An userfaultfd syscall was successfully executed by an unprivileged user (user=%user.name user_loginuid=%user.loginuid process=%proc.name command=%proc.cmdline pid=%proc.pid %container.info image=%container.image.repository:%container.image.tag)
priority: CRITICAL priority: CRITICAL
tags: [syscall, mitre_defense_evasion] tags: [syscall, mitre_defense_evasion]
@ -3166,7 +3166,7 @@
(ingress_remote_file_copy_procs or curl_download) and (ingress_remote_file_copy_procs or curl_download) and
not user_known_ingress_remote_file_copy_activities not user_known_ingress_remote_file_copy_activities
output: > output: >
Ingress remote file copy tool launched in container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline parent_process=%proc.pname Ingress remote file copy tool launched in container (user=%user.name user_loginuid=%user.loginuid command=%proc.cmdline pid=%proc.pid parent_process=%proc.pname
container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
priority: NOTICE priority: NOTICE
tags: [network, process, mitre_command_and_control] tags: [network, process, mitre_command_and_control]
@ -3178,7 +3178,7 @@
condition: condition:
spawned_process and user.uid != 0 and proc.name=pkexec and proc.args = '' spawned_process and user.uid != 0 and proc.name=pkexec and proc.args = ''
output: output:
"Detect Polkit pkexec Local Privilege Escalation Exploit (CVE-2021-4034) (user=%user.loginname uid=%user.loginuid command=%proc.cmdline args=%proc.args)" "Detect Polkit pkexec Local Privilege Escalation Exploit (CVE-2021-4034) (user=%user.loginname uid=%user.loginuid command=%proc.cmdline pid=%proc.pid args=%proc.args)"
priority: CRITICAL priority: CRITICAL
tags: [process, mitre_privilege_escalation] tags: [process, mitre_privilege_escalation]
@ -3201,7 +3201,7 @@
desc: Detected Java process downloading a class file which could indicate a successful exploit of the log4shell Log4j vulnerability (CVE-2021-44228) desc: Detected Java process downloading a class file which could indicate a successful exploit of the log4shell Log4j vulnerability (CVE-2021-44228)
condition: > condition: >
java_network_read and evt.buffer bcontains cafebabe java_network_read and evt.buffer bcontains cafebabe
output: Java process class file download (user=%user.name user_loginname=%user.loginname user_loginuid=%user.loginuid event=%evt.type connection=%fd.name server_ip=%fd.sip server_port=%fd.sport proto=%fd.l4proto process=%proc.name command=%proc.cmdline parent=%proc.pname buffer=%evt.buffer container_id=%container.id image=%container.image.repository) output: Java process class file download (user=%user.name user_loginname=%user.loginname user_loginuid=%user.loginuid event=%evt.type connection=%fd.name server_ip=%fd.sip server_port=%fd.sport proto=%fd.l4proto process=%proc.name command=%proc.cmdline pid=%proc.pid parent=%proc.pname buffer=%evt.buffer container_id=%container.id image=%container.image.repository)
priority: CRITICAL priority: CRITICAL
tags: [mitre_initial_access] tags: [mitre_initial_access]
@ -3217,7 +3217,7 @@
open_write and container and (fd.name=/proc/self/exe or fd.name startswith /proc/self/fd/) and not docker_procs and not proc.cmdline = "runc:[1:CHILD] init" open_write and container and (fd.name=/proc/self/exe or fd.name startswith /proc/self/fd/) and not docker_procs and not proc.cmdline = "runc:[1:CHILD] init"
enabled: false enabled: false
output: > output: >
Detect Potential Container Breakout Exploit (CVE-2019-5736) (user=%user.name process=%proc.name file=%fd.name cmdline=%proc.cmdline %container.info) Detect Potential Container Breakout Exploit (CVE-2019-5736) (user=%user.name process=%proc.name file=%fd.name cmdline=%proc.cmdline pid=%proc.pid %container.info)
priority: WARNING priority: WARNING
tags: [container, filesystem, mitre_initial_access] tags: [container, filesystem, mitre_initial_access]
@ -3235,6 +3235,6 @@
and not proc.name in (known_binaries_to_read_environment_variables_from_proc_files) and not proc.name in (known_binaries_to_read_environment_variables_from_proc_files)
output: > output: >
Environment variables were retrieved from /proc files (user=%user.name user_loginuid=%user.loginuid program=%proc.name Environment variables were retrieved from /proc files (user=%user.name user_loginuid=%user.loginuid program=%proc.name
command=%proc.cmdline file=%fd.name parent=%proc.pname gparent=%proc.aname[2] ggparent=%proc.aname[3] gggparent=%proc.aname[4] container_id=%container.id image=%container.image.repository) command=%proc.cmdline pid=%proc.pid file=%fd.name parent=%proc.pname gparent=%proc.aname[2] ggparent=%proc.aname[3] gggparent=%proc.aname[4] container_id=%container.id image=%container.image.repository)
priority: WARNING priority: WARNING
tags: [filesystem, mitre_credential_access, mitre_discovery] tags: [filesystem, mitre_credential_access, mitre_discovery]