2023-02-01 18:55:55 +00:00
|
|
|
-- Canonical example of information to include for processes
|
|
|
|
SELECT
|
|
|
|
-- Child
|
2023-02-02 20:33:25 +00:00
|
|
|
p0.pid AS p0_pid,
|
2023-02-01 18:55:55 +00:00
|
|
|
p0.path AS p0_path,
|
|
|
|
p0.name AS p0_name,
|
2023-05-16 21:18:39 +00:00
|
|
|
p0.start_time AS p0_start,
|
2023-02-01 18:55:55 +00:00
|
|
|
p0.cmdline AS p0_cmd,
|
|
|
|
p0.cwd AS p0_cwd,
|
|
|
|
p0.cgroup_path AS p0_cgroup,
|
|
|
|
p0.euid AS p0_euid,
|
|
|
|
p0_hash.sha256 AS p0_sha256,
|
|
|
|
-- Parent
|
|
|
|
p0.parent AS p1_pid,
|
|
|
|
p1.path AS p1_path,
|
|
|
|
p1.name AS p1_name,
|
2023-05-16 21:18:39 +00:00
|
|
|
p1.start_time AS p1_start,
|
2023-02-01 18:55:55 +00:00
|
|
|
p1.euid AS p1_euid,
|
|
|
|
p1.cmdline AS p1_cmd,
|
|
|
|
p1_hash.sha256 AS p1_sha256,
|
|
|
|
-- Grandparent
|
|
|
|
p1.parent AS p2_pid,
|
|
|
|
p2.name AS p2_name,
|
2023-05-16 21:18:39 +00:00
|
|
|
p2.start_time AS p2_start,
|
2023-02-01 18:55:55 +00:00
|
|
|
p2.path AS p2_path,
|
|
|
|
p2.cmdline AS p2_cmd,
|
|
|
|
p2_hash.sha256 AS p2_sha256
|
|
|
|
FROM
|
2023-05-23 15:31:37 +00:00
|
|
|
processes p0
|
2023-02-01 18:55:55 +00:00
|
|
|
LEFT JOIN hash p0_hash ON p0.path = p0_hash.path
|
|
|
|
LEFT JOIN processes p1 ON p0.parent = p1.pid
|
|
|
|
LEFT JOIN hash p1_hash ON p1.path = p1_hash.path
|
|
|
|
LEFT JOIN processes p2 ON p1.parent = p2.pid
|
|
|
|
LEFT JOIN hash p2_hash ON p2.path = p2_hash.path
|
2023-02-02 22:58:19 +00:00
|
|
|
WHERE
|