module

package
v0.0.0-...-e70f483 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 69 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package module holds module related files

Package module holds module related files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableRuntimeSecurity

func DisableRuntimeSecurity(config *config.Config)

DisableRuntimeSecurity disables all the runtime security features

func SendCustomEventKillAction

func SendCustomEventKillAction(probe *sprobe.Probe, tags []string, actionReports []model.ActionReport)

SendCustomEventKillAction sends a custom remediation event for each resolved kill action report

func UpdateEventMonitorOpts

func UpdateEventMonitorOpts(opts *eventmonitor.Opts, config *config.Config)

UpdateEventMonitorOpts adapt the event monitor options

Types

type APIServer

type APIServer struct {
	api.UnimplementedSecurityModuleEventServer
	api.UnimplementedSecurityModuleCmdServer
	// contains filtered or unexported fields
}

APIServer represents a gRPC server in charge of receiving events sent by the runtime security system-probe module and forwards them to Datadog

func NewAPIServer

func NewAPIServer(cfg *config.RuntimeSecurityConfig, probe *sprobe.Probe, msgSender MsgSender[api.SecurityEventMessage], client statsd.ClientInterface, selfTester *selftests.SelfTester, compression compression.Component, hostname string, stopChan chan struct{}, secretsComp secrets.Component, filterStore workloadfilter.Component) (*APIServer, error)

NewAPIServer returns a new gRPC event server

func (*APIServer) ApplyPolicyStates

func (a *APIServer) ApplyPolicyStates(policies []*monitor.PolicyState)

ApplyPolicyStates the policy states

func (*APIServer) ApplyRuleIDs

func (a *APIServer) ApplyRuleIDs(ruleIDs []rules.RuleID)

ApplyRuleIDs the rule ids

func (*APIServer) DumpActivity

func (a *APIServer) DumpActivity(_ context.Context, params *api.ActivityDumpParams) (*api.ActivityDumpMessage, error)

DumpActivity handles an activity dump request

func (*APIServer) DumpDiscarders

DumpDiscarders handles discarder dump requests

func (*APIServer) DumpNetworkNamespace

DumpNetworkNamespace handles network namespace cache dump requests

func (*APIServer) DumpProcessCache

DumpProcessCache handles process cache dump requests

func (*APIServer) GetActivityDumpStream

func (a *APIServer) GetActivityDumpStream(_ *empty.Empty, stream api.SecurityModuleEvent_GetActivityDumpStreamServer) error

GetActivityDumpStream transfers dumps to the security-agent. Communication security-agent -> system-probe

func (*APIServer) GetConfig

GetConfig returns config of the runtime security module required by the security agent

func (*APIServer) GetEventStream

GetEventStream transfers events to the security-agent. Communication security-agent -> system-probe

func (*APIServer) GetLoadedPolicies

GetLoadedPolicies returns the currently loaded policies as JSON

func (*APIServer) GetRuleSetReport

GetRuleSetReport reports the ruleset loaded

func (*APIServer) GetSECLVariables

func (a *APIServer) GetSECLVariables() map[string]*api.SECLVariableState

GetSECLVariables returns the SECL variables and their value

func (*APIServer) GetStatus

func (a *APIServer) GetStatus(_ context.Context, _ *api.GetStatusParams) (*api.Status, error)

GetStatus returns the status of the module

func (*APIServer) ListActivityDumps

func (a *APIServer) ListActivityDumps(_ context.Context, params *api.ActivityDumpListParams) (*api.ActivityDumpListMessage, error)

ListActivityDumps returns the list of active dumps

func (*APIServer) ListSecurityProfiles

ListSecurityProfiles returns the list of security profiles

func (*APIServer) ReloadPolicies

ReloadPolicies reloads the policies

func (*APIServer) RunSelfTest

RunSelfTest runs self test and then reload the current policies

func (*APIServer) SaveSecurityProfile

SaveSecurityProfile saves the requested security profile to disk

