[Security] ssl-cert snakeoil private key baked into standard images (Trivy HIGH)
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- debian, docker, postgresql
- 领域
- devops, infrastructure, security
调研方向
Inspect the Dockerfile steps that install the Debian ssl-cert package across the standard and minimal image variants. Reproduce the finding with the provided trivy image command, then verify that all affected PostgreSQL 13–18 bookworm and trixie images no longer contain the snakeoil key or certificate and pass the scan.
由索引模型根据 Issue 内容生成。
描述
Summary
Trivy flags a HIGH-severity secret in ghcr.io/cloudnative-pg/postgresql:16.14-standard-bookworm:
- File:
/etc/ssl/private/ssl-cert-snakeoil.key - Finding: AsymmetricPrivateKey (private-key) — HIGH
- Added by:
RUN |2 PG_VERSION=16.14 PG_MAJOR=16 /bin(duringapt install ssl-certpackage)
Root Cause
The Debian ssl-cert package generates a self-signed snakeoil certificate during installation. When installed at Docker build time, the private key is baked into the image layer and ships in every container derived from this image.
Impact
- All containers running this image share the same private key — extractable by anyone with pull access
- Trivy, Grype, and Snyk all flag this as HIGH, blocking security-gated CI/CD pipelines
Reproduction
trivy image --ignore-unfixed ghcr.io/cloudnative-pg/postgresql:16.14-standard-bookworm
Output:
/etc/ssl/private/ssl-cert-snakeoil.key (secrets)
Total: 1 (HIGH: 1)
HIGH: AsymmetricPrivateKey (private-key)
Suggested Fix
Remove the snakeoil key after package installation in the Dockerfile:
RUN apt-get install ... && rm -f /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/certs/ssl-cert-snakeoil.pem
Or skip the ssl-cert package entirely if it is not required by PostgreSQL.
Affected Images
All PostgreSQL major versions (13–18) on both standard and minimal variants using bookworm and trixie bases.
- 主要语言
- HCL
- 星标
- 156
- 派生
- 67
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 15
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudnative-pg/postgres-containers 的其他 Issue
-
Review unnecessary Python packaging tools in PostgreSQL image可能已有人在做 @benispeti 于 6 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
cloudnative-pg/postgres-containers#524 ·
维护者通常 2 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 48/100
cloudnative-pg/postgres-containers#484 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 20/100
cloudnative-pg/postgres-containers#147 ·
维护者通常 2 天内回复
查看 cloudnative-pg/postgres-containers 的全部 Issue
相似的 Issue
-
Tool: FinOps hubs Type: Cleanup
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/finops-toolkit#2354 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
bioconda/bioconda-recipes#70401 ·
维护者通常 2 天内回复
-
scope:security type:aquasec
难度 2/5 1-3 小时 新手友好度 76/100
AbsaOSS/atum-service#494 ·
-
ci: leak_scan_added_lines.py resolves an unqualified origin/main, which a same-named tag can shadow未关闭
难度 2/5 1-3 小时 新手友好度 85/100
WingedGuardian/GENesis-AGI#3418 ·
维护者通常 1 天内回复
-
a11y data import fails with "missing --authors parameter" (npm drops flags in `bin/configure.js`)未关闭
难度 2/5 1-3 小时 新手友好度 90/100