provider

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ImageDigest = "unknown"
)

ImageDigest is the sha snyk/snyk:alpine image, set at build time

View Source
var (
	// SnykDesktopVersion is the version of the Snyk CLI Binary embedded with Docker Desktop
	SnykDesktopVersion = "unknown"
)

Functions

func IsAuthenticationError

func IsAuthenticationError(err error) bool

IsAuthenticationError check if the error type is an authentication error

func IsInvalidTokenError

func IsInvalidTokenError(err error) bool

IsInvalidTokenError check if the error type is an invalid token error

func UseExternalBinary added in v0.6.0

func UseExternalBinary(providerOpts Options) bool

UseExternalBinary return true if the provider path option is setup

Types

type DockerSnykProviderOps added in v0.6.0

type DockerSnykProviderOps func(provider *dockerSnykProvider) error

DockerSnykProviderOps function taking a pointer to a containerized Snyk Provider and returning an error if needed

type Ops added in v0.6.0

type Ops func(provider *Options) error

Ops defines options to setup a provider

func WithAppVulns added in v0.11.0

func WithAppVulns() Ops

WithAppVulns scans for applications vulnerabilities as well

func WithAuthConfig

func WithAuthConfig(authResolver func(*registry.IndexInfo) types.AuthConfig) Ops

WithAuthConfig update the Snyk provider with the auth configuration from Docker CLI

func WithContext

func WithContext(ctx context.Context) Ops

WithContext update the provider with a cancelable context

func WithDependencyTree

func WithDependencyTree() Ops

WithDependencyTree shows the dependency tree before scan results

func WithDockerFile

func WithDockerFile(path string) Ops

WithDockerFile improve result by providing a Dockerfile

func WithExperimental added in v0.12.0

func WithExperimental() Ops

WithExperimental allows running `--json` flag in combination of `--app-vulns`

func WithFailOn added in v0.3.6

func WithFailOn(failOn string) Ops

WithFailOn only fail when there are vulnerabilities that can be fixed

func WithGroupIssues added in v0.5.0

func WithGroupIssues() Ops

WithGroupIssues groups same issues in a single one when using --json flag

func WithJSON

func WithJSON() Ops

WithJSON set JSONFormat to display scan result in JSON

func WithPath

func WithPath(path string) Ops

WithPath update the provider binary with the path from the configuration

func WithSeverity added in v0.3.6

func WithSeverity(severity string) Ops

WithSeverity only reports vulnerabilities of the provided level or higher

func WithStreams added in v0.3.5

func WithStreams(out, err io.Writer) Ops

WithStreams sets the out and err streams to be used by commands

func WithoutBaseImageVulnerabilities

func WithoutBaseImageVulnerabilities() Ops

WithoutBaseImageVulnerabilities don't display the vulnerabilities from the base image

type Options added in v0.6.0

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

Options default options for all provider types

func NewProvider added in v0.6.0

func NewProvider(options ...Ops) (Options, error)

NewProvider returns default provider options setup with the give options

type Provider

type Provider interface {
	Authenticate(token string) error
	Scan(image string) error
	Version() (string, error)
}

Provider abstracts a scan provider

func NewDockerSnykProvider added in v0.6.0

func NewDockerSnykProvider(cli command.Cli, defaultProvider Options) (Provider, error)

NewDockerSnykProvider returns a containerized Snyk implementation of scan provider

func NewSnykProvider

func NewSnykProvider(defaultProvider Options, snykOps ...SnykProviderOps) (Provider, error)

NewSnykProvider returns a Snyk implementation of scan provider

type SnykProviderOps

type SnykProviderOps func(*snykProvider) error

SnykProviderOps function taking a pointer to a Snyk Provider and returning an error if needed

Jump to

Keyboard shortcuts

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