config

package
v2.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

View Source
const (
	AnalyzerList  = "ANALYZER_LIST"
	AnalyzerScope = "ANALYZER_SCOPE"
	OutputFormat  = "ANALYZER_OUTPUT_FORMAT"
)
View Source
const (
	ScannerDependencyTrackAPIKey                         = "SCANNER_DEPENDENCY_TRACK_API_KEY"
	ScannerDependencyTrackHost                           = "SCANNER_DEPENDENCY_TRACK_HOST"
	ScannerDependencyTrackProjectName                    = "SCANNER_DEPENDENCY_TRACK_PROJECT_NAME"
	ScannerDependencyTrackProjectVersion                 = "SCANNER_DEPENDENCY_TRACK_PROJECT_VERSION"
	ScannerDependencyTrackShouldDeleteProject            = "SCANNER_DEPENDENCY_TRACK_SHOULD_DELETE_PROJECT"
	ScannerDependencyTrackDisableTLS                     = "SCANNER_DEPENDENCY_TRACK_DISABLE_TLS"
	ScannerDependencyTrackInsecureSkipVerify             = "SCANNER_DEPENDENCY_TRACK_INSECURE_SKIP_VERIFY"
	ScannerDependencyTrackFetchVulnerabilitiesRetryCount = "SCANNER_DEPENDENCY_TRACK_FETCH_VULNERABILITIES_RETRY_COUNT"
	ScannerDependencyTrackFetchVulnerabilitiesRetrySleep = "SCANNER_DEPENDENCY_TRACK_FETCH_VULNERABILITIES_RETRY_SLEEP"
)
View Source
const (
	ScannerLocalGrypeScope      = "SCANNER_LOCAL_GRYPE_SCOPE"
	ScannerLocalGrypeDBRootDir  = "SCANNER_LOCAL_GRYPE_DB_ROOT_DIR"
	ScannerLocalGrypeListingURL = "SCANNER_LOCAL_GRYPE_LISTING_URL"
	ScannerLocalGrypeUpdateDB   = "SCANNER_LOCAL_GRYPE_UPDATE_DB"
)
View Source
const (
	ScannerRemoteGrypeServerAddress = "SCANNER_REMOTE_GRYPE_SERVER_ADDRESS"
	ScannerRemoteGrypeServerTimeout = "SCANNER_REMOTE_GRYPE_SERVER_TIMEOUT"
)
View Source
const (
	ResultServiceAddress  = "RESULT_SERVICE_ADDR"
	ImageIDToScan         = "IMAGE_ID_TO_SCAN"
	ImageHashToScan       = "IMAGE_HASH_TO_SCAN"
	ImageNameToScan       = "IMAGE_NAME_TO_SCAN"
	ScanUUID              = "SCAN_UUID"
	RegistrySkipVerifyTlS = "REGISTRY_SKIP_VERIFY_TLS"
	RegistryUseHTTP       = "REGISTRY_USE_HTTP"
)
View Source
const LocalImageScan = "LOCAL_IMAGE_SCAN"
View Source
const (
	ScannerGrypeMode = "SCANNER_GRYPE_MODE"
)
View Source
const (
	ScannersList = "SCANNERS_LIST"
)

Variables

This section is empty.

Functions

func CreateRegistryOptions

func CreateRegistryOptions(registry *Registry) *image.RegistryOptions

Types

type Analyzer

type Analyzer struct {
	OutputFormat string
	AnalyzerList []string
	Scope        string
}

TODO: maybe we need to extend the unified config.

func LoadAnalyzerConfig

func LoadAnalyzerConfig() *Analyzer

type Auths

type Auths []struct {
	Authority string `yaml:"authority" json:"authority" mapstructure:"authority"`
	Username  string `yaml:"-" json:"-" mapstructure:"username"`
	Password  string `yaml:"-" json:"-" mapstructure:"password"`
	Token     string `yaml:"-" json:"-" mapstructure:"token"`
}

type Config

type Config struct {
	Registry       *Registry
	Analyzer       *Analyzer
	Scanner        *Scanner
	LocalImageScan bool
}

type DependencyTrackConfig

type DependencyTrackConfig struct {
	APIKey                         string        `json:"-"`
	Host                           string        `json:"host"`
	ProjectName                    string        `json:"project-name"`
	ProjectVersion                 string        `json:"project-version"`
	ShouldDeleteProject            bool          `json:"should-delete-project"`
	DisableTLS                     bool          `json:"disable-tls"`
	InsecureSkipVerify             bool          `json:"insecure-skip-verify"`
	FetchVulnerabilitiesRetryCount int           `json:"fetch-vulnerabilities-retry-count"`
	FetchVulnerabilitiesRetrySleep time.Duration `json:"fetch-vulnerabilities-retry-sleep"`
}

func ConvertToDependencyTrackConfig

func ConvertToDependencyTrackConfig(scanner *Scanner, logger *logrus.Entry) DependencyTrackConfig

func LoadDependencyTrackConfig

func LoadDependencyTrackConfig() DependencyTrackConfig

type GomodConfig

type GomodConfig struct {
	OutputFormat string
}

func ConvertToGomodConfig

func ConvertToGomodConfig(analyzer *Analyzer) GomodConfig

type GrypeConfig

type GrypeConfig struct {
	LocalGrypeConfig
	RemoteGrypeConfig
	Mode Mode
}

func LoadGrypeConfig

func LoadGrypeConfig() GrypeConfig

type LocalGrypeConfig

type LocalGrypeConfig struct {
	UpdateDB   bool
	DBRootDir  string       // Location to write the vulnerability database cache.
	ListingURL string       // URL of the vulnerability database.
	Scope      source.Scope // indicates "how" or from "which perspectives" the source object should be cataloged from.
}

type LocalGrypeConfigEx

type LocalGrypeConfigEx struct {
	LocalGrypeConfig
	RegistryOptions *image.RegistryOptions
}

func ConvertToLocalGrypeConfig

func ConvertToLocalGrypeConfig(scanner *Scanner, registry *Registry) LocalGrypeConfigEx

type Mode

type Mode string
const (
	ModeLocal  Mode = "LOCAL"
	ModeRemote Mode = "REMOTE"
)

type Registry

type Registry struct {
	SkipVerifyTLS bool  `yaml:"skip-verify-tls" json:"skip-verify-tls" mapstructure:"skip-verify-tls"`
	UseHTTP       bool  `yaml:"use-http" json:"use-http" mapstructure:"use-http"`
	Auths         Auths `yaml:"auths" json:"auths" mapstructure:"auths"`
}

func LoadRuntimeScannerRegistryConfig

func LoadRuntimeScannerRegistryConfig(imageID string) *Registry

type RemoteGrypeConfig

type RemoteGrypeConfig struct {
	GrypeServerAddress string
	GrypeServerTimeout time.Duration
}

type Scanner

type Scanner struct {
	ScannersList          []string
	GrypeConfig           GrypeConfig
	DependencyTrackConfig DependencyTrackConfig
}

func LoadScannerConfig

func LoadScannerConfig() *Scanner

type SyftConfig

type SyftConfig struct {
	OutputFormat    string
	Scope           source.Scope
	RegistryOptions *image.RegistryOptions
}

TODO: maybe we need to extend syft confg.

func CreateSyftConfig

func CreateSyftConfig(analyzer *Analyzer, registry *Registry) SyftConfig

Jump to

Keyboard shortcuts

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