HIGH
Source
Tracee
ID
TRC-6
Version
0.1.0
Date
1 Dec 2024

Kernel Module Loading

Attempt to load a kernel module detection

MITRE ATT&CK

Persistence: Kernel Modules and Extensions

Rego Policy

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package tracee.TRC_6

import data.tracee.helpers

__rego_metadoc__ := {
	"id": "TRC-6",
	"version": "0.1.0",
	"name": "kernel module loading",
	"eventName": "kernel_module_loading",
	"description": "Attempt to load a kernel module detection",
	"tags": ["linux", "container"],
	"properties": {
		"Severity": 3,
		"MITRE ATT&CK": "Persistence: Kernel Modules and Extensions",
	},
}

eventSelectors := [
	{
		"source": "tracee",
		"name": "init_module",
	},
	{
		"source": "tracee",
		"name": "security_kernel_read_file",
	},
]

tracee_selected_events[eventSelector] {
	eventSelector := eventSelectors[_]
}

tracee_match {
	input.eventName == "init_module"
}

tracee_match = res {
	input.eventName == "security_kernel_read_file"

	load_type = helpers.get_tracee_argument("type")

	load_type == "kernel-module"

	res := {"pathname": helpers.get_tracee_argument("pathname")}
}