config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSocketPath

func GetSocketPath() string

GetSocketPath exports the socket path we are using for the system probe.

func IsBlacklisted

func IsBlacklisted(cmdline []string, blacklist []*regexp.Regexp) bool

IsBlacklisted returns a boolean indicating if the given command is blacklisted by our config.

func LoadSysProbeEnvVariables

func LoadSysProbeEnvVariables()

LoadSysProbeEnvVariables will set the environment variables specific to the system probe

func NewDefaultTransport

func NewDefaultTransport() *http.Transport

NewDefaultTransport provides a http transport configuration with sane default timeouts

func SysProbeConfigFromConfig

func SysProbeConfigFromConfig(cfg *AgentConfig) *ebpf.Config

SysProbeConfigFromConfig returns a valid tracer-bpf config sourced from our agent config

Types

type AgentConfig

type AgentConfig struct {
	Enabled               bool
	HostName              string
	APIEndpoints          []api.Endpoint
	OrchestratorEndpoints []api.Endpoint
	LogFile               string
	LogLevel              string
	LogToConsole          bool
	QueueSize             int // The number of items allowed in each delivery queue.
	ProcessQueueBytes     int // The total number of bytes that can be enqueued for delivery to the process intake endpoint
	PodQueueBytes         int // The total number of bytes that can be enqueued for delivery to the orchestrator endpoint
	Blacklist             []*regexp.Regexp
	Scrubber              *DataScrubber
	MaxPerMessage         int
	MaxConnsPerMessage    int
	AllowRealTime         bool
	Transport             *http.Transport `json:"-"`
	DDAgentBin            string
	StatsdHost            string
	StatsdPort            int
	ProcessExpVarPort     int
	// host type of the agent, used to populate container payload with additional host information
	ContainerHostType model.ContainerHostType

	// System probe collection configuration
	EnableSystemProbe              bool
	DisableTCPTracing              bool
	DisableUDPTracing              bool
	DisableIPv6Tracing             bool
	DisableDNSInspection           bool
	CollectLocalDNS                bool
	SystemProbeAddress             string
	SystemProbeLogFile             string
	MaxTrackedConnections          uint
	SysProbeBPFDebug               bool
	ExcludedBPFLinuxVersions       []string
	ExcludedSourceConnections      map[string][]string
	ExcludedDestinationConnections map[string][]string
	EnableConntrack                bool
	ConntrackMaxStateSize          int
	ConntrackRateLimit             int
	SystemProbeDebugPort           int
	ClosedChannelSize              int
	MaxClosedConnectionsBuffered   int
	MaxConnectionsStateBuffered    int
	OffsetGuessThreshold           uint64

	// DNS stats configuration
	CollectDNSStats bool
	DNSTimeout      time.Duration

	// Orchestrator collection configuration
	OrchestrationCollectionEnabled bool
	KubeClusterName                string

	// Check config
	EnabledChecks  []string
	CheckIntervals map[string]time.Duration

	// Windows-specific config
	Windows WindowsConfig
	// contains filtered or unexported fields
}

AgentConfig is the global config for the process-agent. This information is sourced from config files and the environment variables.

func NewAgentConfig

func NewAgentConfig(loggerName config.LoggerName, yamlPath, netYamlPath string) (*AgentConfig, error)

NewAgentConfig returns an AgentConfig using a configuration file. It can be nil if there is no file available. In this case we'll configure only via environment.

func NewDefaultAgentConfig

func NewDefaultAgentConfig(canAccessContainers bool) *AgentConfig

NewDefaultAgentConfig returns an AgentConfig with defaults initialized

func NewSystemProbeConfig

func NewSystemProbeConfig(loggerName config.LoggerName, yamlPath string) (*AgentConfig, error)

NewSystemProbeConfig returns a system-probe specific AgentConfig using a configuration file. It can be nil if there is no file available. In this case we'll configure only via environment.

func (AgentConfig) CheckInterval

func (a AgentConfig) CheckInterval(checkName string) time.Duration

CheckInterval returns the interval for the given check name, defaulting to 10s if not found.

func (AgentConfig) CheckIsEnabled

func (a AgentConfig) CheckIsEnabled(checkName string) bool

CheckIsEnabled returns a bool indicating if the given check name is enabled.

func (*AgentConfig) LoadProcessYamlConfig

func (a *AgentConfig) LoadProcessYamlConfig(path string) error

LoadProcessYamlConfig load Process-specific configuration

type DataScrubber

type DataScrubber struct {
	Enabled           bool
	StripAllArguments bool
	SensitivePatterns []*regexp.Regexp
	// contains filtered or unexported fields
}

DataScrubber allows the agent to blacklist cmdline arguments that match a list of predefined and custom words

func NewDefaultDataScrubber

func NewDefaultDataScrubber() *DataScrubber

NewDefaultDataScrubber creates a DataScrubber with the default behavior: enabled and matching the default sensitive words

func (*DataScrubber) AddCustomSensitiveWords

func (ds *DataScrubber) AddCustomSensitiveWords(words []string)

AddCustomSensitiveWords adds custom sensitive words on the DataScrubber object

func (*DataScrubber) IncrementCacheAge

func (ds *DataScrubber) IncrementCacheAge()

IncrementCacheAge increments one cycle of cache memory age. If it reaches cacheMaxCycles, the cache is restarted

func (*DataScrubber) ScrubCommand

func (ds *DataScrubber) ScrubCommand(cmdline []string) ([]string, bool)

ScrubCommand hides the argument value for any key which matches a "sensitive word" pattern. It returns the updated cmdline, as well as a boolean representing whether it was scrubbed

func (*DataScrubber) ScrubProcessCommand

func (ds *DataScrubber) ScrubProcessCommand(p *process.FilledProcess) []string

ScrubProcessCommand uses a cache memory to avoid scrubbing already known process' cmdlines

type WindowsConfig

type WindowsConfig struct {
	// Number of checks runs between refreshes of command-line arguments
	ArgsRefreshInterval int
	// Controls getting process arguments immediately when a new process is discovered
	AddNewArgs bool
}

WindowsConfig stores all windows-specific configuration for the process-agent.

Jump to

Keyboard shortcuts

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