Project: Clair (Provisioning / Security & Compliance)
File: config.md

Clair is configured by a structured yaml or JSON[^1] file and an optional directory of "merge" and "patch" documents[^1]. Each Clair node needs to specify what mode it will run in and a path to a configuration file via CLI flags or environment variables. For example: ```shell $ clair -conf ./path/to/config.yaml -mode indexer $ clair -conf ./path/to/config.yaml -mode matcher ``` ``` -mode (also specified by CLAIR_MODE env variable) 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 "notifier": runs just the notifier node "combo": will run all services on the same node. -conf (also specified by CLAIR_CONF env variable) A file system path to Clair's config file ``` The above example starts two Clair nodes using the same configuration. One will only run the indexing facilities while the other will only run the matching facilities. Environment variables respected by the Go standard library can be specified if needed. Some notable examples: `HTTP_PROXY` `HTTPS_PROXY` `SSLCERTDIR` If running in "combo" mode you must supply the `indexer`, `matcher`, and `notifier` configuration blocks in the configuration. Starting in Clair version `4.7.0`, dropin configuration files are supported. Given a root configurtaion file of `/etc/clair/config.json`, all files matching the globs `/etc/clair/config.json.d/.json` and `/etc/clair/config.json.d/.json-patch` would be loaded in lexical order after the root configuration file. Similarly, given `/etc/clair/config.yaml`, all files matching the globs `/etc/clair/config.yaml.d/.yaml` and `/etc/clair/config.yaml.d/.yaml-patch` would be loaded. Only the extensions `yaml` and `json` are supported, and indicate yaml and JSON formatting, respectively. The dropin files must have the same extension and format as the root file. Dropins with the bare suffix are treated as . Dropins with the `-patch` suffix are treated as and must contain a valid structure. Yaml documents must be resolvable to the JSON subset. Take care with the behavior around lists; a patch operation may be more suitable. The `clairctl check-config` command can be used to ensure a merged configuration is what is intended. In addition, placing `test` operations in a patch file that's evaluated last (such as `zz-validate.json-patch`) can be used to have Clair refuse to start if some configuration values are not what is intended. The application defaults are applied after the configuration is loaded and as such, not reflected in the `clairctl check-config` command. The output of that command is also not currently suitable to be used to "compile" a config to a single file. Starting in version `4.7.0`, unknown keys are disallowed. Configurations that looked valid previously and loaded fine may now cause Clair to refuse to start. In version `4.8.0`, using Jaeger for trace submission was deprecated. Configurations that use Jaeger will print a warning. In future versions, using the Jaeger format may cause an error. Please see the for additional documentation on defaults and

