Detection rules › Elastic
Keychain Credential Files Collected via Archive Utility
Adversaries may collect the keychain storage data from a system to acquire credentials. Keychains are the built-in way for macOS to keep track of users' passwords and credentials for many services and features such as WiFi passwords, websites, secure notes and certificates.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Telemetry coverage
Rule body
[rule]
description = """
Adversaries may collect the keychain storage data from a system to acquire credentials. Keychains are the built-in way
for macOS to keep track of users' passwords and credentials for many services and features such as WiFi passwords,
websites, secure notes and certificates.
"""
id = "150f20b4-6b21-460b-8ae4-339695c1c86c"
license = "Elastic License v2"
name = "Keychain Credential Files Collected via Archive Utility"
os_list = ["macos"]
reference = [
"https://objective-see.com/blog/blog_0x25.html",
"https://securelist.com/calisto-trojan-for-macos/86543/",
]
version = "1.0.31"
query = '''
process where event.action == "exec" and process.name in ("zip", "tar") and
process.command_line like~
(
"*/Users/*/Library/Keychains/*",
"*/Library/Keychains/*",
"*/Network/Library/Keychains/*",
"*System.keychain*",
"*login.keychain-db*",
"*login.keychain*"
) and
not process.args like~
("find-certificate",
"add-trusted-cert",
"set-keychain-settings",
"delete-certificate",
"/Users/*/Library/Keychains/openvpn.keychain-db",
"show-keychain-info",
"lock-keychain",
"set-key-partition-list",
"import",
"find-identity") and
not process.parent.executable like
(
"/Applications/OpenVPN Connect/OpenVPN Connect.app/Contents/MacOS/OpenVPN Connect",
"/Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon_enterprise.app/Contents/MacOS/wdavdaemon_enterprise",
"/opt/jc/bin/jumpcloud-agent"
) and
not process.executable == "/opt/jc/bin/jumpcloud-agent"
'''
min_endpoint_version = "8.10.2"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[[threat.technique.subtechnique]]
id = "T1555.001"
name = "Keychain"
reference = "https://attack.mitre.org/techniques/T1555/001/"
[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[internal]
min_endpoint_version = "8.10.2"
Stages and Predicates
Stage 1: process
process where event.action == "exec" and process.name in ("zip", "tar") and
process.command_line like~
(
"*/Users/*/Library/Keychains/*",
"*/Library/Keychains/*",
"*/Network/Library/Keychains/*",
"*System.keychain*",
"*login.keychain-db*",
"*login.keychain*"
) and
not process.args like~
("find-certificate",
"add-trusted-cert",
"set-keychain-settings",
"delete-certificate",
"/Users/*/Library/Keychains/openvpn.keychain-db",
"show-keychain-info",
"lock-keychain",
"set-key-partition-list",
"import",
"find-identity") and
not process.parent.executable like
(
"/Applications/OpenVPN Connect/OpenVPN Connect.app/Contents/MacOS/OpenVPN Connect",
"/Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon_enterprise.app/Contents/MacOS/wdavdaemon_enterprise",
"/opt/jc/bin/jumpcloud-agent"
) and
not process.executable == "/opt/jc/bin/jumpcloud-agent"
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | find-certificate, add-trusted-cert, set-keychain-settings, delete-certificate, /Users/*/Library/Keychains/openvpn.keychain-db, show-keychain-info, lock-keychain, set-key-partition-list, import, find-identity | excludes:process.args |
process.executable | eq | /opt/jc/bin/jumpcloud-agent | excludes:process.executable field:"process.executable" value:"/opt/jc/bin/jumpcloud-agent" |
process.parent.executable | eq | /Applications/OpenVPN Connect/OpenVPN Connect.app/Contents/MacOS/OpenVPN Connect, /Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon_enterprise.app/Contents/MacOS/wdavdaemon_enterprise, /opt/jc/bin/jumpcloud-agent | excludes:process.parent.executable field:"process.parent.executable" value:"/Applications/OpenVPN Connect/OpenVPN Connect.app/Contents/MacOS/OpenVPN Connect" field:"process.parent.executable" value:"/Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon_enterprise.app/Contents/MacOS/wdavdaemon_enterprise" field:"process.parent.executable" value:"/opt/jc/bin/jumpcloud-agent" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | in |
| field:"process_name" kind:in |