func (*APIServer) SendActivityDump

func (a *APIServer) SendActivityDump(imageName string, imageTag string, header []byte, data []byte)

SendActivityDump queues an activity dump to the chan of activity dumps

func (*APIServer) SendEvent

func (a *APIServer) SendEvent(rule *rules.Rule, event events.Event, extTagsCb func() ([]string, bool), service string)

SendEvent forwards events sent by the runtime security module to Datadog

func (*APIServer) SendStats

func (a *APIServer) SendStats() error

SendStats sends statistics

func (*APIServer) SetCWSConsumer

func (a *APIServer) SetCWSConsumer(consumer *CWSConsumer)

SetCWSConsumer sets the CWS consumer

func (*APIServer) Start

func (a *APIServer) Start(ctx context.Context)

Start the api server, starts to consume the msg queue

func (*APIServer) Stop

func (a *APIServer) Stop()

Stop stops the API server. The start goroutine must finish before the stopper closes pipeline channels, otherwise sends to logChan will panic.

func (*APIServer) StopActivityDump

StopActivityDump stops an active activity dump if it exists

func (*APIServer) TranscodingRequest

TranscodingRequest encodes an activity dump following the requested parameters

type ActivityDumpMsgSender

type ActivityDumpMsgSender = MsgSender[api.ActivityDumpStreamMessage]

ActivityDumpMsgSender defines a message sender for activity dump messages

type CWSConsumer

type CWSConsumer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

CWSConsumer represents the system-probe module for the runtime security agent

func NewCWSConsumer

func NewCWSConsumer(cmdServer *CommandServer, evm *eventmonitor.EventMonitor, cfg *config.RuntimeSecurityConfig, wmeta workloadmeta.Component, filterStore workloadfilter.Component, opts Opts, compression compression.Component, ipc ipc.Component, hostname string, secretsComp secrets.Component) (*CWSConsumer, error)

NewCWSConsumer initializes the module with options

func (*CWSConsumer) APIServer

func (c *CWSConsumer) APIServer() *APIServer

APIServer returns the api server

func (*CWSConsumer) GetRuleEngine

func (c *CWSConsumer) GetRuleEngine() *rulesmodule.RuleEngine

GetRuleEngine returns new current rule engine

func (*CWSConsumer) GetStatus

func (c *CWSConsumer) GetStatus(ctx context.Context) (*api.Status, error)

GetStatus returns the status of the module

func (*CWSConsumer) HandleActivityDump

func (c *CWSConsumer) HandleActivityDump(imageName string, imageTag string, header []byte, data []byte) error

HandleActivityDump sends an activity dump to the backend

func (*CWSConsumer) HandleCustomEvent

func (c *CWSConsumer) HandleCustomEvent(rule *rules.Rule, event *events.CustomEvent)

HandleCustomEvent is called by the probe when an event should be sent to Datadog but doesn't need evaluation

func (*CWSConsumer) ID

func (c *CWSConsumer) ID() string

ID returns id for CWS

func (*CWSConsumer) PostProbeStart

func (c *CWSConsumer) PostProbeStart() error

PostProbeStart is called after the event stream is started

func (*CWSConsumer) PrepareForFunctionalTests

func (c *CWSConsumer) PrepareForFunctionalTests()

PrepareForFunctionalTests tweaks the module to be ready for functional tests currently it: - disables the container running telemetry

func (*CWSConsumer) RunSelfTest

func (c *CWSConsumer) RunSelfTest(gRPC bool) (bool, error)

RunSelfTest runs the self tests

func (*CWSConsumer) SendEvent

func (c *CWSConsumer) SendEvent(rule *rules.Rule, event events.Event, extTagsCb func() ([]string, bool), service string)

SendEvent sends an event to the backend after checking that the rate limiter allows it for the provided rule Implements the EventSender interface

func (*CWSConsumer) SendStats

func (c *CWSConsumer) SendStats()

