grafeas

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: MIT Imports: 17 Imported by: 4

Documentation

Index

Constants

View Source
const DeploymentType voucher.MetadataType = "deployment"

DeploymentType is a Grafeas specific type which refers to MetadataItems containing deployment data.

View Source
const DiscoveryType voucher.MetadataType = "discovery"

DiscoveryType is a Grafeas specific type which refers to MetadataItems containing metadata discovery status.

View Source
const ImageType voucher.MetadataType = "image"

ImageType is a Grafeas specific type which refers to MetadataItems containing Image information.

View Source
const PackageType voucher.MetadataType = "package"

PackageType is a Grafeas specific type which refers to MetadataItems containing package information.

Variables

This section is empty.

Functions

func OccurrenceToVulnerability

func OccurrenceToVulnerability(occ *grafeaspb.Occurrence) (vul voucher.Vulnerability)

OccurrenceToVulnerability converts an Occurrence to a Vulnerability.

Types

type Client

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

Client implements voucher.MetadataClient, connecting to Grafeas.

func NewClient

func NewClient(ctx context.Context, imageProject, binauthProject string, keyring *voucher.KeyRing) *Client

NewClient creates a new Grafeas Client.

func (*Client) AddAttestationToImage

func (g *Client) AddAttestationToImage(reference reference.Canonical, payload voucher.AttestationPayload) (voucher.MetadataItem, error)

AddAttestationToImage adds a new attestation with the passed AttestationPayload to the image described by ImageData.

func (*Client) CanAttest

func (g *Client) CanAttest() bool

CanAttest returns true if the client can create and sign attestations.

func (*Client) GetMetadata

func (g *Client) GetMetadata(reference reference.Canonical, metadataType voucher.MetadataType) (items []voucher.MetadataItem, err error)

GetMetadata gets metadata of the requested type for the passed image.

func (*Client) NewPayloadBody

func (g *Client) NewPayloadBody(reference reference.Canonical) (string, error)

NewPayloadBody returns a payload body appropriate for this MetadataClient.

type Item

type Item struct {
	Occurrence *grafeaspb.Occurrence // The Occurrence this Item wraps.
}

Item implements a MetadataItem.

func (*Item) Name

func (item *Item) Name() string

Name returns the name of the group of Item.

func (*Item) String

func (item *Item) String() string

String returns a string version of this Item.

type Scanner

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

Scanner implements voucher.VulnerabilityScanner, and connects to Grafeas to obtain vulnerability information. It will block while scanning is active and fail if it spends more than a minute waiting for discovery to finish.

func NewScanner

func NewScanner(client voucher.MetadataClient) *Scanner

NewScanner creates a new grafeas.Scanner.

func (*Scanner) FailOn

func (s *Scanner) FailOn(severity voucher.Severity)

FailOn sets severity level that a vulnerability must match or exheed to prompt a failure.

func (*Scanner) Scan

Scan gets the vulnerabilities for an Image.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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