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 ssh-add -l after other options in ssh-agent-key-enumeration (#1050)
Rudy Mizrahi Celekli1fce3e6d0f25
diff --git a/rules/credential-access/ssh-agent-key-enumeration.rule.yaml b/rules/credential-access/ssh-agent-key-enumeration.rule.yamlindex 594f8846..eb48d221 100644--- a/rules/credential-access/ssh-agent-key-enumeration.rule.yaml+++ b/rules/credential-access/ssh-agent-key-enumeration.rule.yaml@@ -1,5 +1,5 @@id: ssh-agent-key-enumeration-version: 1+version: 2title: SSH agent key enumerationdescription: >A command lists the private keys loaded in the running ssh-agent (`ssh-add -l`@@ -16,7 +16,7 @@ taxonomy:match: >e.event.action == "command.executed" &&- e.command.command.matches("(?i)\\bssh-add\\s+(-[A-Za-z]*[lL])") ||+ e.command.command.matches("(?i)\\bssh-add\\b[^;&|\\n]*\\s-[A-Za-z]*[lL]") ||e.event.action == "command.executed" &&e.command.command.matches("(?i)SSH_AUTH_SOCK=\\S+\\s+ssh-add\\b")@@ -42,6 +42,24 @@ tests:- event: { action: command.executed }command: { command: "SSH_AUTH_SOCK=/tmp/agent.sock ssh-add -l" }session: { id: s1 }+ - name: ssh_add_list_with_hash_option+ verdict: match+ events:+ - event: { action: command.executed }+ command: { command: "ssh-add -E md5 -l" }+ session: { id: s1 }+ - name: ssh_add_add_key_with_hyphen_not_list+ verdict: no_match+ events:+ - event: { action: command.executed }+ command: { command: "ssh-add ~/.ssh/deploy-lab" }+ session: { id: s1 }+ - name: ssh_add_key_then_ls_on_next_line+ verdict: no_match+ events:+ - event: { action: command.executed }+ command: { command: "ssh-add ~/.ssh/id_ed25519\nls -la ~/.ssh" }+ session: { id: s1 }- name: ssh_add_add_key_not_listverdict: no_matchevents: