clair

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeverityUnknown    = "unknown"
	SeverityNegligible = "negligible"
	SeverityLow        = "low"
	SeverityMedium     = "medium"
	SeverityHigh       = "high"
	SeverityCritical   = "critical"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ScanLayer(layer Layer) error
	GetLayer(layerName string) (*LayerEnvelope, error)
	GetVulnerabilityDatabaseUpdatedAt() (*time.Time, error)
}

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

func NewClient

func NewClient(tlsConfig etc.TLSConfig, cfg etc.ClairConfig) (Client, error)

NewClient constructs a new client for Clair REST API pointing to the specified endpoint URL.

type Error

type Error struct {
	Message string `json:"Message,omitempty"`
}

Error ...

type Feature

type Feature struct {
	Name            string          `json:"Name,omitempty"`
	NamespaceName   string          `json:"NamespaceName,omitempty"`
	VersionFormat   string          `json:"VersionFormat,omitempty"`
	Version         string          `json:"Version,omitempty"`
	Vulnerabilities []Vulnerability `json:"Vulnerabilities,omitempty"`
	AddedBy         string          `json:"AddedBy,omitempty"`
}

Feature anything that when present in a filesystem could be an indication of a vulnerability (e.g. the presence of a file or an installed software package).

type Layer

type Layer struct {
	Name           string            `json:"Name,omitempty"`
	NamespaceNames []string          `json:"NamespaceNames,omitempty"`
	Path           string            `json:"Path,omitempty"`
	Headers        map[string]string `json:"Headers,omitempty"`
	ParentName     string            `json:"ParentName,omitempty"`
	Format         string            `json:"Format,omitempty"`
	Features       []Feature         `json:"Features,omitempty"`
}

Layer is one of the tarballs used in the composition of an image, often expressed as a filesystem delta from another layer.

type LayerEnvelope

type LayerEnvelope struct {
	Layer *Layer `json:"Layer,omitempty"`
	Error *Error `json:"Error,omitempty"`
}

LayerEnvelope ...

type Vulnerability

type Vulnerability struct {
	Name          string                 `json:"Name,omitempty"`
	NamespaceName string                 `json:"NamespaceName,omitempty"`
	Description   string                 `json:"Description,omitempty"`
	Link          string                 `json:"Link,omitempty"`
	Severity      string                 `json:"Severity,omitempty"`
	Metadata      map[string]interface{} `json:"Metadata,omitempty"`
	FixedBy       string                 `json:"FixedBy,omitempty"`
	FixedIn       []Feature              `json:"FixedIn,omitempty"`
}

Vulnerability ...

Jump to

Keyboard shortcuts

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