Harden securityContext on the bundled postgres StatefulSet
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 77/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go, kubernetes, yaml
调研方向
从 manifests/ate-install/postgres/postgres.yaml 开始,检查 postgres 和 tls-reloader 容器的安全上下文,以及现有的 Pod 级 fsGroup。添加所要求的限制,同时保留 postgres 容器与 TLS 兼容的身份设置;然后检查 pod-certificate-controller.yaml 中未使用的 NET_BIND_SERVICE capability。所要求的容器限制和 capability 清理都体现在 manifests 中后,即表示完成。
由索引模型根据 Issue 内容生成。
描述
The default install StatefulSet in manifests/ate-install/postgres/postgres.yaml already sets a careful pod-level fsGroup: 70 and documents why the postgres container must not pin runAsUser: pinning it would make the projected TLS key group-readable, and PostgreSQL would refuse to start.
The main postgres container still has no container securityContext at all, and the tls-reloader sidecar only sets runAsUser: 70:
That leaves allowPrivilegeEscalation at the Kubernetes default (true), does not drop capabilities (including NET_RAW), and does not set runAsNonRoot. The official postgres:18-alpine image already runs as UID 70, so runAsNonRoot: true without runAsUser on the main container should be compatible with the TLS constraint above.
This is leftover install hardening after #2936 / #3028, which covered the Substrate control-plane pods but not the bundled database. Authentication for that database is already in good shape (client certificates, hostssl ... cert, and a NetworkPolicy that admits only ate-api-server). This request is only about the pod security context.
Suggested container securityContext:
For postgres (do not set runAsUser):
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop:
- ALL
For tls-reloader, keep runAsUser: 70 and add the same allowPrivilegeEscalation: false, runAsNonRoot: true, and capabilities.drop: [ALL].
Optional: seccompProfile: {type: RuntimeDefault} on the pod or containers.
Related: unused NET_BIND_SERVICE on podcertificate-controller
ate-api-server correctly keeps NET_BIND_SERVICE because it binds :443. The same capability is still set on podcertificate-controller:
cmd/podcertcontroller is a kube-apiserver client; it does not listen on a privileged port (or any port). Dropping the add list would leave drop: [ALL] only.
Found with Rustmaninoff (https://github.com/jose-compu/rustmaninoff), a Checkov-compatible IaC scanner; check IDs CKV_K8S_20, CKV_K8S_23, CKV_K8S_28, and CKV_K8S_25.
- 主要语言
- Go
- 星标
- 8.7k
- 派生
- 969
- 平均合并
- 5 天 1 小时
- 30 天内合并 PR
- 128
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
agent-substrate/substrate 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
agent-substrate/substrate#4308 ·
维护者通常 2 天内回复
-
area/observability kind/feature
难度 2/5 1-3 小时 新手友好度 78/100
agent-substrate/substrate#4275 ·
维护者通常 2 天内回复
-
area/dev-infra kind/bug
难度 2/5 1-3 小时 新手友好度 78/100
agent-substrate/substrate#4248 · 1 条评论 ·
维护者通常 2 天内回复
-
area/node area/security kind/feature
难度 2/5 1-3 小时 新手友好度 78/100
agent-substrate/substrate#4188 · 1 条评论 ·
维护者通常 2 天内回复
-
[Bug]: ExternalVolumeStatus.volume_type demands a prefix of "substrate.io" which we do not own可能已有人在做 @msau42 于 7 天前认领。 未关闭area/api area/storage kind/bug ready-for-pr
难度 2/5 1-3 小时 新手友好度 62/100
agent-substrate/substrate#4129 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 agent-substrate/substrate 的全部 Issue
相似的 Issue
-
good first issue tools
难度 2/5 1-3 小时 新手友好度 90/100
Edwin-metcalf/MetCode#76 ·
维护者通常 1 天内回复
-
-diff's removed-name budget ignores the names the -ptr pass tested可能已有人在做 @nova-loop 今天认领。 未关闭area: cli bug good first issue severity: low
难度 2/5 1-3 小时 新手友好度 84/100
TMHSDigital/subenum#495 ·
维护者通常 1 天内回复
-
bug effort:s impact:med raised-by:worker risk:low to:worker
难度 2/5 1-3 小时 新手友好度 78/100
medici-finance/assay#8120 · 1 条评论 ·
维护者通常 1 天内回复
-
factory:subtask
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
reportedBy/community
难度 2/5 1-3 小时 新手友好度 78/100
openchoreo/openchoreo#5751 ·
维护者通常 1 天内回复