agent

package
v15.6.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingCadence = errors.New("cadence is a required field")
View Source
var TrivyScanner = report.ScannerDetails{
	ID:   "starboard_trivy",
	Name: "Trivy (via Starboard Operator)",
	Vendor: report.Vendor{
		Name: "GitLab",
	},
}

Functions

func IsSupportedScanner

func IsSupportedScanner(scannerName string) bool

Types

type CronScheduler

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

CronScheduler can run tasks on a cron schedule, with cancellation.

func NewCronScheduler

func NewCronScheduler() *CronScheduler

func (*CronScheduler) Run

func (s *CronScheduler) Run(ctx context.Context)

func (*CronScheduler) Schedule

func (s *CronScheduler) Schedule(ctx context.Context, schedule cron.Schedule, job Job)

type Factory

type Factory struct{}

func (*Factory) Name

func (f *Factory) Name() string

func (*Factory) New

func (f *Factory) New(cfg *modagent.Config) (modagent.Module, error)

func (*Factory) UsesInternalServer added in v15.1.0

func (f *Factory) UsesInternalServer() bool

type Job

type Job interface {
	// Run executes the cron task. It should cancel whatever it
	// is doing upon receiving a signal from ctx.Done.
	Run(context.Context)
}

type Payload

type Payload struct {
	Vulnerability *report.Vulnerability `json:"vulnerability"`
	Scanner       report.ScannerDetails `json:"scanner"`
}

func Convert

func Convert(vulnReport *v1alpha1.VulnerabilityReport, agentID int64) ([]*Payload, error)

Convert turns a Starboard vulnerability report into a slice of payloads which can be sent to the internal vulnerability API

type Reporter

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

func NewReporter

func NewReporter(log *zap.Logger, api modagent.Api) *Reporter

func (*Reporter) ResolveVulnerabilities added in v15.2.0

func (r *Reporter) ResolveVulnerabilities(ctx context.Context, uuids []string) (retError error)

func (*Reporter) Transmit

func (r *Reporter) Transmit(ctx context.Context, payloads []*Payload) ([]string, error)

type SecurityPolicyConfiguration added in v15.5.0

type SecurityPolicyConfiguration struct {
	Cadence    string    `json:"cadence"`
	Namespaces []string  `json:"namespaces"`
	UpdatedAt  time.Time `json:"updated_at"`
}

type VulnerabilityReportScanner

type VulnerabilityReportScanner interface {
	Scan(context.Context, kube.ObjectRef) ([]v1alpha1.VulnerabilityReport, error)
}

Jump to

Keyboard shortcuts

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