config

package
v0.2.121 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServiceURLs

func GetServiceURLs(filePath string) (schema.IBackendServices, error)

func LoadClusterConfig

func LoadClusterConfig() (utilsmetadata.ClusterConfig, error)

func ValidateConfig

func ValidateConfig(config IConfig) error

Types

type Capabilities

type Capabilities struct {
	ConfigurationScan    string `json:"configurationScan"`
	ContinuousScan       string `json:"continuousScan"`
	NetworkGenerator     string `json:"networkGenerator"`
	NodeScan             string `json:"nodeScan"`
	Otel                 string `json:"otel"`
	Relevancy            string `json:"relevancy"`
	RuntimeObservability string `json:"runtimeObservability"`
	NodeSbomGeneration   string `json:"nodeSbomGeneration"`
	Seccomp              string `json:"seccomp"`
	VulnerabilityScan    string `json:"vulnerabilityScan"`
	AdmissionController  string `json:"admissionController"`
}

type CapabilitiesConfig

type CapabilitiesConfig struct {
	Capabilities      Capabilities      `mapstructure:"capabilities"`
	Components        Components        `mapstructure:"components"`
	Configurations    Configurations    `mapstructure:"configurations"`
	ServiceScanConfig ServiceScanConfig `mapstructure:"serviceScanConfig"`
}

func LoadCapabilitiesConfig

func LoadCapabilitiesConfig(path string) (CapabilitiesConfig, error)

type Component

type Component struct {
	Enabled bool `json:"enabled"`
}

type Components

type Components struct {
	HostScanner        Component `mapstructure:"hostScanner"`
	Kubescape          Component `mapstructure:"kubescape"`
	KubescapeScheduler Component `mapstructure:"kubescapeScheduler"`
	Kubevuln           Component `mapstructure:"kubevuln"`
	KubevulnScheduler  Component `mapstructure:"kubevulnScheduler"`
	NodeAgent          Component `mapstructure:"nodeAgent"`
	Operator           Component `mapstructure:"operator"`
	OtelCollector      Component `mapstructure:"otelCollector"`
	Persistence        Component `mapstructure:"persistence"`
	ServiceDiscovery   Component `mapstructure:"serviceDiscovery"`
	Storage            Component `mapstructure:"storage"`
}

type Config

type Config struct {
	Namespace                string        `mapstructure:"namespace"`
	RestAPIPort              string        `mapstructure:"port"`
	CleanUpRoutineInterval   time.Duration `mapstructure:"cleanupDelay"`
	ConcurrencyWorkers       int           `mapstructure:"workerConcurrency"`
	TriggerSecurityFramework bool          `mapstructure:"triggerSecurityFramework"`
	MatchingRulesFilename    string        `mapstructure:"matchingRulesFilename"`
	// EventDeduplicationInterval is the interval during which duplicate events will be silently dropped from processing via continuous scanning
	EventDeduplicationInterval time.Duration                 `mapstructure:"eventDeduplicationInterval"`
	HTTPExporterConfig         *exporters.HTTPExporterConfig `mapstructure:"httpExporterConfig"`
	ExcludeNamespaces          []string                      `mapstructure:"excludeNamespaces"`
	IncludeNamespaces          []string                      `mapstructure:"includeNamespaces"`
	// PodScanGuardTime specifies the minimum age a pod without a parent must have before it is scanned
	PodScanGuardTime              time.Duration                  `mapstructure:"podScanGuardTime"`
	RegistryScanningSkipTlsVerify bool                           `mapstructure:"registryScanningSkipTlsVerify"`
	RegistryScanningInsecure      bool                           `mapstructure:"registryScanningInsecure"`
	ExcludeJsonPaths              []string                       `mapstructure:"excludeJsonPaths"`
	RulesUpdateConfig             rulesupdate.RulesUpdaterConfig `mapstructure:"rulesUpdateConfig"`
	SkipProfilesWithoutInstances  bool                           `mapstructure:"skipProfilesWithoutInstances"`
	NodeAgentAutoscaler           NodeAgentAutoscalerConfig      `mapstructure:"nodeAgentAutoscaler"`
}

func LoadConfig

func LoadConfig(path string) (Config, error)

type Configurations

type Configurations struct {
	Persistence string `json:"persistence"`
	Server      Server `json:"server"`
}

type IConfig

type IConfig interface {
	Namespace() string
	AccountID() string
	AccessKey() string
	ClusterName() string
	ConcurrencyWorkers() int
	Components() Components
	AdmissionControllerEnabled() bool
	ContinuousScanEnabled() bool
	NodeSbomGenerationEnabled() bool
	CleanUpRoutineInterval() time.Duration
	MatchingRulesFilename() string
	TriggerSecurityFramework() bool
	KubescapeURL() string
	KubevulnURL() string
	SkipNamespace(ns string) bool
	GuardTime() time.Duration
	RegistryScanningSkipTlsVerify() bool
	RegistryScanningInsecure() bool
	ExcludeJsonPaths() []string
	SkipProfilesWithoutInstances() bool
	RulesUpdateEnabled() bool
	NodeAgentAutoscalerConfig() NodeAgentAutoscalerConfig
}

IConfig is an interface for all config types used in the operator

type NodeAgentAutoscalerConfig added in v0.2.121