SendStats send stats

func (*CWSConsumer) Start

func (c *CWSConsumer) Start() error

Start the module

func (*CWSConsumer) Stop

func (c *CWSConsumer) Stop()

Stop closes the module

type ChanMsgSender

type ChanMsgSender[T any] struct {
	// contains filtered or unexported fields
}

ChanMsgSender defines a chan message sender

func NewChanMsgSender

func NewChanMsgSender[T any](msgs chan *T) *ChanMsgSender[T]

NewChanMsgSender returns a new chan sender

func (*ChanMsgSender[T]) Send

func (cs *ChanMsgSender[T]) Send(msg *T, expireFnc func(*T))

Send the message

func (*ChanMsgSender[T]) SendTelemetry

func (cs *ChanMsgSender[T]) SendTelemetry(statsd.ClientInterface)

SendTelemetry sends telemetry data

type CommandServer

type CommandServer struct {
	// contains filtered or unexported fields
}

CommandServer is the gRPC server for the module command API

func NewCommandServer

func NewCommandServer(cfg *config.RuntimeSecurityConfig) (*CommandServer, error)

NewCommandServer initializes the gRPC server for the module command API

func (*CommandServer) Start

func (c *CommandServer) Start() error

Start starts the command server

func (*CommandServer) Stop

func (c *CommandServer) Stop()

Stop stops the command server

type DirectActivityDumpMsgSender

type DirectActivityDumpMsgSender struct {
	// contains filtered or unexported fields
}

DirectActivityDumpMsgSender defines a direct activity dump sender

func NewDirectActivityDumpMsgSender

func NewDirectActivityDumpMsgSender() (*DirectActivityDumpMsgSender, error)

NewDirectActivityDumpMsgSender returns a new direct activity dump sender

func (*DirectActivityDumpMsgSender) GetEndpointsStatus

func (ds *DirectActivityDumpMsgSender) GetEndpointsStatus() []string

GetEndpointsStatus returns the status of the endpoints

func (*DirectActivityDumpMsgSender) Send

Send the message

func (*DirectActivityDumpMsgSender) SendTelemetry

func (ds *DirectActivityDumpMsgSender) SendTelemetry(statsd statsd.ClientInterface)

SendTelemetry sends telemetry data

type DirectEventMsgSender

type DirectEventMsgSender struct {
	// contains filtered or unexported fields
}

DirectEventMsgSender defines a direct sender

func NewDirectEventMsgSender

func NewDirectEventMsgSender(stopper startstop.Stopper, compression compression.Component, hostname string, secretsComp secrets.Component) (*DirectEventMsgSender, error)

NewDirectEventMsgSender returns a new direct sender

func (*DirectEventMsgSender) GetEndpointsStatus

func (ds *DirectEventMsgSender) GetEndpointsStatus() []string

GetEndpointsStatus returns the status of the endpoints

func (*DirectEventMsgSender) Send

Send the message

func (*DirectEventMsgSender) SendTelemetry

func (ds *DirectEventMsgSender) SendTelemetry(statsd.ClientInterface)

SendTelemetry sends telemetry data

type EndpointsStatusFetcher

type EndpointsStatusFetcher interface {
	GetEndpointsStatus() []string
}

EndpointsStatusFetcher defines an interface to get the status of the endpoints

type EventMsgSender

type EventMsgSender = MsgSender[api.SecurityEventMessage]

EventMsgSender defines a message sender for security events

type MsgSender

type MsgSender[T any] interface {
	Send(msg *T, expireFnc func(*T))
	SendTelemetry(statsd.ClientInterface)
}

MsgSender defines a message sender

type Opts

type Opts struct {
	EventSender events.EventSender
	MsgSender   EventMsgSender
}

Opts define module options

type Reloader

type Reloader struct {
	// contains filtered or unexported fields
}

Reloader aims to handle policies reloading triggers

func NewReloader

func NewReloader() *Reloader

