Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) BuiltinChecksPath() string
- func (c *Client) Clear() error
- func (c *Client) DownloadBuiltinChecks(ctx context.Context, registryOpts types.RegistryOptions) error
- func (c *Client) GetMetadata(ctx context.Context) (*Metadata, error)
- func (c *Client) NeedsUpdate(ctx context.Context, registryOpts types.RegistryOptions) (bool, error)
- type Metadata
- type Option
Constants ¶
View Source
const ( BundleVersion = 2 // Latest released MAJOR version for trivy-checks BundleRepository = "mirror.gcr.io/aquasec/trivy-checks" VersionAnnotationKey = "org.opencontainers.image.version" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements check operations
func NewClient ¶
func NewClient(cacheDir string, quiet bool, checkBundleRepo string, opts ...Option) (*Client, error)
NewClient is the factory method for check client
func (*Client) BuiltinChecksPath ¶ added in v0.69.0
BuiltinChecksPath returns default policies
func (*Client) DownloadBuiltinChecks ¶ added in v0.56.0
func (c *Client) DownloadBuiltinChecks(ctx context.Context, registryOpts types.RegistryOptions) error
DownloadBuiltinChecks download default policies from GitHub Pages
func (*Client) GetMetadata ¶ added in v0.38.1
func (*Client) NeedsUpdate ¶
NeedsUpdate returns if the default check should be updated
type Metadata ¶
type Metadata struct {
Digest string
DownloadedAt time.Time
// MajorVersion indicates the major version of the bundle.
// Used to invalidate cache when the major version increases.
// Nil for old cache entries. Set to 0 for custom builds.
MajorVersion *int `json:",omitempty"`
// CustomBuild is true if the bundle was built manually and did not go
// through the official build process that enriches the manifest with additional data.
// For custom builds, MajorVersion is not used for cache invalidation.
CustomBuild bool `json:",omitempty"`
}
Metadata holds default check metadata
Click to show internal directories.
Click to hide internal directories.