SELinux labelling does not get disabled when using Podman machines

Đang mở
#1,347 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@darshpatel1052 đang làm issue này rồi.

Từ ngày 3/11/2026.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
40/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
devtools

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
3k
Fork
473
Merge trung bình
10 giờ 31 phút
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của devcontainers/cli

Tất cả issue của devcontainers/cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.