imagescan

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled                   bool          `json:"enabled"`
	CastaiSecretRefName       string        `json:"castaiSecretRefName"`
	ScanInterval              time.Duration `validate:"required" json:"scanInterval"`
	ScanTimeout               time.Duration `json:"scanTimeout"`
	MaxConcurrentScans        int64         `validate:"required" json:"maxConcurrentScans"`
	ScanJobImagePullPolicy    string        `json:"scanJobImagePullPolicy"`
	Mode                      string        `json:"mode"`
	CPURequest                string        `json:"CPURequest"`
	CPULimit                  string        `json:"CPULimit"`
	MemoryRequest             string        `json:"memoryRequest"`
	MemoryLimit               string        `json:"memoryLimit"`
	ProfileEnabled            bool          `json:"profileEnabled"`
	PhlareEnabled             bool          `json:"phlareEnabled"`
	PrivateRegistryPullSecret string        `json:"privateRegistryPullSecret"`
	ServiceAccount            string        `json:"serviceAccount"`
	InitDelay                 time.Duration `json:"initDelay"`
	CastaiGRPCAddress         string        `json:"castaiGRPCAddress"`
	CastaiClusterID           string        `json:"castaiClusterID"`
	CastaiGrpcInsecure        bool          `json:"castaiGrpcInsecure"`
	ImageScanBlobsCacheURL    string        `json:"imageScanBlobsCacheURL"`
	CloudProvider             string        `json:"cloudProvider"`
	IgnoredNamespaces         []string      `json:"ignoredNamespaces"`
	DisabledAnalyzers         []string      `json:"disabledAnalyzers"`
}

type Controller

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

func NewController

func NewController(
	log *logging.Logger,
	cfg Config,
	imageScanner imageScanner,
	client castaiClient,
	kubeController kubeClient,
) *Controller

func (*Controller) OnAdd

func (c *Controller) OnAdd(obj kube.Object)

func (*Controller) OnDelete

func (c *Controller) OnDelete(obj kube.Object)

func (*Controller) OnUpdate

func (c *Controller) OnUpdate(obj kube.Object)

func (*Controller) RequiredTypes

func (c *Controller) RequiredTypes() []reflect.Type

func (*Controller) Run

func (c *Controller) Run(ctx context.Context) error

type ImageScanImage

type ImageScanImage struct {
	PullPolicy string `envconfig:"IMAGE_SCAN_IMAGE_PULL_POLICY" yaml:"pullPolicy"`
}

type Log

type Log struct {
	Timestamp string
	Level     string
	Message   string
	Component string
}

type ScanImageParams

type ScanImageParams struct {
	ImageName                   string // Example: ghcr.io/castai/kvisor/kvisor:8889dc92d6c69420a811de4fc67e619a30c028e9
	ImageID                     string // Example: ghcr.io/castai/kvisor/kvisor@sha256:2db087348c66274941013a3163036b1ca09da03ea64e9f9cdd79b8f647e4fe44
	ContainerRuntime            string
	Mode                        string
	NodeName                    string
	ResourceIDs                 []string
	DeleteFinishedJob           bool
	WaitForCompletion           bool
	WaitDurationAfterCompletion time.Duration
	Architecture                string
	Os                          string

	ScanImageDetails kube.ImageDetails
}

type Scanner

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

func NewImageScanner

func NewImageScanner(client kubernetes.Interface, cfg Config, podNamespace string) *Scanner

func (*Scanner) ScanImage

func (s *Scanner) ScanImage(ctx context.Context, params ScanImageParams) (rerr error)

Jump to

Keyboard shortcuts

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