Version: v0.2.2 Latest Latest

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

Go to latest
Published: Jan 10, 2020 License: Apache-2.0 Imports: 18 Imported by: 8




View Source
const (
	PkgVulnerability     = "PACKAGE_VULNERABILITY"
	AttestationAuthority = "ATTESTATION_AUTHORITY"
	DefaultProject       = "kritis" // DefaultProject is the default project name, only single project is supported


This section is empty.


func ValidateConfig

func ValidateConfig(config kritisv1beta1.GrafeasConfigSpec) error

ValidateConfig checks whether the specified configuration is valid


type CertConfig

type CertConfig struct {
	CertFile string `yaml:"certfile"` // A PEM encoded certificate file
	KeyFile  string `yaml:"keyfile"`  // A PEM encoded private key file
	CAFile   string `yaml:"cafile"`   // A PEM encoded CA's certificate file

CertConfig is the Grafeas certificates configuration.

func LoadConfig

func LoadConfig(fileName string) (*CertConfig, error)

LoadConfig creates a config from a YAML-file. If fileName is an empty string a default config will be returned.

type Client

type Client struct {
	// contains filtered or unexported fields

Client implements the ReadWriteClient and ReadOnlyClient interfaces using grafeas API.

func New

func New(config kritisv1beta1.GrafeasConfigSpec, certs *CertConfig) (*Client, error)

TODO: separate constructor methods for r/w and r/o clients

func (Client) AttestationNote

func (c Client) AttestationNote(aa *kritisv1beta1.AttestationAuthority) (*grafeas.Note, error)

AttestationNote returns a note if it exists for given AttestationAuthority

func (Client) Attestations

func (c Client) Attestations(containerImage string, aa *kritisv1beta1.AttestationAuthority) ([]metadata.PGPAttestation, error)

Attestations gets Attestations for a specified image and a specified AttestationAuthority.

func (Client) Close added in v0.1.1

func (c Client) Close()

Close closes client connections

func (Client) CreateAttestationNote

func (c Client) CreateAttestationNote(aa *kritisv1beta1.AttestationAuthority) (*grafeas.Note, error)

CreateAttestationNote creates an attestation note from AttestationAuthority

func (Client) CreateAttestationOccurrence added in v0.2.0

func (c Client) CreateAttestationOccurrence(note *grafeas.Note,
	containerImage string,
	pgpSigningKey *secrets.PGPSigningSecret, proj string) (*grafeas.Occurrence, error)

CreateAttestationOccurrence creates an Attestation occurrence for a given image, secret, and project.

func (Client) Vulnerabilities

func (c Client) Vulnerabilities(containerImage string) ([]metadata.Vulnerability, error)

Vulnerabilities gets Package Vulnerabilities Occurrences for a specified image.

Jump to

Keyboard shortcuts

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