Documentation
¶
Index ¶
- Constants
- Variables
- type GetScanResponse
- type GrypeArtifact
- type GrypeCVSS
- type GrypeCVSSMetrics
- type GrypeDescriptor
- type GrypeDistro
- type GrypeFix
- type GrypeLocation
- type GrypeMatch
- type GrypeMatchDetail
- type GrypeOutput
- type GrypeScannerClient
- type GrypeSource
- type GrypeVulnerability
- type Handler
- type ImageResult
- type Scan
- type ScanPersistence
- type Service
- type ServiceConfig
- type Vulnerability
Constants ¶
View Source
const ( ScanStatusPending = "pending" ScanStatusRunning = "running" ScanStatusCompleted = "completed" ScanStatusFailed = "failed" )
View Source
const ( ImageStatusPending = "pending" ImageStatusScanning = "scanning" ImageStatusCompleted = "completed" ImageStatusFailed = "failed" ImageStatusTimeout = "timeout" )
View Source
const ( SeverityCritical = "Critical" SeverityHigh = "High" SeverityMedium = "Medium" SeverityLow = "Low" SeverityNegligible = "Negligible" SeverityUnknown = "Unknown" )
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewServiceFromConfig), fx.Provide(NewHandler), )
Functions ¶
This section is empty.
Types ¶
type GetScanResponse ¶
type GetScanResponse struct {
ID string `json:"id"`
StackName string `json:"stack_name"`
Status string `json:"status"`
TotalImages int `json:"total_images"`
ScannedImages int `json:"scanned_images"`
StartedAt time.Time `json:"started_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Error string `json:"error,omitempty"`
Results []ImageResult `json:"results,omitempty"`
}
type GrypeArtifact ¶
type GrypeArtifact struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
Type string `json:"type,omitempty"`
Locations []GrypeLocation `json:"locations,omitempty"`
Language string `json:"language,omitempty"`
Licenses []string `json:"licenses,omitempty"`
CPEs []string `json:"cpes,omitempty"`
PURL string `json:"purl,omitempty"`
}
type GrypeCVSS ¶
type GrypeCVSS struct {
Source string `json:"source,omitempty"`
Type string `json:"type,omitempty"`
Version string `json:"version,omitempty"`
Vector string `json:"vector,omitempty"`
Metrics GrypeCVSSMetrics `json:"metrics"`
}
type GrypeCVSSMetrics ¶
type GrypeDescriptor ¶
type GrypeDistro ¶
type GrypeLocation ¶
type GrypeMatch ¶
type GrypeMatch struct {
Vulnerability GrypeVulnerability `json:"vulnerability"`
RelatedVulnerabilities []GrypeVulnerability `json:"relatedVulnerabilities,omitempty"`
MatchDetails []GrypeMatchDetail `json:"matchDetails,omitempty"`
Artifact GrypeArtifact `json:"artifact"`
}
type GrypeMatchDetail ¶
type GrypeOutput ¶
type GrypeOutput struct {
Matches []GrypeMatch `json:"matches"`
Source GrypeSource `json:"source"`
Distro GrypeDistro `json:"distro"`
Descriptor GrypeDescriptor `json:"descriptor"`
}
type GrypeScannerClient ¶
type GrypeScannerClient struct {
// contains filtered or unexported fields
}
func NewGrypeScannerClient ¶
func NewGrypeScannerClient(baseURL, token string, logger *logging.Logger) *GrypeScannerClient
func (*GrypeScannerClient) IsAvailable ¶
func (c *GrypeScannerClient) IsAvailable(ctx context.Context) bool
func (*GrypeScannerClient) ScanImage ¶
func (c *GrypeScannerClient) ScanImage(ctx context.Context, imageName string) ([]Vulnerability, error)
type GrypeSource ¶
type GrypeVulnerability ¶
type GrypeVulnerability struct {
ID string `json:"id"`
DataSource string `json:"dataSource"`
Namespace string `json:"namespace,omitempty"`
Severity string `json:"severity"`
URLs []string `json:"urls,omitempty"`
Description string `json:"description,omitempty"`
CVSS []GrypeCVSS `json:"cvss,omitempty"`
Fix GrypeFix `json:"fix"`
}
type ImageResult ¶
type Scan ¶
type Scan struct {
ID string `json:"id"`
StackName string `json:"stack_name"`
Status string `json:"status"`
Images []string `json:"images"`
TotalImages int `json:"total_images"`
ScannedImages int `json:"scanned_images"`
StartedAt time.Time `json:"started_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Error string `json:"error,omitempty"`
Results []ImageResult `json:"results,omitempty"`
}
type ScanPersistence ¶
type ScanPersistence struct {
// contains filtered or unexported fields
}
func NewScanPersistence ¶
func NewScanPersistence(persistenceDir string, logger *logging.Logger) (*ScanPersistence, error)
func (*ScanPersistence) DeleteScan ¶
func (p *ScanPersistence) DeleteScan(scanID string) error
func (*ScanPersistence) LoadAllScans ¶
func (p *ScanPersistence) LoadAllScans() ([]*Scan, error)
func (*ScanPersistence) PersistScan ¶
func (p *ScanPersistence) PersistScan(scan *Scan) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(cfg ServiceConfig, logger *logging.Logger) (*Service, error)
func NewServiceFromConfig ¶
func (*Service) IsAvailable ¶
type ServiceConfig ¶
type Vulnerability ¶
type Vulnerability struct {
ID string `json:"id"`
Severity string `json:"severity"`
Package string `json:"package"`
InstalledVersion string `json:"installed_version"`
FixedVersion string `json:"fixed_version,omitempty"`
Description string `json:"description,omitempty"`
DataSource string `json:"data_source,omitempty"`
CVSS float64 `json:"cvss,omitempty"`
Location string `json:"location,omitempty"`
LayerID string `json:"layer_id,omitempty"`
RawMatch json.RawMessage `json:"raw_match,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.