Containers always run as root: image USER is ignored and there is no runAsUser

Abierto
#3,245 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
docker, go

Línea de trabajo

The report names Container API securityContext and image layer unpacking, but no source files or tests. Start by locating container creation, runtime user and group handling, and the image layer extraction path; reproduce with an image declaring USER and the reported postgres or vault cases. Done means image USER is honored, runAsUser and runAsGroup are supported, and image layer ownership is preserved.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area/api area/gvisor area/microVM area/node area/security kind/feature

On v0.6.0 an image with USER redpanda runs as uid 0 in an actor, on both gVisor and microVM. The Container API has no runAsUser or runAsGroup.

Images whose entrypoint drops to a non-root user show more problems:

  • gVisor: the official postgres image fails with exec: "/usr/local/bin/docker-entrypoint.sh": stat /usr/local/bin/docker-entrypoint.sh: permission denied after CHOWN, SETUID and SETGID are added to securityContext.capabilities. Without them it fails earlier with chown: changing ownership of '/var/lib/postgresql/data': Operation not permitted. hashicorp/vault fails at su-exec: vault: Permission denied.
  • microVM: vault server -dev fails with open /home/vault/.vault-token.tmp: permission denied, although that directory belongs to the vault user in the image.

Request

  • Honor the image USER.
  • Add securityContext.runAsUser and runAsGroup.
  • Keep file ownership from image layers when they are unpacked.
Lenguaje dominante
Go
Estrellas
5.9k
Forks
637
Merge medio
2 d 2 h
PR fusionados (30 d)
528

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de agent-substrate/substrate

Todos los issues de agent-substrate/substrate

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.