config

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultGrypeListingURL         = "https://toolbox-data.anchore.io/grype/databases/listing.json"
	DefaultGrypeListingFileTimeout = 60 * time.Second
	DefaultGrypeUpdateTimeout      = 60 * time.Second
	DefaultGrypeMaxDatabaseAge     = 120 * time.Hour
)

Variables

This section is empty.

Functions

func CreateRegistryOptions

func CreateRegistryOptions(registry *Registry) *image.RegistryOptions

Types

type Analyzer

type Analyzer struct {
	OutputFormat string              `yaml:"output_format" mapstructure:"output_format"`
	AnalyzerList []string            `yaml:"analyzer_list" mapstructure:"analyzer_list"`
	Scope        string              `yaml:"scope" mapstructure:"scope"`
	TrivyConfig  AnalyzerTrivyConfig `yaml:"trivy_config" mapstructure:"trivy_config"`
}

TODO: maybe we need to extend the unified config.

type AnalyzerTrivyConfig

type AnalyzerTrivyConfig struct {
	Timeout  int    `yaml:"timeout" mapstructure:"timeout"`
	CacheDir string `yaml:"cache_dir" mapstructure:"cache_dir"`
	TempDir  string `yaml:"temp_dir" mapstructure:"temp_dir"`
}

type AnalyzerTrivyConfigEx

type AnalyzerTrivyConfigEx struct {
	Timeout  time.Duration
	CacheDir string
	TempDir  string
	Registry *Registry
}

func CreateAnalyzerTrivyConfigEx

func CreateAnalyzerTrivyConfigEx(analyzer *Analyzer, registry *Registry) AnalyzerTrivyConfigEx

type Auth

type Auth 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 `yaml:"registry" mapstructure:"registry"`
	Analyzer       *Analyzer `yaml:"analyzer" mapstructure:"analyzer"`
	Scanner        *Scanner  `yaml:"scanner" mapstructure:"scanner"`
	LocalImageScan bool      `yaml:"local_image_scan" mapstructure:"local_image_scan"`
}

func (Config) IsConfig

func (Config) IsConfig()

type GrypeConfig

type GrypeConfig struct {
	LocalGrypeConfig  `yaml:"local_grype_config" mapstructure:"local_grype_config"`
	RemoteGrypeConfig `yaml:"remote_grype_config" mapstructure:"remote_grype_config"`
	Mode              Mode `yaml:"mode" mapstructure:"mode"`
}

type LocalGrypeConfig

type LocalGrypeConfig struct {
	UpdateDB           bool          `yaml:"update_db" mapstructure:"update_db"`
	DBRootDir          string        `yaml:"db_root_dir" mapstructure:"db_root_dir"`                     // Location to write the vulnerability database cache.
	ListingURL         string        `yaml:"listing_url" mapstructure:"listing_url"`                     // URL of the vulnerability database.
	MaxAllowedBuiltAge time.Duration `yaml:"max_allowed_built_age" mapstructure:"max_allowed_built_age"` // Period of time after which the database is considered stale.
	ListingFileTimeout time.Duration `yaml:"listing_file_timeout" mapstructure:"listing_file_timeout"`   // Timeout of grype's HTTP client used for downloading the listing file.
	UpdateTimeout      time.Duration `yaml:"update_timeout" mapstructure:"update_timeout"`               // Timeout of grype's HTTP client used for downloading the database.
	Scope              source.Scope  `yaml:"scope" mapstructure:"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         []Auth `yaml:"auths" json:"auths" mapstructure:"auths"`
}

type RemoteGrypeConfig

type RemoteGrypeConfig struct {
	GrypeServerAddress string        `yaml:"grype_server_address" mapstructure:"grype_server_address"`
	GrypeServerSchemes []string      `yaml:"grype_server_schemes" mapstructure:"grype_server_schemes"`
	GrypeServerTimeout time.Duration `yaml:"grype_server_timeout" mapstructure:"grype_server_timeout"`
}

type Scanner

type Scanner struct {
	ScannersList []string           `yaml:"scanners_list" mapstructure:"scanners_list"`
	GrypeConfig  GrypeConfig        `yaml:"grype_config" mapstructure:"grype_config"`
	TrivyConfig  ScannerTrivyConfig `yaml:"trivy_config" mapstructure:"trivy_config"`
}

type ScannerTrivyConfig

type ScannerTrivyConfig struct {
	Timeout     int
	ServerAddr  string
	ServerToken string
	CacheDir    string
	TempDir     string
}

type ScannerTrivyConfigEx

type ScannerTrivyConfigEx struct {
	Timeout     time.Duration
	CacheDir    string
	TempDir     string
	ServerAddr  string
	ServerToken string
	Registry    *Registry
}

func CreateScannerTrivyConfigEx

func CreateScannerTrivyConfigEx(scanner *Scanner, registry *Registry) ScannerTrivyConfigEx

type SyftConfig

type SyftConfig struct {
	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