/
cws_linux.go
37 lines (31 loc) · 1.33 KB
/
cws_linux.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
// 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.
package module
import (
"github.com/DataDog/datadog-agent/pkg/eventmonitor"
"github.com/DataDog/datadog-agent/pkg/security/config"
"github.com/DataDog/datadog-agent/pkg/security/probe"
)
// UpdateEventMonitorOpts adapt the event monitor options
func UpdateEventMonitorOpts(opts *eventmonitor.Opts, config *config.Config) {
opts.ProbeOpts.PathResolutionEnabled = true
opts.ProbeOpts.TTYFallbackEnabled = true
opts.ProbeOpts.SyscallsMonitorEnabled = config.Probe.SyscallsMonitorEnabled
opts.ProbeOpts.EBPFLessEnabled = config.RuntimeSecurity.EBPFLessEnabled
}
// DisableRuntimeSecurity disables all the runtime security features
func DisableRuntimeSecurity(config *config.Config) {
config.Probe.NetworkEnabled = false
config.RuntimeSecurity.ActivityDumpEnabled = false
config.RuntimeSecurity.SecurityProfileEnabled = false
}
// platform specific init function
func (c *CWSConsumer) init(evm *eventmonitor.EventMonitor, _ *config.RuntimeSecurityConfig, _ Opts) error {
// Activity dumps related
if p, ok := evm.Probe.PlatformProbe.(*probe.EBPFProbe); ok {
p.AddActivityDumpHandler(c)
}
return nil
}