Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SupportedSBOMMediaTypes = []api.MediaType{ api.MediaTypeSPDX, api.MediaTypeCycloneDX, }
Functions ¶
This section is empty.
Types ¶
type CVSSDetails ¶ added in v0.17.0
type Capability ¶
type Capability struct { Type CapabilityType `json:"type"` ConsumesMIMETypes []string `json:"consumes_mime_types"` ProducesMIMETypes []api.MIMEType `json:"produces_mime_types"` // For /metadata AdditionalAttributes *CapabilityAttributes `json:"additional_attributes,omitempty"` // For /scan Parameters *CapabilityAttributes `json:"parameters,omitempty"` }
type CapabilityAttributes ¶ added in v0.31.0
type CapabilityType ¶ added in v0.31.0
type CapabilityType string
const ( CapabilityTypeSBOM CapabilityType = "sbom" CapabilityTypeVulnerability CapabilityType = "vulnerability" )
type ScanReport ¶
type ScanReport struct { GeneratedAt time.Time `json:"generated_at"` Artifact Artifact `json:"artifact"` Scanner Scanner `json:"scanner"` Severity Severity `json:"severity,omitempty"` // For SBOM MediaType api.MediaType `json:"media_type,omitempty"` SBOM any `json:"sbom,omitempty"` // For vulnerabilities Vulnerabilities []VulnerabilityItem `json:"vulnerabilities,omitempty"` }
type ScanReportQuery ¶ added in v0.31.0
ScanReportQuery is a struct for the query parameters at "/scan/{scan_request_id}/report".
type ScanRequest ¶
type ScanRequest struct { Registry Registry `json:"registry"` Artifact Artifact `json:"artifact"` Capabilities []Capability `json:"enabled_capabilities"` }
func (ScanRequest) GetImageRef ¶
func (c ScanRequest) GetImageRef() (imageRef string, nonSSL bool, err error)
GetImageRef returns Docker image reference for this ScanRequest. Example: core.harbor.domain/scanners/mysql@sha256:3b00a364fb74246ca119d16111eb62f7302b2ff66d51e373c2bb209f8a1f3b9e
type ScanResponse ¶
type ScanResponse struct {
ID string `json:"id"`
}
type Scanner ¶
type Scanner struct { Name string `json:"name"` Vendor string `json:"vendor"` Version string `json:"version"` }
func GetScannerMetadata ¶ added in v0.31.0
func GetScannerMetadata() Scanner
type ScannerAdapterMetadata ¶
type ScannerAdapterMetadata struct { Scanner Scanner `json:"scanner"` Capabilities []Capability `json:"capabilities"` Properties map[string]string `json:"properties"` }
type Severity ¶
type Severity int64
Severity represents the severity of a image/component in terms of vulnerability.
const ( SevUnknown Severity SevLow SevMedium SevHigh SevCritical )
Sevxxx is the list of severity of image after scanning.
func (Severity) MarshalJSON ¶
MarshalJSON marshals the Severity enum value as a quoted JSON string.
func (*Severity) UnmarshalJSON ¶
UnmarshalJSON unmarshals quoted JSON string to the Severity enum value.
type VulnerabilityItem ¶
type VulnerabilityItem struct { ID string `json:"id"` Pkg string `json:"package"` Version string `json:"version"` FixVersion string `json:"fix_version,omitempty"` Severity Severity `json:"severity"` Description string `json:"description"` Links []string `json:"links"` Layer *Layer `json:"layer"` // Not defined by Scanners API PreferredCVSS *CVSSDetails `json:"preferred_cvss,omitempty"` CweIDs []string `json:"cwe_ids,omitempty"` VendorAttributes map[string]any `json:"vendor_attributes,omitempty"` }
VulnerabilityItem is an item in the vulnerability result returned by vulnerability details API.
Click to show internal directories.
Click to hide internal directories.