[![GitHub release][release-img]][release]
[![Build Status][ci-img]][ci]
[![Co Status][cov-img]][cov]
[![Go Report Card][report-card-img]][report-card]
[![License][license-img]][license]
The Harbor Scanner Adapter for [Clair][clair-url] is a service that translates the Harbor scanning API into Clair API calls
and allows Harbor to use Clair for pro reports on images stored in Harbor registry as part of its
scan feature.
> See [Proposal: Pluggable Image Scanning][image-roposal] for more details.
* Configuration
* Deploy to minikube
Configuration of the adapter is done at startup.
| Name | Default Value | Description |
|------|---------------|-------------|
| SCANNER_LOG_LEVEL | info | The log level of trace, debug, info, warn, warning, error, fatal or panic. The standard logger logs entries with that level or anything above it. |
| SCANNER_API_SER | :8080 | Binding address for the API HTTP server. |
| SCANNER_API_SER | | The absolute path to the x509 certificate file. |
| SCANNER_API_SER | | The absolute path to the x509 private key file. |
| SCANNER_TLS_INSECURE_SKIP_ | false | Controls whether an HTTP client the server's certificate chain and host name. |
| SCANNER_TLS_CLIENTCAS | | An array of absolute paths to x509 CA files that will be added to host's root CA set. |
| SCANNER_API_SER | 15s | The maximum duration for reading the entire request, including the body. |
| SCANNER_API_SER | 15s | The maximum duration before timing out writes of the response. |
| SCANNER_API_SER | 60s | The maximum amount of time to wait for the next request when keep-alives are enabled. |
| SCANNER_CLAIR_URL | | Clair URL |
| SCANNER_CLAIR_DATABASE_URL | | The Clair database URL, it is used to fetch database updated time of the Clair. Its format is postgresql://user:password/db?sslmode=disable |
| SCANNER_STORE_REDIS_URL | redis://harbor-harbor-redis:6379 | Redis server URI for a Redis store. The URI supports schemas to connect to a standalone Redis server, i.e. redis://user:password:port/db-number and Redis Sentinel deployment, i.e. redis+sentinel://user:password:port1,sentinel_host2:port2/monitor-name/db-number. |
| SCANNER_STORE_REDIS_POOL_MAX_ACTIVE | 5 | The max number of connections allocated by the pool for a Redis store. |
| SCANNER_STORE_REDIS_POOL_MAX_IDLE | 5 | The max number of idle connections in the pool for a Redis store. |
| SCANNER_STORE_REDIS_POOL_IDLE_TIMEOUT | 5m | Close connections after remaining idle for this duration. |
| SCANNER_STORE_REDIS_POOL_CONNECTION_TIMEOUT | 1s | The timeout for connecting to the Redis server. |
| SCANNER_STORE_REDIS_POOL_READ_TIMEOUT | 1s | The timeout for reading a single Redis command reply. |
| SCANNER_STORE_REDIS_POOL_WRITE_TIMEOUT | 1s | The timeout for writing a single Redis command. |
| SCANNER_STORE_REDIS_NAMESPACE | harbor.scanner.clair:store | A namespace for keys in a redis store. |
| SCANNER_STORE_REDIS_SCAN_JOB_TTL | 1h | The time to live for persisting scan jobs and associated scan reports. |
1. Configure Docker client with Docker Engine in minikube:
2. Build Docker container:
3. Configure adapter to handle TLS traffic:
1. Generate certificate and private key files:
2. Create a tls secret from the two generated files:
4. Create harbor-scanner-clair deployment and service:
5. If e is fine you should be able to get scanner's metadata:
[release-img]:
[release]:
[ci-img]:
[ci]:
[cov-img]:
[co://codecov.io/github/goharbor/harbor-scanner-clair
[report-card-img]:
[report-card]:
[license-img]:
[license]:
[clair-url]:
[image-roposal]:
开发语言:Go
Star 数:36
该项目属于安全软件方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕Use Clair as a plug-in vulnerability scanner in the Harbor registry展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | harbor-scanner-clair - Use Clair as a plug-in vulnerability scanner in th |
| 所属分类 | 安全软件 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 22:48:38 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 467 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |