SELinux labelling does not get disabled when using Podman machines

Aperta
#1,347 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@darshpatel1052 ci sta già lavorando.

Dal 3/11/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
40/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
3k
Fork
473
Merge medio
10h 31m
PR unite (30g)
9

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di devcontainers/cli

Tutte le issue di devcontainers/cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.