Docker
TMA-DOCKER-2.15
Ensure containers are restricted from acquiring new privileges
높음레벨 1자동docker
설명
no-new-privileges prevents container processes from gaining privileges via setuid/setgid binaries. Compliant when --no-new-privileges or "no-new-privileges": true is set daemon-wide. The audit reads the running dockerd command line (ps) together with /etc/docker/daemon.json.
점검 방법
감사 방식: 셸 명령
shell
args=$(ps -eo args 2>/dev/null) || exit 1; s=$(printf '%s\n' "$args" | grep '[d]ockerd'; cat /etc/docker/daemon.json 2>/dev/null); printf '%s\n' "$s" | grep -Eq -e '--no-new-privileges([[:space:]]|=true|$)|"no-new-privileges"[[:space:]]*:[[:space:]]*true' && echo compliant || echo missing- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
Set "no-new-privileges": true in /etc/docker/daemon.json and restart the Docker daemon.
속성
- 운영 체제
- 모두
- 태그
- dockerdaemon
- 참고 자료
- CIS Docker Benchmark v1.9.0 - 2.15 Ensure containers are restricted from acquiring new privileges
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target docker