config

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Key       string `envconfig:"KEY" yaml:"key"`
	URL       string `envconfig:"URL" yaml:"url"`
	ClusterID string `envconfig:"CLUSTER_ID" yaml:"clusterID"`
}

type CloudScan

type CloudScan struct {
	Enabled      bool          `envconfig:"ENABLED" yaml:"enabled"`
	ScanInterval time.Duration `envconfig:"SCAN_INTERVAL" yaml:"scanInterval"`
	GKE          *CloudScanGKE `envconfig:"GKE" yaml:"gke"`
	EKS          *CloudScanEKS `envconfig:"EKS" yaml:"eks"`
}

type CloudScanEKS

type CloudScanEKS struct {
	ClusterName string `envconfig:"CLUSTER_NAME" yaml:"clusterName"`
}

type CloudScanGKE

type CloudScanGKE struct {
	ClusterName        string `envconfig:"CLUSTER_NAME" yaml:"clusterName"`
	CredentialsFile    string `envconfig:"CREDENTIALS_FILE" yaml:"credentialsFile"`
	ServiceAccountName string `envconfig:"SERVICE_ACCOUNT_NAME" yaml:"serviceAccountName"`
}

type Config

type Config struct {
	PodIP             string        `envconfig:"POD_IP" yaml:"podIP"`
	PodNamespace      string        `envconfig:"POD_NAMESPACE" yaml:"podNamespace"`
	KubeClient        KubeClient    `envconfig:"KUBE_CLIENT" yaml:"kubeClient"`
	Log               Log           `envconfig:"LOG" yaml:"log"`
	API               API           `envconfig:"API" yaml:"api"`
	PprofPort         int           `envconfig:"PPROF_PORT" yaml:"pprofPort"`
	Provider          string        `envconfig:"PROVIDER" yaml:"provider"`
	DeltaSyncInterval time.Duration `envconfig:"DELTA_SYNC_INTERVAL" yaml:"deltaSyncInterval"`
	ImageScan         ImageScan     `envconfig:"IMAGE_SCAN" yaml:"imageScan"`
	Linter            Linter        `envconfig:"LINTER" yaml:"linter"`
	KubeBench         KubeBench     `envconfig:"KUBE_BENCH" yaml:"kubeBench"`
	CloudScan         CloudScan     `envconfig:"CLOUD_SCAN" yaml:"cloudScan"`
}

func Load

func Load(configPath string) (Config, error)

type ImageScan

type ImageScan struct {
	Enabled            bool           `envconfig:"ENABLED" yaml:"enabled"`
	ScanInterval       time.Duration  `envconfig:"SCAN_INTERVAL" yaml:"scanInterval"`
	ScanTimeout        time.Duration  `envconfig:"SCAN_TIMEOUT" yaml:"scanTimeout"`
	MaxConcurrentScans int64          `envconfig:"MAX_CONCURRENT_SCANS" yaml:"maxConcurrentScans"`
	Image              ImageScanImage `envconfig:"IMAGE" yaml:"image"`
	Mode               string         `envconfig:"MODE" yaml:"mode"`
	DockerOptionsPath  string         `envconfig:"DOCKER_OPTIONS_PATH" yaml:"dockerOptionsPath"`
	BlobsCachePort     int            `envconfig:"BLOBS_CACHE_PORT" yaml:"blobsCachePort"`
	CPURequest         string         `envconfig:"CPU_REQUEST" yaml:"cpuRequest"`
	CPULimit           string         `envconfig:"CPU_LIMIT" yaml:"cpuLimit"`
	MemoryRequest      string         `envconfig:"MEMORY_REQUEST" yaml:"memoryRequest"`
	MemoryLimit        string         `envconfig:"MEMORY_LIMIT" yaml:"memoryLimit"`
	Force              bool           `envconfig:"FORCE" yaml:"force"`
	ProfileEnabled     bool           `envconfig:"PROFILE_ENABLED" yaml:"profileEnabled"`
	PhlareEnabled      bool           `envconfig:"PHLARE_ENABLED" yaml:"phlareEnabled"`
}

type ImageScanImage

type ImageScanImage struct {
	Name       string `envconfig:"NAME" yaml:"name"`
	PullPolicy string `envconfig:"PULL_POLICY" yaml:"pullPolicy"`
}

type KubeBench

type KubeBench struct {
	Enabled      bool          `envconfig:"ENABLED" yaml:"enabled"`
	Force        bool          `envconfig:"FORCE" yaml:"force"`
	ScanInterval time.Duration `envconfig:"SCAN_INTERVAL" yaml:"scanInterval"`
}

type KubeClient

type KubeClient struct {
	// K8S client rate limiter allows bursts of up to 'burst' to exceed the QPS, while still maintaining a
	// smoothed qps rate of 'qps'.
	// The bucket is initially filled with 'burst' tokens, and refills at a rate of 'qps'.
	// The maximum number of tokens in the bucket is capped at 'burst'.
	QPS   int `envconfig:"QPS" yaml:"qps"`
	Burst int `envconfig:"BURST" yaml:"burst"`
	// Custom kubeconfig path.
	KubeConfigPath string `envconfig:"KUBECONFIG" yaml:"kubeconfig"`
}

type Linter

type Linter struct {
	Enabled bool `envconfig:"ENABLED" yaml:"enabled"`
}

type Log

type Log struct {
	Level string `envconfig:"LEVEL" yaml:"level"`
}

type SecurityAgentVersion

type SecurityAgentVersion struct {
	GitCommit, GitRef, Version string
}

func (*SecurityAgentVersion) String

func (a *SecurityAgentVersion) String() string

Jump to

Keyboard shortcuts

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