option

package
v0.27.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultTokenHeader = "Trivy-Token"

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactOption

type ArtifactOption struct {
	Input      string
	Timeout    time.Duration
	ClearCache bool
	Insecure   bool

	SkipDirs    []string
	SkipFiles   []string
	OfflineScan bool

	// this field is populated in Init()
	Target string
}

ArtifactOption holds the options for an artifact scanning

func NewArtifactOption

func NewArtifactOption(c *cli.Context) ArtifactOption

NewArtifactOption is the factory method to return artifact option

func (*ArtifactOption) Init

func (c *ArtifactOption) Init(ctx *cli.Context, logger *zap.SugaredLogger) (err error)

Init initialize the CLI context for artifact scanning

type CacheOption

type CacheOption struct {
	CacheBackend string
	CacheTTL     time.Duration
	RedisOption
}

CacheOption holds the options for cache

func NewCacheOption

func NewCacheOption(c *cli.Context) CacheOption

NewCacheOption returns an instance of CacheOption

func (*CacheOption) Init

func (c *CacheOption) Init() error

Init initialize the CacheOption

type ConfigOption added in v0.19.0

type ConfigOption struct {
	FilePatterns       []string
	IncludeNonFailures bool
	SkipPolicyUpdate   bool
	Trace              bool

	// Rego
	PolicyPaths      []string
	DataPaths        []string
	PolicyNamespaces []string
}

ConfigOption holds the options for config scanning

func NewConfigOption added in v0.19.0

func NewConfigOption(c *cli.Context) ConfigOption

NewConfigOption is the factory method to return config scanning options

type DBOption

type DBOption struct {
	Reset          bool
	DownloadDBOnly bool
	SkipDBUpdate   bool
	Light          bool
	NoProgress     bool
	DBRepository   string
}

DBOption holds the options for trivy DB

func NewDBOption

func NewDBOption(c *cli.Context) DBOption

NewDBOption is the factory method to return the DBOption

func (*DBOption) Init

func (c *DBOption) Init() (err error)

Init initialize the DBOption

type GlobalOption

type GlobalOption struct {
	Context *cli.Context
	Logger  *zap.SugaredLogger

	AppVersion string
	Quiet      bool
	Debug      bool
	CacheDir   string
}

GlobalOption holds the global options for trivy

func NewGlobalOption

func NewGlobalOption(c *cli.Context) (GlobalOption, error)

NewGlobalOption is the factory method to return GlobalOption

type ImageOption

type ImageOption struct {
	ScanRemovedPkgs bool
}

ImageOption holds the options for scanning images

func NewImageOption

func NewImageOption(c *cli.Context) ImageOption

NewImageOption is the factory method to return ImageOption

type RedisOption added in v0.23.0

type RedisOption struct {
	RedisCACert string
	RedisCert   string
	RedisKey    string
}

RedisOption holds the options for redis cache

type RemoteOption added in v0.25.0

type RemoteOption struct {
	RemoteAddr string

	// this field is populated in Init()
	CustomHeaders http.Header
	// contains filtered or unexported fields
}

RemoteOption holds options for client/server

func NewRemoteOption added in v0.25.0

func NewRemoteOption(c *cli.Context) RemoteOption

func (*RemoteOption) Init added in v0.25.0

func (c *RemoteOption) Init(logger *zap.SugaredLogger)

Init initialize the options for client/server mode

type ReportOption

type ReportOption struct {
	Format   string
	Template string

	IgnoreFile    string
	IgnoreUnfixed bool
	ExitCode      int
	IgnorePolicy  string

	// these variables are populated by Init()
	VulnType       []string
	SecurityChecks []string
	Output         io.Writer
	Severities     []dbTypes.Severity
	ListAllPkgs    bool
	// contains filtered or unexported fields
}

ReportOption holds the options for reporting scan results

func NewReportOption

func NewReportOption(c *cli.Context) ReportOption

NewReportOption is the factory method to return ReportOption

func (*ReportOption) Init

func (c *ReportOption) Init(output io.Writer, logger *zap.SugaredLogger) error

Init initializes the ReportOption

type SbomOption added in v0.25.0

type SbomOption struct {
	ArtifactType string
	SbomFormat   string
}

SbomOption holds the options for SBOM generation

func NewSbomOption added in v0.25.0

func NewSbomOption(c *cli.Context) SbomOption

NewSbomOption is the factory method to return SBOM options

func (*SbomOption) Init added in v0.25.0

func (c *SbomOption) Init(ctx *cli.Context, logger *zap.SugaredLogger) error

Init initialize the CLI context for SBOM generation

type SecretOption added in v0.27.0

type SecretOption struct {
	SecretConfigPath string
}

SecretOption holds the options for secret scanning

func NewSecretOption added in v0.27.0

func NewSecretOption(c *cli.Context) SecretOption

NewSecretOption is the factory method to return secret options

Jump to

Keyboard shortcuts

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