Documentation ¶
Index ¶
- Constants
- func OccurrenceToVulnerability(occ *grafeaspb.Occurrence) (vul voucher.Vulnerability)
- type Client
- func (g *Client) AddAttestationToImage(reference reference.Canonical, payload voucher.AttestationPayload) (voucher.MetadataItem, error)
- func (g *Client) CanAttest() bool
- func (g *Client) GetMetadata(reference reference.Canonical, metadataType voucher.MetadataType) (items []voucher.MetadataItem, err error)
- func (g *Client) NewPayloadBody(reference reference.Canonical) (string, error)
- type Item
- type Scanner
Constants ¶
const DeploymentType voucher.MetadataType = "deployment"
DeploymentType is a Grafeas specific type which refers to MetadataItems containing deployment data.
const DiscoveryType voucher.MetadataType = "discovery"
DiscoveryType is a Grafeas specific type which refers to MetadataItems containing metadata discovery status.
const ImageType voucher.MetadataType = "image"
ImageType is a Grafeas specific type which refers to MetadataItems containing Image information.
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) 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.
type Item ¶
type Item struct {
Occurrence *grafeaspb.Occurrence // The Occurrence this Item wraps.
}
Item implements a MetadataItem.
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.