Harden securityContext on the bundled postgres StatefulSet
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 77/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go, kubernetes, yaml
- Lĩnh vực
- databases, infrastructure, security
Hướng nghiên cứu
Bắt đầu với manifests/ate-install/postgres/postgres.yaml và kiểm tra các security context của container postgres và tls-reloader cùng với fsGroup hiện có ở cấp pod. Thêm các hạn chế được yêu cầu, đồng thời giữ nguyên các thiết lập danh tính tương thích với TLS của container postgres; sau đó kiểm tra pod-certificate-controller.yaml để tìm capability NET_BIND_SERVICE không được sử dụng. Hoàn tất khi các hạn chế container được yêu cầu và việc dọn dẹp capability được thể hiện trong các manifest.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 8.7k
- Fork
- 969
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 128
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của agent-substrate/substrate
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
agent-substrate/substrate#4308 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/observability kind/feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agent-substrate/substrate#4275 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/dev-infra kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agent-substrate/substrate#4248 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/node area/security kind/feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agent-substrate/substrate#4188 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: ExternalVolumeStatus.volume_type demands a prefix of "substrate.io" which we do not ownCó thể đã có người làm @msau42 đã nhận 7 ngày trước. Đang mởarea/api area/storage kind/bug ready-for-pr
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
agent-substrate/substrate#4129 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của agent-substrate/substrate
Issue tương tự
-
good first issue tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Edwin-metcalf/MetCode#76 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
-diff's removed-name budget ignores the names the -ptr pass testedCó thể đã có người làm @nova-loop đã nhận hôm nay. Đang mởarea: cli bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TMHSDigital/subenum#495 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
deskclose human-decided leaves the legacy decision-needed label and applies no human-decidedĐang mởbug effort:s impact:med raised-by:worker risk:low to:worker
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
medici-finance/assay#8120 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
factory:subtask
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
reportedBy/community
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openchoreo/openchoreo#5751 ·
Maintainer thường phản hồi trong vòng 1 ngày