-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
module.go
68 lines (62 loc) · 2.01 KB
/
module.go
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
//go:build linux
// Package probes holds probes related files
package probes
import manager "github.com/DataDog/ebpf-manager"
func getModuleProbes(fentry bool) []*manager.Probe {
// moduleProbes holds the list of probes used to track kernel module events
var moduleProbes = []*manager.Probe{
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
UID: SecurityAgentUID,
EBPFFuncName: "hook_security_kernel_read_file",
},
},
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
UID: SecurityAgentUID,
EBPFFuncName: "module_load",
},
},
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
UID: SecurityAgentUID,
EBPFFuncName: "hook_mod_sysfs_setup",
},
},
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
UID: SecurityAgentUID,
EBPFFuncName: "hook_module_param_sysfs_setup",
},
},
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
UID: SecurityAgentUID,
EBPFFuncName: "hook_security_kernel_module_from_file",
},
},
}
moduleProbes = append(moduleProbes, ExpandSyscallProbes(&manager.Probe{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
UID: SecurityAgentUID,
},
SyscallFuncName: "init_module",
}, fentry, EntryAndExit)...)
moduleProbes = append(moduleProbes, ExpandSyscallProbes(&manager.Probe{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
UID: SecurityAgentUID,
},
SyscallFuncName: "finit_module",
}, fentry, EntryAndExit)...)
moduleProbes = append(moduleProbes, ExpandSyscallProbes(&manager.Probe{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
UID: SecurityAgentUID,
},
SyscallFuncName: "delete_module",
}, fentry, EntryAndExit)...)
return moduleProbes
}