Sidecar image ships pip; its vendored libraries show up as image vulnerabilities (e.g. setuptools CVE-2025-47273)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
调研方向
从 containers/Dockerfile.sidecar 开始,检查 /venv 的构建方式以及它如何被复制到最终镜像中。检查哪些运行时要求需要 pip 或 wheel,然后构建并扫描 sidecar 镜像,以确认其中不包含 pip 自带的库,同时 sidecar 仍能依靠所需依赖运行。
由索引模型根据 Issue 内容生成。
描述
Summary
The sidecar image (plugin-barman-cloud-sidecar) ships pip (and wheel) inside /venv. Neither is used at runtime, but scanners report the libraries pip vendors as vulnerable packages of the image. Since v0.15.0 this includes a HIGH finding that did not show up with v0.14.0.
Details
containers/Dockerfile.sidecar (same on v0.15.1 and main):
RUN python3 -m venv /venv && \
/venv/bin/pip install --upgrade pip wheel && \
/venv/bin/pip install --no-cache-dir -r sidecar-requirements.txt
...
COPY --from=pythonbuilder /venv /venv
So the final distroless image contains the latest pip. pip 26.2.2 vendors setuptools==70.3.0 (only pkg_resources), msgpack==1.1.2, urllib3==2.7.0 and certifi, see src/pip/_vendor/vendor.txt.
Trivy (operator v0.30.1) on plugin-barman-cloud-sidecar:v0.15.1 reports, among others:
| Package | Installed | Finding | Fixed |
|---|---|---|---|
| setuptools | 70.3.0 | CVE-2025-47273 (HIGH) | 78.1.1 |
| msgpack | 1.1.2 | GHSA-6v7p-g79w-8964 (HIGH) | 1.2.1 |
| certifi | 2026.6.17 and 2026.7.22 (two copies) | GHSA-6q48-6c7w-9gw2 (CRITICAL) | 2026.10.19 |
The pip maintainers consider the setuptools and msgpack findings not exploitable through pip (pypa/pip#14224, pypa/pip#14031). That is fine for pip itself, but every user of the sidecar still has to triage or suppress these findings, and they come back with every pip release that lags its vendored libraries.
My guess at why setuptools only appears from v0.15.0 on: #983 dropped setuptools from the sidecar requirements, so the only copy left is pip's vendored one. I have not verified this.
Proposal
Keep pip out of the runtime image, since nothing at runtime installs packages. For example:
RUN python3 -m venv /venv && \
/venv/bin/pip install --upgrade pip wheel && \
/venv/bin/pip install --no-cache-dir -r sidecar-requirements.txt && \
/venv/bin/pip uninstall -y pip wheel
Alternatively, create the runtime venv with --without-pip and install into it with the builder's pip (pip --python /venv/bin/python install ...).
That removes all of pip's vendored copies from the image at once. It also removes one certifi copy, so the bundled CA store is the one from sidecar-requirements.txt only.
Environment
- plugin-barman-cloud v0.15.1 (sidecar
ghcr.io/cloudnative-pg/plugin-barman-cloud-sidecar:v0.15.1) - CloudNativePG on Kubernetes 1.34, scanned with trivy-operator v0.30.1
- 主要语言
- Go
- 星标
- 205
- 派生
- 87
- 平均合并
- 1 天 18 小时
- 30 天内合并 PR
- 43
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudnative-pg/plugin-barman-cloud 的其他 Issue
-
docs: troubleshooting does not cover "cannot proceed with the backup as the cluster has no backup section"可能已有人在做 @fjvbn2003 于 13 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 85/100
cloudnative-pg/plugin-barman-cloud#1165 ·
维护者通常 1 天内回复
-
Wrong `ObjectStore` key logged when the backup object store can't be retrieved in the instance sidecar可能已有人在做 @BoxBoxJason 于 16 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
cloudnative-pg/plugin-barman-cloud#1142 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
cloudnative-pg/plugin-barman-cloud#1117 · 1 个 reaction ·
维护者通常 1 天内回复
-
data.compression rejects zstd although barman-cloud-backup supports it可能已有人在做 @dgsardina 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
cloudnative-pg/plugin-barman-cloud#1104 · 4 个 reaction ·
维护者通常 1 天内回复
-
Add RBAC aggregation labels to ObjectStore editor/viewer ClusterRoles可能已有人在做 @stefanpeknik 于 42 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
cloudnative-pg/plugin-barman-cloud#1102 ·
维护者通常 1 天内回复
查看 cloudnative-pg/plugin-barman-cloud 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
slavakurilyak/awesome-ai-agents#880 ·
维护者通常 1 天内回复
-
后缀带有LTX的番号无法自动匹配未关闭
难度 2/5 1-3 小时 新手友好度 68/100
metatube-community/metatube-sdk-go#387 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
apache/openserverless#282 · 2 条评论 ·