Harden securityContext on the bundled postgres StatefulSet
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 77/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go, kubernetes, yaml
- Área
- databases, infrastructure, security
Línea de trabajo
Empieza con manifests/ate-install/postgres/postgres.yaml y revisa los contextos de seguridad de los contenedores postgres y tls-reloader junto con el fsGroup existente a nivel de pod. Añade las restricciones solicitadas y conserva la configuración de identidad compatible con TLS del contenedor postgres; después, revisa pod-certificate-controller.yaml para localizar la capacidad NET_BIND_SERVICE no utilizada. El trabajo estará terminado cuando las restricciones solicitadas para los contenedores y la eliminación de la capacidad estén reflejadas en los manifests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 8.7k
- Forks
- 969
- Merge medio
- 5 d 1 h
- PR fusionados (30 d)
- 128
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de agent-substrate/substrate
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
agent-substrate/substrate#4308 ·
Los mantenedores suelen responder en 2 días
-
area/observability kind/feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agent-substrate/substrate#4275 ·
Los mantenedores suelen responder en 2 días
-
area/dev-infra kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agent-substrate/substrate#4248 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
area/node area/security kind/feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agent-substrate/substrate#4188 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[Bug]: ExternalVolumeStatus.volume_type demands a prefix of "substrate.io" which we do not ownPosiblemente ocupada @msau42 la tomó hace 7 días. Abiertoarea/api area/storage kind/bug ready-for-pr
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
agent-substrate/substrate#4129 · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de agent-substrate/substrate
Issues similares
-
deskclose human-decided leaves the legacy decision-needed label and applies no human-decidedAbiertobug effort:s impact:med raised-by:worker risk:low to:worker
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
medici-finance/assay#8120 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
factory:subtask
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
ci good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
TMHSDigital/Spackle#206 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
celestiaorg/celestia-app#8877 ·
Los mantenedores suelen responder en 1 día
-
sweep
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
bketelsen/truenas-mcp#112 ·
Los mantenedores suelen responder en 1 día