-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address Kibana false positives #391
Merged
egibs
merged 1 commit into
chainguard-dev:main
from
egibs:address-kibana-false-positives
Jul 30, 2024
+12,998
−9
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,10 @@ rule keychain : medium macos { | |
strings: | ||
$ref = "Keychain" | ||
$ref2 = "keychain" | ||
$not_elastic_author = { 22 61 75 74 68 6F 72 22 3A 20 5B 0A 20 20 20 20 22 45 6C 61 73 74 69 63 22 0A 20 20 5D } | ||
$not_elastic_license = "\"license\": \"Elastic License v2\"" | ||
condition: | ||
any of them | ||
any of ($ref*) and none of ($not*) | ||
} | ||
|
||
rule macos_library_keychains : medium { | ||
|
@@ -20,26 +22,32 @@ rule macos_library_keychains : medium { | |
hash_2023_Downloads_Brawl_Earth = "fe3ac61c701945f833f218c98b18dca704e83df2cf1a8994603d929f25d1cce2" | ||
strings: | ||
$ref = "/Library/Keychains" | ||
$not_elastic_author = { 22 61 75 74 68 6F 72 22 3A 20 5B 0A 20 20 20 20 22 45 6C 61 73 74 69 63 22 0A 20 20 5D } | ||
$not_elastic_license = "\"license\": \"Elastic License v2\"" | ||
condition: | ||
any of them | ||
$ref and none of ($not*) | ||
} | ||
|
||
rule find_generic_password : high { | ||
meta: | ||
description = "Looks up a password from the Keychain" | ||
strings: | ||
$ref = /find-generic-passsword[ \-\w\']{0,32}/ | ||
$ctkcard = "/System/Library/Frameworks/CryptoTokenKit.framework/ctkcard" | ||
$not_ctkcard = "/System/Library/Frameworks/CryptoTokenKit.framework/ctkcard" | ||
$not_elastic_author = { 22 61 75 74 68 6F 72 22 3A 20 5B 0A 20 20 20 20 22 45 6C 61 73 74 69 63 22 0A 20 20 5D } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "author": [
"Elastic"
] |
||
$not_elastic_license = "\"license\": \"Elastic License v2\"" | ||
condition: | ||
$ref and not $ctkcard | ||
$ref and none of ($not*) | ||
} | ||
|
||
rule find_internet_password : high { | ||
meta: | ||
description = "Looks up an internet password from the Keychain" | ||
strings: | ||
$ref = /find-internet-passsword[ \-\w\']{0,32}/ | ||
$ctkcard = "/System/Library/Frameworks/CryptoTokenKit.framework/ctkcard" | ||
$not_ctkcard = "/System/Library/Frameworks/CryptoTokenKit.framework/ctkcard" | ||
$not_elastic_author = { 22 61 75 74 68 6F 72 22 3A 20 5B 0A 20 20 20 20 22 45 6C 61 73 74 69 63 22 0A 20 20 5D } | ||
$not_elastic_license = "\"license\": \"Elastic License v2\"" | ||
condition: | ||
$ref and not $ctkcard | ||
$ref and none of ($not*) | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Javascript/clean/php.js | ||
combo/net/tunnel_proxy | ||
compression/gzip | ||
databases/mysql | ||
databases/sqlite | ||
encoding/base64 | ||
encoding/reverse | ||
env/USER | ||
evasion/base64/decode | ||
exec/program | ||
exec/program/background | ||
exec/shell_command | ||
fs/directory/create | ||
fs/directory/remove | ||
fs/fifo/create | ||
fs/file/delete | ||
fs/file/truncate | ||
fs/link/read | ||
fs/lock/update | ||
fs/node/create | ||
fs/permission/modify | ||
fs/symlink/resolve | ||
fs/watch | ||
kernel/acct | ||
kernel/hostname/get | ||
kernel/platform | ||
net/hostname/resolve | ||
net/http/cookies | ||
net/http/form/upload | ||
net/http/post | ||
net/ip/parse | ||
net/ip/resolve | ||
net/ip/string | ||
net/socket/connect | ||
net/socket/listen | ||
net/socket/local/address | ||
net/socket/peer/address | ||
net/socket/receive | ||
net/socket/send | ||
net/upload | ||
net/url/encode | ||
process/chroot | ||
process/effective/groupid/get | ||
process/groupid/set | ||
process/parent_pid/get | ||
process/userid/set | ||
process/username/get | ||
random/insecure | ||
ref/ip_port | ||
ref/path/etc | ||
ref/path/hidden | ||
ref/site/url | ||
ref/words/agent | ||
ref/words/password | ||
ref/words/plugin | ||
ref/words/spoof | ||
secrets/private_key | ||
techniques/code_eval | ||
tty/pathname |
55 changes: 55 additions & 0 deletions
55
samples/Linux/clean/credential_access_dumping_keychain_security.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"author": [ | ||
"Elastic" | ||
], | ||
"description": "Adversaries may dump the content of 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, including Wi-Fi and website passwords, secure notes, certificates, and Kerberos.", | ||
"from": "now-9m", | ||
"index": [ | ||
"auditbeat-*", | ||
"logs-endpoint.events.*" | ||
], | ||
"language": "eql", | ||
"license": "Elastic License v2", | ||
"name": "Dumping of Keychain Content via Security Command", | ||
"query": "process where event.type in (\"start\", \"process_started\") and process.args : \"dump-keychain\" and process.args : \"-d\"\n", | ||
"references": [ | ||
"https://ss64.com/osx/security.html" | ||
], | ||
"risk_score": 73, | ||
"rule_id": "565d6ca5-75ba-4c82-9b13-add25353471c", | ||
"severity": "high", | ||
"tags": [ | ||
"Elastic", | ||
"Host", | ||
"macOS", | ||
"Threat Detection", | ||
"Credential Access" | ||
], | ||
"threat": [ | ||
{ | ||
"framework": "MITRE ATT&CK", | ||
"tactic": { | ||
"id": "TA0006", | ||
"name": "Credential Access", | ||
"reference": "https://attack.mitre.org/tactics/TA0006/" | ||
}, | ||
"technique": [ | ||
{ | ||
"id": "T1555", | ||
"name": "Credentials from Password Stores", | ||
"reference": "https://attack.mitre.org/techniques/T1555/", | ||
"subtechnique": [ | ||
{ | ||
"id": "T1555.001", | ||
"name": "Keychain", | ||
"reference": "https://attack.mitre.org/techniques/T1555/001/" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"timestamp_override": "event.ingested", | ||
"type": "eql", | ||
"version": 1 | ||
} |
3 changes: 3 additions & 0 deletions
3
samples/Linux/clean/credential_access_dumping_keychain_security.json.simple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Linux/clean/credential_access_dumping_keychain_security.json | ||
ref/site/url | ||
ref/words/password |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also do this for the
base64_python_functions
rule where JS code was being evaluated in the context of Python code.