NewReloader returns a new Reloader

func (*Reloader) Chan

func (r *Reloader) Chan() <-chan struct{}

Chan returns the chan of reload events

func (*Reloader) Start

func (r *Reloader) Start() error

Start the reloader

func (*Reloader) Stop

func (r *Reloader) Stop()

Stop the Reloader

type ReloaderInterface

type ReloaderInterface interface {
	Start() error
	Stop()
	Chan() <-chan struct{}
}

ReloaderInterface aims to handle policies reloading triggers

type RemoteEventServer

type RemoteEventServer struct {
	api.UnimplementedSecurityAgentAPIServer
	// contains filtered or unexported fields
}

RemoteEventServer implements the SecurityAgentAPI gRPC service in system-probe, allowing remote system-probes (e.g., running in micro VMs) to connect via vsock and forward their security events to the host system-probe for backend delivery.

func NewRemoteEventServer

func NewRemoteEventServer(apiServer *APIServer) *RemoteEventServer

NewRemoteEventServer returns a RemoteEventServer wired to the given APIServer's senders.

func (*RemoteEventServer) SendActivityDumpStream

SendActivityDumpStream receives activity dumps from a remote system-probe and forwards them through the local pipeline.

func (*RemoteEventServer) SendEvent

SendEvent receives security events from a remote system-probe and forwards them through the local pipeline.

type SBOMAPIServer

type SBOMAPIServer struct {
	sbomapi.UnimplementedSBOMCollectorServer
	// contains filtered or unexported fields
}

SBOMAPISServer represents a gRPC server in charge of receiving SBOM requests sent by

func NewSBOMAPIServer

func NewSBOMAPIServer(probe *sprobe.Probe, stopChan chan struct{}) *SBOMAPIServer

NewSBOMAPIServer returns a new gRPC SBOM server

func (*SBOMAPIServer) GetSBOMStream

GetSBOMStream handles SBOM stream requests

type SecurityAgentAPIClient

type SecurityAgentAPIClient struct {
	SecurityAgentAPIClient api.SecurityAgentAPIClient
	// contains filtered or unexported fields
}

SecurityAgentAPIClient is used to send request to security module

func NewSecurityAgentAPIClient

func NewSecurityAgentAPIClient(cfg *config.RuntimeSecurityConfig) (*SecurityAgentAPIClient, error)

NewSecurityAgentAPIClient instantiates a new SecurityAgentAPIClient

func (*SecurityAgentAPIClient) SendActivityDumps

func (c *SecurityAgentAPIClient) SendActivityDumps(ctx context.Context, msgs chan *api.ActivityDumpStreamMessage)

SendActivityDumps sends activity dumps to the security agent

func (*SecurityAgentAPIClient) SendEvents

func (c *SecurityAgentAPIClient) SendEvents(ctx context.Context, msgs chan *api.SecurityEventMessage, onConnectCb func())

SendEvents sends events to the security agent

type UsageConsumer

type UsageConsumer struct {
	*CommandServer
	// contains filtered or unexported fields
}

UsageConsumer is a minimal event consumer that brings up the security probe (including the SBOM resolver) without the CWS rule engine or billing metrics. It is active when runtime_security_config.sbom.enabled is true but runtime_security_config.enabled is false, so that customers using only SBOM enrichment are not billed for CWS.

func NewUsageConsumer

func NewUsageConsumer(cmdServer *CommandServer, evm *eventmonitor.EventMonitor, cfg *config.RuntimeSecurityConfig, stopChan chan struct{}) (*UsageConsumer, error)

NewUsageConsumer initializes the UsageConsumer

func (*UsageConsumer) ID

func (u *UsageConsumer) ID() string

ID returns the identifier for the usage consumer

func (*UsageConsumer) Start

func (u *UsageConsumer) Start() error

Start starts the usage consumer

func (*UsageConsumer) Stop

func (u *UsageConsumer) Stop()

Stop stops the usage consumer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL