Documentation
¶
Index ¶
Constants ¶
const ( // Run this mode to create receive Manifests and create IndexReports. IndexerMode = "indexer" // Run this mode to retrieve IndexReports and create VulnerabilityReports. MatcherMode = "matcher" // Run this mode to run all modes in a single Clair instance. ComboMode = "combo" // Run this mode to listen for Updates and send notifications when they occur. NotifierMode = "notifier" )
Clair Modes
const DefaultAddress = ":6060"
DefaultAddress is used if an http_listen_addr is not provided in the config.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
PSK *AuthPSK `yaml:"psk,omitempty"`
Keyserver *AuthKeyserver `yaml:"keyserver,omitempty"`
}
Auth holds the specific configs for different authentication methods.
These should be pointers to structs, so that it's possible to distinguish between "absent" and "present and misconfigured."
type AuthKeyserver ¶
AuthKeyserver is the configuration for doing authentication with the Quay keyserver protocol.
The "Intraservice" key is only needed when the overall config mode is not "combo".
func (*AuthKeyserver) UnmarshalYAML ¶
func (a *AuthKeyserver) UnmarshalYAML(f func(interface{}) error) error
UnmarshalYAML implements yaml.Unmarshaler.
type AuthPSK ¶
AuthPSK is the configuration for doing pre-shared key based authentication.
The "Issuer" key is what the service expects to verify as the "issuer claim.
func (*AuthPSK) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler.
type Config ¶
type Config struct {
// One of the following strings
// Sets which mode the clair instances will run in
//
// "indexer": runs just the indexer node
// "matcher": runs just the matcher node
// "combo": will run both indexer and matcher on the same node.
Mode string `yaml:"-"`
// A string in <host>:<port> format where <host> can be an empty string.
//
// exposes Clair node's functionality to the network.
// see /openapi/v1 for api spec.
HTTPListenAddr string `yaml:"http_listen_addr"`
// A string in <host>:<port> format where <host> can be an empty string.
//
// exposes Clair's metrics and health endpoints.
IntrospectionAddr string `yaml:"introspection_addr"`
// Set the logging level.
//
// One of the following strings:
// "debug-color"
// "debug"
// "info"
// "warn"
// "error"
// "fatal"
// "panic"
LogLevel string `yaml:"log_level"`
// See Indexer for details
Indexer Indexer `yaml:"indexer"`
// See Matcher for details
Matcher Matcher `yaml:"matcher"`
Auth Auth `yaml:"auth"`
Trace Trace `yaml:"trace"`
Metrics Metrics `yaml:"metrics"`
}
type Indexer ¶
type Indexer struct {
// A Postgres connection string.
//
// formats
// url: "postgres://pqgotest:password@localhost/pqgotest?sslmode=verify-full"
// or
// string: "user=pqgotest dbname=pqgotest sslmode=verify-full"
ConnString string `yaml:"connstring"`
// A positive value representing seconds.
//
// Concurrent Indexers lock on manifest scans to avoid clobbering.
// This value tunes how often a waiting Indexer will poll for the lock.
// TODO: Move to async operating mode
ScanLockRetry int `yaml:"scanlock_retry"`
// A positive values represeting quantity.
//
// Indexers will index a Manifest's layers concurrently.
// This value tunes the number of layers an Indexer will scan in parallel.
LayerScanConcurrency int `yaml:"layer_scan_concurrency"`
// A "true" or "false" value
//
// Whether Indexer nodes handle migrations to their database.
Migrations bool `yaml:"migrations"`
}
Indexer provides Clair Indexer node configuration
type Jaeger ¶
type Jaeger struct {
Agent struct {
Endpoint string `yaml:"agent_endpoint"`
} `yaml:",inline"`
Collector struct {
Endpoint string `yaml:"collector_endpoint"`
Username *string `yaml:"username"`
Password *string `yaml:"password"`
} `yaml:",inline"`
ServiceName string `yaml:"service_name"`
Tags map[string]string `yaml:"tags"`
BufferMax int `yaml:"buffer_max"`
}
type Matcher ¶
type Matcher struct {
// A Postgres connection string.
//
// Formats:
// url: "postgres://pqgotest:password@localhost/pqgotest?sslmode=verify-full"
// or
// string: "user=pqgotest dbname=pqgotest sslmode=verify-full"
ConnString string `yaml:"connstring"`
// A positive integer
//
// Clair allows for a custom connection pool size.
// This number will directly set how many active sql
// connections are allowed concurrently.
MaxConnPool int `yaml:"max_conn_pool"`
// A string in <host>:<port> format where <host> can be an empty string.
//
// A Matcher contacts an Indexer to create a VulnerabilityReport.
// The location of this Indexer is required.
IndexerAddr string `yaml:"indexer_addr"`
// A "true" or "false" value
//
// Whether Matcher nodes handle migrations to their databases.
Migrations bool `yaml:"migrations"`
// A slice of strings representing which
// updaters matcher will create.
//
// If nil all default UpdaterSets will be used
//
// The following sets are supported:
// "alpine"
// "aws"
// "debian"
// "oracle"
// "photon"
// "pyupio"
// "rhel"
// "suse"
// "ubuntu"
UpdaterSets []string `yaml:"updater_sets"`
}
type Metrics ¶
type Metrics struct {
Name string `yaml:"name"`
Prometheus Prometheus `yaml:"prometheus"`
Dogstatsd Dogstatsd `yaml:"dogstatsd"`
}
type Prometheus ¶
type Prometheus struct {
Endpoint *string `yaml:"endpoint"`
}