第 9 章 Clair 配置概述
Clair 由一个结构化的 YAML 文件配置。每个 Clair 节点都需要指定它将在哪些模式下运行的模式,以及通过 CLI 标志或环境变量到配置文件的路径。例如:
$ clair -conf ./path/to/config.yaml -mode indexer
或者
$ clair -conf ./path/to/config.yaml -mode matcher
上述命令会使用相同的配置文件启动两个 Clair 节点。一个运行索引工具,另一个则运行匹配的设施。
如果您以 组合 模式运行 Clair,则必须在配置中提供索引器、匹配器和通知程序配置块。
9.1. 在代理环境中使用 Clair 的信息 复制链接链接已复制到粘贴板!
如果需要,可以指定 Go 标准库相关的环境变量,例如:
HTTP_PROXY$ export HTTP_PROXY=http://<user_name>:<password>@<proxy_host>:<proxy_port>HTTPS_PROXY.$ export HTTPS_PROXY=https://<user_name>:<password>@<proxy_host>:<proxy_port>SSL_CERT_DIR$ export SSL_CERT_DIR=/<path>/<to>/<ssl>/<certificates>NO_PROXY$ export NO_PROXY=<comma_separated_list_of_hosts_and_domains>
如果您使用带有 Clair 更新器 URL 的环境中的代理服务器,您必须识别哪些 URL 需要添加到代理允许列表中,以确保 Clair 可以访问它们。例如: osv updater 需要访问 https://osv-vulnerabilities.storage.googleapis.com 来获取生态系统数据转储。在这种情况下,URL 必须添加到代理允许列表中。有关 updater URL 的完整列表,请参阅"Clair updater URL"。
您还必须确保将标准 Clair URL 添加到代理允许列表中:
-
https://search.maven.org/solrsearch/select -
https://catalog.redhat.com/api/containers/ -
https://access.redhat.com/security/data/metrics/repository-to-cpe.json -
https://access.redhat.com/security/data/metrics/container-name-repos-map.json
在配置代理服务器时,请考虑启用 Clair 和这些 URL 之间的无缝通信所需的任何身份验证要求或特定的代理设置。通过全面记录并解决这些注意事项,您可以确保在通过代理路由更新器流量的同时,有效处理 Clair 功能。