config

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrApplicationConfigNotFound = fmt.Errorf("application config not found")

Functions

This section is empty.

Types

type Application

type Application struct {
	ConfigPath         string                  `yaml:",omitempty" json:"configPath"`                                                         // the location where the application config was read from (either from -c or discovered while loading)
	Output             string                  `yaml:"output" json:"output" mapstructure:"output"`                                           // -o, the Presenter hint string to use for report formatting
	File               string                  `yaml:"file" json:"file" mapstructure:"file"`                                                 // --file, the file to write report output to
	OutputTemplateFile string                  `yaml:"output-template-file" json:"output-template-file" mapstructure:"output-template-file"` // -t, the template file to use for formatting the final report
	Quiet              bool                    `yaml:"quiet" json:"quiet" mapstructure:"quiet"`                                              // -q, indicates to not show any status output to stderr (ETUI or logging UI)
	CheckForAppUpdate  bool                    `yaml:"check-for-app-update" json:"check-for-app-update" mapstructure:"check-for-app-update"` // whether to check for an application update on start up or not
	OnlyFixed          bool                    `yaml:"only-fixed" json:"only-fixed" mapstructure:"only-fixed"`                               // only fail if detected vulns have a fix
	CliOptions         CliOnlyOptions          `yaml:"-" json:"-"`
	Search             search                  `yaml:"search" json:"search" mapstructure:"search"`
	Ignore             []match.IgnoreRule      `yaml:"ignore" json:"ignore" mapstructure:"ignore"`
	Exclusions         []string                `yaml:"exclude" json:"exclude" mapstructure:"exclude"`
	DB                 database                `yaml:"db" json:"db" mapstructure:"db"`
	Dev                development             `yaml:"dev" json:"dev" mapstructure:"dev"`
	FailOn             string                  `yaml:"fail-on-severity" json:"fail-on-severity" mapstructure:"fail-on-severity"`
	FailOnSeverity     *vulnerability.Severity `yaml:"-" json:"-"`
	Registry           registry                `yaml:"registry" json:"registry" mapstructure:"registry"`
	Log                logging                 `yaml:"log" json:"log" mapstructure:"log"`
}

func LoadApplicationConfig added in v0.23.0

func LoadApplicationConfig(v *viper.Viper, cliOpts CliOnlyOptions) (*Application, error)

func (Application) String added in v0.23.0

func (cfg Application) String() string

type CliOnlyOptions

type CliOnlyOptions struct {
	ConfigPath string
	Verbosity  int
}

type RegistryCredentials added in v0.10.0

type RegistryCredentials struct {
	Authority string `yaml:"authority" json:"authority" mapstructure:"authority"`
	// IMPORTANT: do not show the username in any YAML/JSON output (sensitive information)
	Username string `yaml:"-" json:"-" mapstructure:"username"`
	// IMPORTANT: do not show the password in any YAML/JSON output (sensitive information)
	Password string `yaml:"-" json:"-" mapstructure:"password"`
	// IMPORTANT: do not show the token in any YAML/JSON output (sensitive information)
	Token string `yaml:"-" json:"-" mapstructure:"token"`
}

Jump to

Keyboard shortcuts

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