``` httplistenaddr: "" introspection_addr: "" log_level: "" tls: {} indexer: connstring: "" scanlock_retry: 0 layerscanconcurrency: 0 migrations: false scanner: {} airgap: false matcher: connstring: "" indexer_addr: "" migrations: false period: "" disable_updaters: false update_retention: 2 matchers: names: nil config: nil updaters: sets: nil config: nil notifier: connstring: "" migrations: false indexer_addr: "" matcher_addr: "" poll_interval: "" delivery_interval: "" disable_summary: false webhook: null amqp: null stomp: null auth: psk: nil trace: name: "" probability: null jaeger: agent: endpoint: "" collector: endpoint: "" username: null password: null service_name: "" tags: nil buffer_max: 0 otlp: http: {} grpc: {} metrics: name: "" prometheus: endpoint: null ``` Note: the above just lists every key for completeness. Copy-pasting the above as a starting point for configuration will result in some options not having their defaults set normally. <! The following are purposefully omitted. See comments in the config package for more information. --> A string in `<host>:<port>` format where `<host>` can be an empty string. This configures where the HTTP API is exposed. See `/openapi/v1` for the API spec. A string in `<host>:<port>` format where `<host>` can be an empty string. This configures where Clair's metrics and health endpoints are exposed. Set the logging level. One of the following strings: debug-color debug info warn error fatal panic TLS is a map containing the config for serving the HTTP API over TLS (and HTTP/2). The TLS certificate to be used. Must be a full-chain certificate, as in nginx. A key file for the TLS certificate. Encryption is not supported on the key. Indexer provides Clair Indexer node configuration. Disables HTTP access to the Internet for indexers and fetchers. Private IPv4 and IPv6 addresses are allowed. Database connections are unaffected. A Postgres connection string. Accepts a format as a url (e.g., `postgres://pqgotest:password@localhost/pqgotest?sslmode=verify-full`) or a libpq connection string (e.g., `user=pqgotest dbname=pqgotest sslmode=verify-full`). Integer. Rate limits the number of index report creation requests. Setting this to 0 will attempt to auto-size this value. Setting a negative value means "unlimited." The auto-sizing is a multiple of the number of available cores. The API will return a 429 status code if concurrency is exceeded. A positive integer 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 --> Positive integer limiting the number of concurrent layer scans. Indexers will index a Manifest's layers concurrently. This value tunes the number of layers an Indexer will scan in parallel. A boolean value. Whether Indexer nodes handle migrations to their database. Indexer configurations. Scanner allows for passing configuration options to layer scanners. The scanner will have this configuration passed to it on construction if designed to do so. A map with the name of a particular scanner and arbitrary yaml as a value. A map with the name of a particular scanner and arbitrary yaml as a value. A map with the name of a particular scanner and arbitrary yaml as a value. Matcher provides Clair matcher node configuration. Duration string. Controls how long clients should be hinted to cache responses for. A Postgres connection string. Accepts a format as a url (e.g., `postgres://pqgotest:password@localhost/pqgotest?sslmode=verify-full`) or a libpq connection string (e.g., `user=pqgotest dbname=pqgotest sslmode=verify-full`). A positive integer limiting the database connection pool size. Clair allows for a custom connection pool size. This number will directly set how many active database connections are allowed concurrently. This parameter will be ignored in a future version. Users should configure this through the connection

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. A boolean value. Whether Matcher nodes handle migrations to their databases. A time.ParseDuration parseable string. Determines how often updates for new security advisories will take place. Defaults to 6 hours. A boolean value. Whether to run background updates or not. An integer value limiting the number of update operations kept in the database. Sets the number of update operations to retain between garbage collection cycles. This should be set to a safe MAX value based on database size constraints. Defaults to 10. If a value less than 0 is provided, GC is disabled. 2 is the minimum value to ensure updates can be compared for notifications. Matchers provides configuration for the in-tree Matchers and RemoteMatchers. A list of string values informing the matcher factory about enabled matchers. If the value is nil the default list of Matchers will run: alpine-matcher aws-matcher debian-matcher gobin java-maven oracle photon python rhel rhel-container-matcher suse ubuntu-matcher If an empty list is provided zero matchers will run. Provides configuration to specific matcher. A map keyed by the name of the matcher containing a sub-object which will be provided to the matchers factory constructor. A hypothetical example: config: python: ignore_vulns: CVE-XYZ CVE-ABC Updaters provides configuration for the Matcher's update manager. A list of string values informing the update manager which Updaters to run. If the value is nil (or `null` in yaml) the default set of Updaters will run: alpine aws debian oracle osv photon rhcc rhel suse ubuntu If an empty list is provided zero updaters will run. Provides configuration to specific updater sets. A map keyed by the name of the updater set name containing a sub-object which will be provided to the updater set's constructor. A hypothetical example: config: ubuntu: securitytrackerurl: http://security.url ignore_distributions: cosmic Notifier provides Clair notifier node configuration. A Postgres connection string. Accepts a format as a url (e.g., `postgres://pqgotest:password@localhost/pqgotest?sslmode=verify-full`) or a libpq connection string (e.g., `user=pqgotest dbname=pqgotest sslmode=verify-full`). A boolean value. Whether Notifier nodes handle migrations to their database. A string in `<host>:<port>` format where `<host>` can be an empty string. A Notifier contacts an Indexer to create obtain manifests affected by vulnerabilities. The location of this Indexer is required. A string in `<host>:<port>` format where `<host>` can be an empty string. A Notifier contacts a Matcher to list update operations and acquire diffs. The location of this Indexer is required. A time.ParseDuration parsable string. The frequency at which the notifier will query at Matcher for Update Operations. A time.ParseDuration parsable string. The frequency at which the notifier attempt delivery of created or previously failed notifications. A boolean. Controls whether notifications should be summarized to one per manifest or not. Configures the notifier for webhook delivery. URL where the webhook will be delivered. The callback url where notifications can be retrieved. The notification ID will be appended to this url. This will typically be where the clair notifier is hosted. A map associating a header name to a list of values. Configures the notifier for AMQP delivery. Note: Clair does not declare any AMQP components on its

