Skip to content

Commit

Permalink
[Rule Tuning] Linux 3rd Party EDR Support - Crowdstrike and S1 - 9 (#…
Browse files Browse the repository at this point in the history
…4356)

(cherry picked from commit 2af2e1f)
  • Loading branch information
w0rk3r authored and github-actions[bot] committed Jan 9, 2025
1 parent 927d70f commit 28f0f57
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 66 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[metadata]
creation_date = "2024/11/04"
integration = ["endpoint"]
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2024/11/04"
min_stack_version = "8.13.0"
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
updated_date = "2025/01/08"

[rule]
author = ["Elastic"]
Expand All @@ -12,7 +14,7 @@ for exfiltration on Linux systems. Data splitting is a technique used by adversa
avoid detection and exfiltrate data.
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
index = ["logs-endpoint.events.*", "logs-crowdstrike.fdr*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Data Splitting Detected"
Expand Down Expand Up @@ -49,25 +51,33 @@ tags = [
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Exfiltration",
"Data Source: Elastic Defend"
"Data Source: Elastic Defend",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Data Source: Elastic Endgame"
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
(process.name == "dd" and process.args like "bs=*" and process.args like "if=*") or
(process.name in ("split", "rsplit") and (
(process.args == "-b" or process.args like "--bytes*") or
(process.args == "-C" or process.args like "--line-bytes*")
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
(
(process.name == "dd" and process.args like "bs=*" and process.args like "if=*") or
(
process.name in ("split", "rsplit") and
(
(process.args == "-b" or process.args like "--bytes*") or
(process.args == "-C" or process.args like "--line-bytes*")
)
)
) and
not (
process.parent.name in ("apport", "overlayroot") or
process.args like (
"if=/tmp/nvim*", "if=/boot/*", "if=/dev/random", "if=/dev/urandom", "/dev/mapper/*",
"if=*.iso", "of=/dev/stdout", "if=/dev/zero", "if=/dev/sda", "/proc/sys/kernel/*"
)
)
) and not (
process.parent.name in ("apport", "overlayroot") or
process.args like (
"if=/tmp/nvim*", "if=/boot/*", "if=/dev/random", "if=/dev/urandom", "/dev/mapper/*",
"if=*.iso", "of=/dev/stdout", "if=/dev/zero", "if=/dev/sda", "/proc/sys/kernel/*"
)
)
'''

[[rule.threat]]
Expand Down
12 changes: 8 additions & 4 deletions rules/linux/impact_memory_swap_modification.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[metadata]
creation_date = "2024/11/04"
integration = ["endpoint"]
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2024/11/04"
min_stack_version = "8.13.0"
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
updated_date = "2025/01/08"

[rule]
author = ["Elastic"]
Expand All @@ -12,7 +14,7 @@ the system's memory and potentially impact the system's performance. This behavi
deploys miner software such as XMRig.
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
index = ["logs-endpoint.events.*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Memory Swap Modification"
Expand Down Expand Up @@ -53,11 +55,13 @@ tags = [
"Tactic: Impact",
"Tactic: Execution",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
"Data Source: Elastic Endgame",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start") and
process.parent.executable != null and
process.name in ("swapon", "swapoff") or (
process.command_line like ("*vm.swappiness*", "*/proc/sys/vm/swappiness*") and (
Expand Down
15 changes: 10 additions & 5 deletions rules/linux/lateral_movement_ssh_it_worm_download.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[metadata]
creation_date = "2023/09/21"
integration = ["endpoint", "auditd_manager"]
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2024/05/21"
min_stack_version = "8.13.0"
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
updated_date = "2025/01/08"

[rule]
author = ["Elastic"]
Expand All @@ -11,7 +13,7 @@ Identifies processes that are capable of downloading files with command line arg
autonomous SSH worm. This worm intercepts outgoing SSH connections every time a user uses ssh.
"""
from = "now-9m"
index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_manager.auditd-*"]
index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_manager.auditd-*", "logs-crowdstrike.fdr*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Potential SSH-IT SSH Worm Downloaded"
Expand Down Expand Up @@ -53,13 +55,16 @@ tags = [
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Data Source: Auditd Manager",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "executed", "process_started")
and process.name in ("curl", "wget") and process.args : (
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
process.name in ("curl", "wget") and process.args : (
"https://thc.org/ssh-it/x", "http://nossl.segfault.net/ssh-it-deploy.sh", "https://gsocket.io/x",
"https://thc.org/ssh-it/bs", "http://nossl.segfault.net/bs"
)
Expand Down
13 changes: 8 additions & 5 deletions rules/linux/persistence_apt_package_manager_execution.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[metadata]
creation_date = "2024/02/01"
integration = ["endpoint"]
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2024/09/23"
min_stack_version = "8.13.0"
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
updated_date = "2025/01/08"

[rule]
author = ["Elastic"]
Expand All @@ -14,7 +16,7 @@ repositories. Attackers can backdoor APT to gain persistence by injecting malici
thereby ensuring continued unauthorized access or control each time APT is used for package management.
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
index = ["logs-endpoint.events.*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Suspicious APT Package Manager Execution"
Expand Down Expand Up @@ -56,17 +58,18 @@ tags = [
"Tactic: Execution",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
]
type = "eql"

query = '''
sequence by host.id with maxspan=5s
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
[process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "start") and
process.parent.name == "apt" and process.args == "-c" and process.name in (
"bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish"
)
] by process.entity_id
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.name : (
[process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "start") and process.name : (
"bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "python*", "php*",
"perl", "ruby", "lua*", "openssl", "nc", "netcat", "ncat", "telnet", "awk"
)
Expand Down
11 changes: 7 additions & 4 deletions rules/linux/persistence_chkconfig_service_add.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[metadata]
creation_date = "2022/07/22"
integration = ["endpoint"]
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2024/10/17"
min_stack_version = "8.13.0"
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
updated_date = "2025/01/08"

[transform]
[[transform.osquery]]
Expand Down Expand Up @@ -53,7 +55,7 @@ either a start or a kill entry in every runlevel and when the system is rebooted
providing long-term persistence.
"""
from = "now-9m"
index = ["logs-endpoint.events.*", "endgame-*"]
index = ["logs-endpoint.events.*", "endgame-*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Chkconfig Service Add"
Expand Down Expand Up @@ -169,11 +171,12 @@ tags = [
"Threat: Lightning Framework",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.action in ("exec", "exec_event") and
process where host.os.type == "linux" and event.action in ("exec", "exec_event", "start") and
(
(process.executable : "/usr/sbin/chkconfig" and process.args : "--add") or
(process.args : "*chkconfig" and process.args : "--add")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[metadata]
creation_date = "2024/06/25"
integration = ["endpoint"]
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2024/09/23"
min_stack_version = "8.13.0"
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
updated_date = "2025/01/08"

[rule]
author = ["Elastic"]
Expand All @@ -14,7 +16,7 @@ persistence by injecting malicious code into plugins that DNF runs, thereby ensu
control each time DNF is used for package management.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*"]
index = ["logs-endpoint.events.file*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "DNF Package Manager Plugin File Creation"
Expand Down Expand Up @@ -58,6 +60,8 @@ tags = [
"Tactic: Persistence",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
"Data Source: Elastic Endgame",
]
timestamp_override = "event.ingested"
type = "eql"
Expand Down
13 changes: 8 additions & 5 deletions rules/linux/persistence_git_hook_execution.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[metadata]
creation_date = "2024/07/15"
integration = ["endpoint"]
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2024/09/23"
min_stack_version = "8.13.0"
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
updated_date = "2025/01/08"

[rule]
author = ["Elastic"]
Expand All @@ -12,7 +14,7 @@ executes before or after events such as: commit, push, and receive. An attacker
commands on the system and establish persistence.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
index = ["logs-endpoint.events.process*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Git Hook Command Execution"
Expand Down Expand Up @@ -56,16 +58,17 @@ tags = [
"Tactic: Execution",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
]
type = "eql"

query = '''
sequence by host.id with maxspan=3s
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
[process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "start") and
process.parent.name == "git" and process.args : ".git/hooks/*" and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")
] by process.entity_id
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
[process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "start") and
process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")] by process.parent.entity_id
'''

Expand Down
41 changes: 25 additions & 16 deletions rules/linux/persistence_git_hook_process_execution.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[metadata]
creation_date = "2024/06/26"
integration = ["endpoint"]
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2024/09/23"
min_stack_version = "8.13.0"
min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
updated_date = "2025/01/08"

[rule]
author = ["Elastic"]
Expand All @@ -13,7 +15,7 @@ spawned by the Git process itself. This behavior may indicate an attacker attemp
leveraging the legitimate Git process to execute unauthorized commands.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
index = ["logs-endpoint.events.process*", "logs-crowdstrike.fdr*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Git Hook Child Process"
Expand Down Expand Up @@ -57,24 +59,31 @@ tags = [
"Tactic: Execution",
"Tactic: Defense Evasion",
"Data Source: Elastic Defend",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Data Source: Elastic Endgame",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.parent.name in (
"applypatch-msg", "commit-msg", "fsmonitor-watchman", "post-update", "post-checkout", "post-commit",
"pre-applypatch", "pre-commit", "pre-merge-commit", "prepare-commit-msg", "pre-push", "pre-rebase", "pre-receive",
"push-to-checkout", "update", "post-receive", "pre-auto-gc", "post-rewrite", "sendemail-validate", "p4-pre-submit",
"post-index-change", "post-merge", "post-applypatch"
) and (
process.name in ("nohup", "setsid", "disown", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") or
process.name : ("php*", "perl*", "ruby*", "lua*") or
process.executable : (
"/boot/*", "/dev/shm/*", "/etc/cron.*/*", "/etc/init.d/*", "/etc/update-motd.d/*",
"/run/*", "/srv/*", "/tmp/*", "/var/tmp/*", "/var/log/*"
)
) and not process.name in ("git", "dirname")
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
process.parent.name in (
"applypatch-msg", "commit-msg", "fsmonitor-watchman", "post-update", "post-checkout", "post-commit",
"pre-applypatch", "pre-commit", "pre-merge-commit", "prepare-commit-msg", "pre-push", "pre-rebase", "pre-receive",
"push-to-checkout", "update", "post-receive", "pre-auto-gc", "post-rewrite", "sendemail-validate", "p4-pre-submit",
"post-index-change", "post-merge", "post-applypatch"
) and
(
process.name in ("nohup", "setsid", "disown", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") or
process.name : ("php*", "perl*", "ruby*", "lua*") or
process.executable : (
"/boot/*", "/dev/shm/*", "/etc/cron.*/*", "/etc/init.d/*", "/etc/update-motd.d/*",
"/run/*", "/srv/*", "/tmp/*", "/var/tmp/*", "/var/log/*"
)
) and
not process.name in ("git", "dirname")
'''


Expand Down
Loading

0 comments on commit 28f0f57

Please sign in to comment.