Process reads a private key file under a user's SSH or GPG directory
Matches AN1517's Linux observable directly off MITRE's own CommandLineMatch examples — `cat ~/.ssh/id_rsa`, `tar ~/.gnupg` — by requiring a file-handling tool together with a path fragment naming a private-key file or directory on the same command line. The tool list covers reading, copying and archiving (cat, less, cp, scp, rsync, tar, gpg, base64) rather than every possible binary, since an unbounded tool list would match almost any process that happens to take a path argument. AN1517's second observable — the read followed by unusual shell activity or a network connection — is a correlation over MITRE's TimeWindow knob that this single process_creation event cannot express, so a hit here is access to the file, not confirmed exfiltration. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0549, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
title: Process reads a private key file under a user's SSH or GPG directoryid: 30d6c544-2f2d-43cd-9887-1c8944af7260status: experimentaldescription: | Matches AN1517's Linux observable directly off MITRE's own CommandLineMatch examples — `cat ~/.ssh/id_rsa`, `tar ~/.gnupg` — by requiring a file-handling tool together with a path fragment naming a private-key file or directory on the same command line. The tool list covers reading, copying and archiving (cat, less, cp, scp, rsync, tar, gpg, base64) rather than every possible binary, since an unbounded tool list would match almost any process that happens to take a path argument. AN1517's second observable — the read followed by unusual shell activity or a network connection — is a correlation over MITRE's TimeWindow knob that this single process_creation event cannot express, so a hit here is access to the file, not confirmed exfiltration. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0549, not hand-written and not tested by its author. Any lab result is on this rule's own page.references: - https://attack.mitre.org/techniques/T1552/004 - https://attack.mitre.org/detectionstrategies/DET0549author: Siemphony pipeline (machine-derived from MITRE ATT&CK v19.2)date: 2026-08-16tags: - attack.credential-access - attack.t1552.004logsource: category: process_creation product: linuxdetection: selection_tool: Image|endswith: - '/cat' - '/less' - '/more' - '/cp' - '/scp' - '/rsync' - '/tar' - '/gpg' - '/gpg2' - '/base64' selection_keypath: CommandLine|contains: - '.ssh/id_rsa' - '.ssh/id_dsa' - '.ssh/id_ecdsa' - '.ssh/id_ed25519' - '.gnupg' - '.pem' - '.ppk' - '.p12' - '.pfx' condition: selection_tool and selection_keypathfalsepositives: - "Users or scripts reading their own id_rsa.pub public key to copy it into a remote authorized_keys file — the public key's path contains the same 'id_rsa' substring as the private key, so this selector cannot tell the two apart, and this is the highest-volume match by a wide margin on any host where admins manage SSH access by hand." - "Configuration-management and provisioning tooling (Ansible, Chef, Puppet) or backup jobs that use scp, rsync or tar to deploy or archive a user's ~/.ssh directory during account setup, host migration or routine backup — the exact tools and paths selected here are also the standard way to do this legitimately." - "Certificate-renewal automation (certbot and similar) or config-management pushing a rotated .pem or .pfx certificate to a web server, read or copied by cp or tar as part of the normal renewal hook."level: lowSentinel · KQL
Run this as a search.
DeviceProcessEvents| where ((FolderPath endswith "/cat" or FolderPath endswith "/less" or FolderPath endswith "/more" or FolderPath endswith "/cp" or FolderPath endswith "/scp" or FolderPath endswith "/rsync" or FolderPath endswith "/tar" or FolderPath endswith "/gpg" or FolderPath endswith "/gpg2" or FolderPath endswith "/base64") and (ProcessCommandLine contains ".ssh/id_rsa" or ProcessCommandLine contains ".ssh/id_dsa" or ProcessCommandLine contains ".ssh/id_ecdsa" or ProcessCommandLine contains ".ssh/id_ed25519" or ProcessCommandLine contains ".gnupg" or ProcessCommandLine contains ".pem" or ProcessCommandLine contains ".ppk" or ProcessCommandLine contains ".p12" or ProcessCommandLine contains ".pfx"))
Splunk · SPL
Run this as a search.
index=* ((Image="*/cat" OR Image="*/less" OR Image="*/more" OR Image="*/cp" OR Image="*/scp" OR Image="*/rsync" OR Image="*/tar" OR Image="*/gpg" OR Image="*/gpg2" OR Image="*/base64") AND (CommandLine="*.ssh/id_rsa*" OR CommandLine="*.ssh/id_dsa*" OR CommandLine="*.ssh/id_ecdsa*" OR CommandLine="*.ssh/id_ed25519*" OR CommandLine="*.gnupg*" OR CommandLine="*.pem*" OR CommandLine="*.ppk*" OR CommandLine="*.p12*" OR CommandLine="*.pfx*"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE ((TO_LOWER(process.executable) LIKE "*/cat" OR TO_LOWER(process.executable) LIKE "*/less" OR TO_LOWER(process.executable) LIKE "*/more" OR TO_LOWER(process.executable) LIKE "*/cp" OR TO_LOWER(process.executable) LIKE "*/scp" OR TO_LOWER(process.executable) LIKE "*/rsync" OR TO_LOWER(process.executable) LIKE "*/tar" OR TO_LOWER(process.executable) LIKE "*/gpg" OR TO_LOWER(process.executable) LIKE "*/gpg2" OR TO_LOWER(process.executable) LIKE "*/base64") AND (TO_LOWER(process.command_line) LIKE "*.ssh/id_rsa*" OR TO_LOWER(process.command_line) LIKE "*.ssh/id_dsa*" OR TO_LOWER(process.command_line) LIKE "*.ssh/id_ecdsa*" OR TO_LOWER(process.command_line) LIKE "*.ssh/id_ed25519*" OR TO_LOWER(process.command_line) LIKE "*.gnupg*" OR TO_LOWER(process.command_line) LIKE "*.pem*" OR TO_LOWER(process.command_line) LIKE "*.ppk*" OR TO_LOWER(process.command_line) LIKE "*.p12*" OR TO_LOWER(process.command_line) LIKE "*.pfx*"))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,linux,process_creation,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <rule id="100000" level="5"> <!-- Set <if_sid> to the decoder/base rule for linux so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(/cat$|/less$|/more$|/cp$|/scp$|/rsync$|/tar$|/gpg$|/gpg2$|/base64$)</field> <field name="CommandLine" type="pcre2">(?i)(\.ssh/id_rsa|\.ssh/id_dsa|\.ssh/id_ecdsa|\.ssh/id_ed25519|\.gnupg|\.pem|\.ppk|\.p12|\.pfx)</field> <description>Process reads a private key file under a user's SSH or GPG directory</description> <mitre> <id>T1552.004</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.