All attempts to use an exchange or queue are passive only and will fail The broker administrators should setup exchanges and queues ahead of time. A boolean value. If true the Notifier will deliver individual notifications (not a callback) to the configured AMQP broker. Integer 0 or greater. If `direct` is true this value will inform notifier how many notifications to send in a single direct delivery. For example, if `direct` is set to `true` and `rollup` is set to `5`, the notifier will deliver no more then 5 notifications in a single json payload to the broker. Setting the value to 0 will effectively set it to 1. The AMQP Exchange to connect to. string value The name of the exchange to connect to. string value The type of the exchange. Typically: direct fanout topic headers bool value Whether the configured queue is durable or not. bool value Whether the configured queue uses an auto_delete policy. string value The name of the routing key each notification will be sent with. a URL string If `direct` is `false`, this URL is provided in the notification callback sent to the broker. This URL should point to Clair's notification API endpoint. list of URL strings A list of one or more AMQP brokers to connect to, in priority order. Configures TLS connection to AMQP broker. string value The filesystem path where a root CA can be read. string value The filesystem path where a tls certificate can be read. Note that clair also respects `SSLCERTDIR`, as documented for the Go `crypto/x509` package. string value The filesystem path where a TLS private key can be read. Configures the notifier for STOMP delivery. A boolean value. If `true`, the Notifier will deliver individual notifications (not a callback) to the configured STOMP broker. Integer 0 or greater. If `direct` is `true`, this value will limit the number of notifications sent in a single direct delivery. For example, if `direct` is set to `true` and `rollup` is set to `5`, the notifier will deliver no more then 5 notifications in a single json payload to the broker. Setting the value to 0 will effectively set it to 1. a URL string If `direct` is `false`, this URL is provided in the notification callback sent to the broker. This URL should point to Clair's notification API endpoint. a string value The STOMP destination to deliver notifications to. list of URL strings A list of one or more STOMP brokers to connect to in priority order. Configures TLS connection to STOMP broker. string value The filesystem path where a root CA can be read. Note that clair also respects `SSLCERTDIR`, as documented for the Go `crypto/x509` package. string value The filesystem path where a tls certificate can be read. string value The filesystem path where a tls private key can be read. Configures login details for the STOMP broker. string value The STOMP login to connect with. string value The STOMP passcode to connect with. Defines ClairV4's external and intra-service JWT based authentication. If multiple auth mechanisms are defined, Clair will pick one. Currently, there are not multiple mechanisms. Defines preshared key

a string value A shared base64 encoded key distributed between all parties signing and verifying JWTs. a list of string value A list of JWT issuers to verify. An empty list will accept any issuer in a JWT claim. Defines distributed tracing configuration based on OpenTelemetry. Which submission format to use, one of: jaeger otlp sentry a float value The probability a trace will occur. Defines values for Jaeger tracing. *NOTE*: Jaeger has deprecated using the `jaeger` protocol and encouraging users to migrate to OTLP, which Jaeger can ingest natively. Defines values for configuring delivery to a Jaeger agent. a string value An address in `<host>:<post>` syntax where traces can be submitted. Defines values for configuring delivery to a Jaeger collector. a string value An address in `<host>:<post>` syntax where traces can be submitted. a string value a string value a string value a mapping of a string to a string an integer value Configuration for OTLP traces. Only one of the `http` or `grpc` keys should be provided. Configuration for OTLP traces submitted by HTTP. Request path to use for submissions. Defaults to `/v1/traces`. Compression for payloads. One of: gzip none `Host:port` for submission. Defaults to `localhost:4318`. Key-value pairs of additional headers for submissions. Use HTTP instead of HTTPS. Maximum of of time for a trace submission. Client certificate for connection. Key for the certificate specified in `cert`. Configuration for OTLP traces submitted by gRPC. Sets the minimum time between connection attempts. A string containing a JSON-format gRPC service config. Compression for payloads. One of: gzip none `Host:port` for submission. Defaults to `localhost:4317`. Key-value pairs of additional headers for submissions. Do not verify the server certificate. Maximum of of time for a trace submission. Client certificate for connection. Key for the certificate specified in `cert`. Configuration for submitting traces to Sentry. This is done via OpenTelemetry instrumentation, so may not provide identical results compared to other tracing backends or native Sentry instrumentation. There's no integration for error submission. This means that alternative implementations of the Sentry API that do not support submitting traces (such as [GlitchTip]) are not usable. Sentry DSN to use. See also . Sentry environment to use. See also . Defines distributed tracing configuration based on OpenTelemetry. a string value Configuration for a prometheus metrics exporter. a string value Defines the path where metrics will be served. Configuration for OTLP metrics. Only one of the `http` or `grpc` keys should be provided. Configuration for OTLP metrics submitted by HTTP. Request path to use for submissions. Defaults to `/v1/metrics`. Compression for payloads. One of: gzip none `Host:port` for submission. Defaults to `localhost:4318`. Key-value pairs of additional headers for submissions. Use HTTP instead of HTTPS. Maximum of of time for a metrics submission. Client certificate for connection. Key for the certificate specified in `cert`. Configuration for OTLP metrics submitted by gRPC. Sets the minimum time between connection attempts. A string containing a JSON-format gRPC service config. Compression for payloads. One of: gzip none `Host:port` for submission. Defaults to `localhost:4318`. Key-value pairs of additional headers for submissions. Use HTTP instead of HTTPS. Maximum of of time for a metrics submission. Client certificate for connection. Key for the certificate specified in `cert`.