Documentation ¶
Index ¶
- Variables
- func IsAuthenticationError(err error) bool
- func IsInvalidTokenError(err error) bool
- func UseExternalBinary(providerOpts Options) bool
- type DockerSnykProviderOps
- type Ops
- func WithAppVulns() Ops
- func WithAuthConfig(authResolver func(*registry.IndexInfo) types.AuthConfig) Ops
- func WithContext(ctx context.Context) Ops
- func WithDependencyTree() Ops
- func WithDockerFile(path string) Ops
- func WithExperimental() Ops
- func WithFailOn(failOn string) Ops
- func WithGroupIssues() Ops
- func WithJSON() Ops
- func WithPath(path string) Ops
- func WithSeverity(severity string) Ops
- func WithStreams(out, err io.Writer) Ops
- func WithoutBaseImageVulnerabilities() Ops
- type Options
- type Provider
- type SnykProviderOps
Constants ¶
This section is empty.
Variables ¶
var (
ImageDigest = "unknown"
)
ImageDigest is the sha snyk/snyk:alpine image, set at build time
var (
// SnykDesktopVersion is the version of the Snyk CLI Binary embedded with Docker Desktop
SnykDesktopVersion = "unknown"
)
Functions ¶
func IsAuthenticationError ¶
IsAuthenticationError check if the error type is an authentication error
func IsInvalidTokenError ¶
IsInvalidTokenError check if the error type is an invalid token error
func UseExternalBinary ¶ added in v0.6.0
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
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 ¶
WithContext update the provider with a cancelable context
func WithDependencyTree ¶
func WithDependencyTree() Ops
WithDependencyTree shows the dependency tree before scan results
func WithDockerFile ¶
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
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 WithSeverity ¶ added in v0.3.6
WithSeverity only reports vulnerabilities of the provided level or higher
func WithStreams ¶ added in v0.3.5
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
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
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