policy

package
v0.50.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BundleVersion    = 0 // Latest released MAJOR version for trivy-policies
	BundleRepository = "ghcr.io/aquasecurity/trivy-policies"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements policy operations

func NewClient

func NewClient(cacheDir string, quiet bool, policyBundleRepo string, opts ...Option) (*Client, error)

NewClient is the factory method for policy client

func (*Client) Clear added in v0.42.0

func (c *Client) Clear() error

func (*Client) DownloadBuiltinPolicies

func (c *Client) DownloadBuiltinPolicies(ctx context.Context) error

DownloadBuiltinPolicies download default policies from GitHub Pages

func (*Client) GetMetadata added in v0.38.1

func (c *Client) GetMetadata() (*Metadata, error)

func (*Client) LoadBuiltinPolicies

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

LoadBuiltinPolicies loads default policies

func (*Client) NeedsUpdate

func (c *Client) NeedsUpdate(ctx context.Context) (bool, error)

NeedsUpdate returns if the default policy should be updated

type Metadata

type Metadata struct {
	Digest       string
	DownloadedAt time.Time
}

Metadata holds default policy metadata

func (Metadata) String added in v0.45.0

func (m Metadata) String() string

type Option

type Option func(*options)

Option is a functional option

func WithClock

func WithClock(c clock.Clock) Option

WithClock takes a clock

func WithOCIArtifact added in v0.23.0

func WithOCIArtifact(art *oci.Artifact) Option

WithOCIArtifact takes an OCI artifact

Jump to

Keyboard shortcuts

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