mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Update standard-query-library.yml to detect Log4J (#3367)
Added query to detect Log4j in response to CVE-2021–44228 on macOS and Linux Co-authored-by: Zach Wasserman <zach@fleetdm.com>
This commit is contained in:
parent
0cc57bd294
commit
00ccdfdce8
1 changed files with 47 additions and 0 deletions
|
|
@ -556,3 +556,50 @@ spec:
|
|||
query: SELECT * FROM last WHERE username = "root" AND time > (( SELECT unix_time FROM time ) - 86400 );
|
||||
purpose: Informational
|
||||
contributors: DominusKelvin
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: query
|
||||
spec:
|
||||
name: Detect active processes with Log4j running
|
||||
platforms: macOS, Linux
|
||||
description: Returns a list of active processes and the Jar paths which are using Log4j. Version numbers are usually within the Jar filename.
|
||||
query: |
|
||||
WITH target_jars AS (
|
||||
SELECT DISTINCT path
|
||||
FROM (
|
||||
WITH split(word, str) AS(
|
||||
SELECT '', cmdline || ' '
|
||||
FROM processes
|
||||
UNION ALL
|
||||
SELECT substr(str, 0, instr(str, ' ')), substr(str, instr(str, ' ') + 1)
|
||||
FROM split
|
||||
WHERE str != '')
|
||||
SELECT word AS path
|
||||
FROM split
|
||||
WHERE word LIKE '%.jar'
|
||||
UNION ALL
|
||||
SELECT path
|
||||
FROM process_open_files
|
||||
WHERE path LIKE '%.jar'
|
||||
)
|
||||
)
|
||||
SELECT path, matches
|
||||
FROM yara
|
||||
WHERE path IN (SELECT path FROM target_jars)
|
||||
AND count > 0
|
||||
AND sigrule IN (
|
||||
'rule log4jJndiLookup {
|
||||
strings:
|
||||
$jndilookup = "JndiLookup"
|
||||
condition:
|
||||
$jndilookup
|
||||
}',
|
||||
'rule log4jJavaClass {
|
||||
strings:
|
||||
$javaclass = "org/apache/logging/log4j"
|
||||
condition:
|
||||
$javaclass
|
||||
}'
|
||||
);
|
||||
purpose: Detection
|
||||
contributors: zwass,tgauda
|
||||
|
|
|
|||
Loading…
Reference in a new issue