types

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	Severity FindingSeverity
	Message  string
}

Finding represents a single scanner finding with severity.

type FindingSeverity

type FindingSeverity string

FindingSeverity is the severity of a scanner finding for fail-on-error/warning logic.

const (
	SeverityError   FindingSeverity = "error"
	SeverityWarning FindingSeverity = "warning"
	SeverityInfo    FindingSeverity = "info"
)

type ScanResult

type ScanResult struct {
	Safe          bool
	Skipped       bool
	SkippedReason string
	Findings      []Finding
}

ScanResult is the result of running a scanner on a single record.

func (*ScanResult) HasError

func (r *ScanResult) HasError() bool

HasError returns true if any finding has error severity.

func (*ScanResult) HasWarning

func (r *ScanResult) HasWarning() bool

HasWarning returns true if any finding has warning severity.

type Scanner

type Scanner interface {
	// Name returns the scanner name (e.g. "behavioral").
	Name() string
	// Scan runs a scan for a single record and returns the result.
	Scan(ctx context.Context, record *corev1.Record) (*ScanResult, error)
}

Scanner executes a specific type of security scan for a single record. Each scanner implementation (behavioral, static, trivy, etc.) implements this interface. The wiring logic for running scanners and processing results happens in the Orchestrator.

Jump to

Keyboard shortcuts

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