clair

package
v0.0.0-...-57b83e3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseClairSev

func ParseClairSev(clairSev string) models.Severity

ParseClairSev parse the severity of clair to Harbor's Severity type if the string is not recognized the value will be set to unknown.

func TransformVuln

func TransformVuln(clairVuln *models.ClairLayerEnvelope) (*models.ComponentsOverview, models.Severity)

TransformVuln is for running scanning job in both job service V1 and V2.

func UpdateScanOverview

func UpdateScanOverview(digest, layerName string, clairEndpoint string, l ...*log.Logger) error

UpdateScanOverview qeuries the vulnerability based on the layerName and update the record in img_scan_overview table based on digest.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client communicates with clair endpoint to scan image and get detailed scan result

func NewClient

func NewClient(endpoint string, logger *log.Logger) *Client

NewClient creates a new instance of client, set the logger as the job's logger if it's used in a job handler.

func (*Client) DeleteNotification

func (c *Client) DeleteNotification(id string) error

DeleteNotification deletes a notification record from Clair

func (*Client) GetNotification

func (c *Client) GetNotification(id string) (*models.ClairNotification, error)

GetNotification calls Clair's API to get details of notification

func (*Client) GetResult

func (c *Client) GetResult(layerName string) (*models.ClairLayerEnvelope, error)

GetResult calls Clair's API to get layers with detailed vulnerability list

func (*Client) ListNamespaces

func (c *Client) ListNamespaces() ([]string, error)

ListNamespaces list the namespaces in Clair

func (*Client) ScanLayer

func (c *Client) ScanLayer(l models.ClairLayer) error

ScanLayer calls Clair's API to scan a layer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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