Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeLocation ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
func NewFetcher ¶
NewFetcher returns a new, logged-in Fetcher. It will instead return an error if any of the following happen:
- unable to instantiate an API client
- unable to sign in to the Hub
- unable to get hub version from the Hub
func (*Fetcher) FetchScanFromImage ¶
func (hf *Fetcher) FetchScanFromImage(image ImageInterface) (*ImageScan, error)
FetchScanFromImage returns an ImageScan only if: - it can find a project with the matching name, with - a project version with the matching name, with - one code location, with - one scan summary, with - a completed status
func (*Fetcher) HubVersion ¶ added in v0.0.10
type FetcherInterface ¶
type FetcherInterface interface {
HubVersion() string
FetchScanFromImage(image ImageInterface) (*ImageScan, error)
}
type ImageInterface ¶ added in v0.0.5
type ImageScan ¶
type ImageScan struct {
RiskProfile RiskProfile
PolicyStatus PolicyStatus
ScanSummary ScanSummary
ComponentsHref string
CodeLocationCreatedAt string
CodeLocationMappedProjectVersion string
CodeLocationName string
CodeLocationType string
CodeLocationURL string
CodeLocationUpdatedAt string
}
ImageScan models the results that we expect to get from the hub after scanning a docker image.
func (*ImageScan) IsDone ¶
IsDone returns whether the hub imagescan results indicate that the scan is complete.
func (*ImageScan) OverallStatus ¶
func (scan *ImageScan) OverallStatus() PolicyStatusType
func (*ImageScan) PolicyViolationCount ¶
func (*ImageScan) VulnerabilityCount ¶
type MockHub ¶
type MockHub struct {
// contains filtered or unexported fields
}
MockHub is a mock implementation of ScanClientInterface .
func NewMockHub ¶
func (*MockHub) FetchProjectByName ¶
func (*MockHub) FetchScanFromImage ¶
func (hub *MockHub) FetchScanFromImage(image ImageInterface) (*ImageScan, error)
func (*MockHub) HubVersion ¶ added in v0.0.10
type PolicyStatus ¶
type PolicyStatus struct {
OverallStatus PolicyStatusType
UpdatedAt string
ComponentVersionStatusCounts map[PolicyStatusType]int
}
func (*PolicyStatus) ViolationCount ¶
func (ps *PolicyStatus) ViolationCount() int
type PolicyStatusType ¶ added in v0.0.8
type PolicyStatusType int
const ( PolicyStatusTypeNotInViolation PolicyStatusType = iota PolicyStatusTypeInViolation PolicyStatusType = iota PolicyStatusTypeInViolationOverridden PolicyStatusType = iota )
func (PolicyStatusType) MarshalJSON ¶ added in v0.0.8
func (p PolicyStatusType) MarshalJSON() ([]byte, error)
func (PolicyStatusType) MarshalText ¶ added in v0.0.8
func (p PolicyStatusType) MarshalText() (text []byte, err error)
func (PolicyStatusType) String ¶ added in v0.0.8
func (p PolicyStatusType) String() string
type RiskProfile ¶
type RiskProfile struct {
Categories map[RiskProfileCategory]RiskProfileStatusCounts
BomLastUpdatedAt string
}
func (*RiskProfile) HighRiskVulnerabilityCount ¶
func (rp *RiskProfile) HighRiskVulnerabilityCount() int
type RiskProfileCategory ¶ added in v0.0.8
type RiskProfileCategory int
const ( RiskProfileCategoryActivity RiskProfileCategory = iota RiskProfileCategoryLicense RiskProfileCategory = iota RiskProfileCategoryOperational RiskProfileCategory = iota RiskProfileCategoryVersion RiskProfileCategory = iota RiskProfileCategoryVulnerability RiskProfileCategory = iota )
func (RiskProfileCategory) MarshalText ¶ added in v0.0.8
func (r RiskProfileCategory) MarshalText() (text []byte, err error)
func (RiskProfileCategory) String ¶ added in v0.0.8
func (r RiskProfileCategory) String() string
type RiskProfileStatus ¶ added in v0.0.8
type RiskProfileStatus int
const ( RiskProfileStatusHigh RiskProfileStatus = iota RiskProfileStatusMedium RiskProfileStatus = iota RiskProfileStatusLow RiskProfileStatus = iota RiskProfileStatusOK RiskProfileStatus = iota RiskProfileStatusUnknown RiskProfileStatus = iota )
func (RiskProfileStatus) MarshalJSON ¶ added in v0.0.8
func (r RiskProfileStatus) MarshalJSON() ([]byte, error)
func (RiskProfileStatus) MarshalText ¶ added in v0.0.8
func (r RiskProfileStatus) MarshalText() (text []byte, err error)
func (RiskProfileStatus) String ¶ added in v0.0.8
func (r RiskProfileStatus) String() string
type RiskProfileStatusCounts ¶ added in v0.0.8
type RiskProfileStatusCounts struct {
StatusCounts map[RiskProfileStatus]int
}
func (*RiskProfileStatusCounts) HighRiskVulnerabilityCount ¶ added in v0.0.8
func (r *RiskProfileStatusCounts) HighRiskVulnerabilityCount() int
type ScanSummary ¶
type Version ¶
type Version struct {
CodeLocations []CodeLocation
RiskProfile RiskProfile
PolicyStatus PolicyStatus
Distribution string
Nickname string
VersionName string
ReleasedOn string
ReleaseComments string
Phase string
}
func (*Version) IsImageScanDone ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.