sources

package
v0.0.0-...-779c762 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeverityCritical   = Severity("CRITICAL")
	SeverityHigh       = Severity("HIGH")
	SeverityMedium     = Severity("MEDIUM")
	SeverityLow        = Severity("LOW")
	SeverityUnassigned = Severity("UNASSIGNED")
)
View Source
const DependencytrackSourceName = "dependencytrack"

Variables

View Source
var (
	ErrNoMetrics = fmt.Errorf("no metrics found")
	ErrNoProject = fmt.Errorf("no project found")
)

Functions

This section is empty.

Types

type Cve

type Cve struct {
	Id          string
	Description string
	Title       string
	Link        string
	Severity    Severity
	References  map[string]string
}

type DependencyTrackConfig

type DependencyTrackConfig struct {
	Url      string `envconfig:"DEPENDENCYTRACK_URL"`
	Username string `envconfig:"DEPENDENCYTRACK_USERNAME" default:"v13s"`
	Password string `envconfig:"DEPENDENCYTRACK_PASSWORD"`
}

func (DependencyTrackConfig) GetUrl

func (d DependencyTrackConfig) GetUrl() string

type Severity

type Severity string

func (Severity) ToInt32

func (s Severity) ToInt32() int32

type Source

type Source interface {
	Delete(ctx context.Context, imageName string, imageTag string) error
	GetVulnerabilities(ctx context.Context, imageName, imageTag string, includeSuppressed bool) ([]*Vulnerability, error)
	GetVulnerabilitySummary(ctx context.Context, imageName, imageTag string) (*VulnerabilitySummary, error)
	IsTaskInProgress(ctx context.Context, processToken string) (bool, error)
	MaintainSuppressedVulnerabilities(ctx context.Context, suppressed []*SuppressedVulnerability) error
	Name() string
	ProjectExists(ctx context.Context, imageName, imageTag string) (bool, error)
	UploadAttestation(ctx context.Context, imageName string, imageTag string, att []byte) (*UploadAttestationResponse, error)
}

func New

func New(config SourceConfig, log logrus.FieldLogger) (Source, error)

func NewDependencytrackSource

func NewDependencytrackSource(client dependencytrack.Client, log *logrus.Entry) Source

func SetupSources

func SetupSources(configs []SourceConfig, log logrus.FieldLogger) ([]Source, error)

type SourceConfig

type SourceConfig interface {
	GetUrl() string
}

type SourceId

type SourceId string

type SuppressedVulnerability

type SuppressedVulnerability struct {
	ImageName    string
	ImageTag     string
	CveId        string
	Package      string
	SuppressedBy string
	Reason       string
	State        string
	Suppressed   bool
	Metadata     VulnerabilityMetadata
}

type UploadAttestationResponse

type UploadAttestationResponse struct {
	AttestationId uuid.UUID
	ProcessToken  string
}

type Vulnerability

type Vulnerability struct {
	Package        string
	Suppressed     bool
	Cve            *Cve
	LatestVersion  string
	Metadata       VulnerabilityMetadata
	CvssScore      *float64
	EpssScore      *float64
	EpssPercentile *float64
}

type VulnerabilityMetadata

type VulnerabilityMetadata any

type VulnerabilitySummary

type VulnerabilitySummary struct {
	Id         string
	Critical   int32
	High       int32
	Medium     int32
	Low        int32
	Unassigned int32
	RiskScore  int32
}

type Workload

type Workload struct {
	Cluster   string
	Namespace string
	Name      string
	Type      string
	ImageName string
	ImageTag  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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