Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDockerConfigFromRegsync ¶
GenerateDockerConfigFromRegsync reads suppline.yml and generates a Docker config.json that Trivy can use for registry authentication
Types ¶
type DockerAuth ¶
type DockerAuth struct {
Auth string `json:"auth"`
}
DockerAuth represents authentication for a single registry
type DockerConfig ¶
type DockerConfig struct {
Auths map[string]DockerAuth `json:"auths"`
}
DockerConfig represents Docker's config.json structure
type SBOM ¶
type SBOM struct {
Format string // "cyclonedx"
Version string // CycloneDX version (e.g., "1.5")
Data []byte // CycloneDX JSON
Created time.Time // When the SBOM was generated
}
SBOM represents a Software Bill of Materials
type ScanResult ¶
type ScanResult struct {
ImageRef string
Vulnerabilities []types.Vulnerability // Using canonical type from internal/types
ScannedAt time.Time
CosignVulnData []byte // Pre-generated cosign-vuln format for attestation (avoids redundant Trivy call)
SBOM *SBOM // Optional: SBOM generated during the same scan (avoids separate SBOM call)
}
ScanResult contains vulnerability scan results
type Scanner ¶
type Scanner interface {
// GenerateSBOM creates CycloneDX SBOM via Trivy server
GenerateSBOM(ctx context.Context, imageRef string) (*SBOM, error)
// ScanVulnerabilities performs vulnerability analysis via Trivy server
ScanVulnerabilities(ctx context.Context, imageRef string) (*ScanResult, error)
// HealthCheck reports Trivy connectivity status for health endpoint integration
HealthCheck(ctx context.Context) error
}
Scanner defines the interface for vulnerability scanning and SBOM generation
type TrivyScanner ¶
type TrivyScanner struct {
// contains filtered or unexported fields
}
TrivyScanner implements Scanner using Trivy CLI in client-server mode
func NewTrivyScanner ¶
func NewTrivyScanner(cfg config.ScannerConfig) (*TrivyScanner, error)
NewTrivyScanner creates a new Trivy scanner client
func (*TrivyScanner) GenerateSBOM ¶
GenerateSBOM creates CycloneDX SBOM via Trivy
func (*TrivyScanner) HealthCheck ¶
func (s *TrivyScanner) HealthCheck(ctx context.Context) error
HealthCheck reports Trivy connectivity status
func (*TrivyScanner) ScanVulnerabilities ¶
func (s *TrivyScanner) ScanVulnerabilities(ctx context.Context, imageRef string) (*ScanResult, error)
ScanVulnerabilities performs vulnerability analysis via Trivy This method now generates BOTH JSON and cosign-vuln formats in a single scan to avoid redundant calls