config

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 11 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"`
	Seccomp              string `json:"seccomp"`
	VulnerabilityScan    string `json:"vulnerabilityScan"`
}

type CapabilitiesConfig

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

func LoadCapabilitiesConfig

func LoadCapabilitiesConfig(path string) (CapabilitiesConfig, error)

type Component

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

type Components

type Components struct {
	Gateway            Component `mapstructure:"gateway"`
	HostScanner        Component `mapstructure:"hostScanner"`
	Kollector          Component `mapstructure:"kollector"`
	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"`
}

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
	EventReceiverURL() string
	GatewayWebsocketURL() string
	ConcurrencyWorkers() int
	Components() Components
	ContinuousScanEnabled() bool
	CleanUpRoutineInterval() time.Duration
	MatchingRulesFilename() string
	TriggerSecurityFramework() bool
	KubescapeURL() string
	KubevulnURL() string
}

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

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, eventReceiverRestURL string, serviceConfig Config) *OperatorConfig

func (*OperatorConfig) AccessKey

func (c *OperatorConfig) AccessKey() string

func (*OperatorConfig) AccountID

func (c *OperatorConfig) AccountID() string

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) EventReceiverURL

func (c *OperatorConfig) EventReceiverURL() string

func (*OperatorConfig) GatewayWebsocketURL

func (c *OperatorConfig) GatewayWebsocketURL() string

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) TriggerSecurityFramework

func (c *OperatorConfig) TriggerSecurityFramework() bool

type Server

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

Jump to

Keyboard shortcuts

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