Harden securityContext on the bundled postgres StatefulSet
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 77/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go, kubernetes, yaml
調査の方向性
manifests/ate-install/postgres/postgres.yaml から始め、postgres と tls-reloader の各コンテナのセキュリティコンテキストを、既存の Pod レベルの fsGroup と併せて確認します。postgres コンテナの TLS に対応した ID 設定を維持しながら、要求された制限を追加します。次に 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時間
- マージ済み PR(30日)
- 128
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
-
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 日以内に返信
-
ci good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
TMHSDigital/Spackle#206 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
celestiaorg/celestia-app#8877 ·
メンテナーはふだん 1 日以内に返信
-
sweep
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
bketelsen/truenas-mcp#112 ·
メンテナーはふだん 1 日以内に返信