type NodeAgentAutoscalerConfig struct {
	Enabled                bool                                   `json:"enabled" mapstructure:"enabled"`
	NodeGroupLabel         string                                 `json:"nodeGroupLabel" mapstructure:"nodeGroupLabel"`
	ResourcePercentages    NodeAgentAutoscalerResourcePercentages `json:"resourcePercentages" mapstructure:"resourcePercentages"`
	MinResources           NodeAgentAutoscalerResourceBounds      `json:"minResources" mapstructure:"minResources"`
	MaxResources           NodeAgentAutoscalerResourceBounds      `json:"maxResources" mapstructure:"maxResources"`
	ReconcileInterval      time.Duration                          `json:"reconcileInterval" mapstructure:"reconcileInterval"`
	TemplatePath           string                                 `json:"templatePath" mapstructure:"templatePath"`
	OperatorDeploymentName string                                 `json:"operatorDeploymentName" mapstructure:"operatorDeploymentName"`
}

NodeAgentAutoscalerConfig defines the configuration for node agent autoscaling

type NodeAgentAutoscalerResourceBounds added in v0.2.121

type NodeAgentAutoscalerResourceBounds struct {
	CPU    string `json:"cpu" mapstructure:"cpu"`
	Memory string `json:"memory" mapstructure:"memory"`
}

NodeAgentAutoscalerResourceBounds defines min/max resource bounds

type NodeAgentAutoscalerResourcePercentages added in v0.2.121

type NodeAgentAutoscalerResourcePercentages struct {
	RequestCPU    int `json:"requestCPU" mapstructure:"requestCPU"`
	RequestMemory int `json:"requestMemory" mapstructure:"requestMemory"`
	LimitCPU      int `json:"limitCPU" mapstructure:"limitCPU"`
	LimitMemory   int `json:"limitMemory" mapstructure:"limitMemory"`
}

NodeAgentAutoscalerResourcePercentages defines the resource percentages for autoscaling

type OperatorConfig

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

OperatorConfig implements IConfig

func NewOperatorConfig

func NewOperatorConfig(components CapabilitiesConfig, clusterConfig utilsmetadata.ClusterConfig, creds *utils.Credentials, serviceConfig Config) *OperatorConfig

func (*OperatorConfig) AccessKey

func (c *OperatorConfig) AccessKey() string

func (*OperatorConfig) AccountID

func (c *OperatorConfig) AccountID() string

func (*OperatorConfig) AdmissionControllerEnabled added in v0.2.31

func (c *OperatorConfig) AdmissionControllerEnabled() bool

func (*OperatorConfig) CleanUpRoutineInterval

func (c *OperatorConfig) CleanUpRoutineInterval() time.Duration

func (*OperatorConfig) ClusterName

func (c *OperatorConfig) ClusterName() string

func (*OperatorConfig) Components

func (c *OperatorConfig) Components() Components

func (*OperatorConfig) ConcurrencyWorkers

func (c *OperatorConfig) ConcurrencyWorkers() int

func (*OperatorConfig) ContinuousScanEnabled

func (c *OperatorConfig) ContinuousScanEnabled() bool

func (*OperatorConfig) ExcludeJsonPaths added in v0.2.88

func (c *OperatorConfig) ExcludeJsonPaths() []string

func (*OperatorConfig) GuardTime added in v0.2.31

func (c *OperatorConfig) GuardTime() time.Duration

func (*OperatorConfig) HttpExporterConfig added in v0.2.31

func (c *OperatorConfig) HttpExporterConfig() *exporters.HTTPExporterConfig

func (*OperatorConfig) KubescapeURL

func (c *OperatorConfig) KubescapeURL() string

func (*OperatorConfig) KubevulnURL

func (c *OperatorConfig) KubevulnURL() string

func (*OperatorConfig) MatchingRulesFilename

func (c *OperatorConfig) MatchingRulesFilename() string

func (*OperatorConfig) Namespace

func (c *OperatorConfig) Namespace() string

func (*OperatorConfig) NodeAgentAutoscalerConfig added in v0.2.121

func (c *OperatorConfig) NodeAgentAutoscalerConfig() NodeAgentAutoscalerConfig

func (*OperatorConfig) NodeSbomGenerationEnabled added in v0.2.50

func (c *OperatorConfig) NodeSbomGenerationEnabled() bool

func (*OperatorConfig) RegistryScanningInsecure added in v0.2.82

func (c *OperatorConfig) RegistryScanningInsecure() bool

func (*OperatorConfig) RegistryScanningSkipTlsVerify added in v0.2.82

func (c *OperatorConfig) RegistryScanningSkipTlsVerify() bool

func (*OperatorConfig) RulesUpdateEnabled added in v0.2.119

func (c *OperatorConfig) RulesUpdateEnabled() bool

func (*OperatorConfig) SkipNamespace added in v0.2.31

func (c *OperatorConfig) SkipNamespace(ns string) bool

func (*OperatorConfig) SkipProfilesWithoutInstances added in v0.2.108

func (c *OperatorConfig) SkipProfilesWithoutInstances() bool

func (*OperatorConfig) TriggerSecurityFramework

func (c *OperatorConfig) TriggerSecurityFramework() bool

type Server

type Server struct {
	Account      string `json:"account"`
	DiscoveryURL string `json:"discoveryUrl"`
	OtelURL      string `json:"otelUrl"`
}

type ServiceScanConfig added in v0.2.31

type ServiceScanConfig struct {
	Enabled  bool          `json:"enabled"`
	Interval time.Duration `json:"interval"`
}

Jump to

Keyboard shortcuts

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