SELinux labelling does not get disabled when using Podman machines

Abierto
#1,347 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@darshpatel1052 ya está trabajando en esto.

Desde el 3/11/2026.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
40/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
devtools

Línea de trabajo

Start with isUsingSELinuxLabels() for image builds and getPodmanArgs() for container run args, both named in the issue. Check how cliHost and dockerCLI are used there and whether podman info can replace the getenforce check. Done means Podman machines and remote Podman get the SELinux decision from the correct host, with tests covering the changed branches.

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

Descripción

Since #1045, SELinux labelling is supposed to get disabled for devcontainers when using Podman. However, this only works when Podman runs directly on the same (Linux) host as the devcontainers CLI. It is never applied with a Podman machine (the default on macOS and Windows) and the decision is made on the wrong host when Podman is remote (e.g. through an SSH tunnel) or a Podman machine runs on Linux.

Consider the current code of isUsingSELinuxLabels() for image builds. Container run args have a similar issue in getPodmanArgs().

return params.cliVariant === CLIVariant.Podman && cliHost.platform === 'linux'
	&& (await runCommandNoPty({
		exec: cliHost.exec,
		cmd: 'getenforce',
		output,
		print: true,
	})).stdout.toString().trim() !== 'Disabled'
	&& (await dockerCLI({
		...toExecParameters(params),
		print: true,
	}, 'info', '-f', '{{.Host.Security.SELinuxEnabled}}')).stdout.toString().trim() === 'true';

Neither will cliHost.platform always be "linux", nor will running getenforce on the local host always yield the right result. On macOS, getenforce doesn't exist, so the call throws and returns false.

The correct way would probably be to always use podman info and remove the preceding checks.

Potentially related: #1071

Lenguaje dominante
TypeScript
Estrellas
3k
Forks
473
Merge medio
10 h 31 min
PR fusionados (30 d)
9

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 devcontainers/cli

Todos los issues de devcontainers/cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.