TMAegis
Thêm quy tắc cho docker

TMA-DOCKER-2.10

Enable user namespace support

Trung bìnhCấp 2Tự độngdocker

Mô tả

User namespace remapping maps root inside containers to an unprivileged host UID, limiting the impact of a container breakout. The audit checks that docker info lists name=userns under SecurityOptions.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
o=$(docker info --format '{{range .SecurityOptions}}{{.}} {{end}}') || exit 1; printf '%s\n' "$o" | grep -q 'name=userns' && echo compliant || echo missing
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

Ensure /etc/subuid and /etc/subgid contain a mapping, set "userns-remap": "default" in /etc/docker/daemon.json and restart the Docker daemon (existing images and volumes need to be re-created).

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
dockerdaemon
Tham chiếu
CIS Docker Benchmark v1.9.0 - 2.10 Enable user namespace support

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target docker --level 2