Docker
TMA-DOCKER-5.7
Ensure sshd is not run within containers
보통레벨 1자동docker
설명
Running an SSH server inside a container adds attack surface and complicates credential and patch management; use docker exec instead. The audit lists processes of every running container with docker top (no exec into the container) and flags those running sshd.
점검 방법
감사 방식: 셸 명령
shell
ids=$(docker ps -q) || exit 1; bad=''; for i in $ids; do p=$(docker top "$i" -eo comm 2>/dev/null || docker top "$i") || exit 1; printf '%s\n' "$p" | grep -Eq '(^|[ /])sshd( |$)' && bad="$bad $i"; done; [ -z "$bad" ] && echo compliant || echo "sshd running in:$bad"- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
Remove the SSH server from the image and use docker exec (or an orchestrator equivalent) for administrative access.
속성
- 운영 체제
- 모두
- 태그
- dockerruntime
- 참고 자료
- CIS Docker Benchmark v1.9.0 - 5.7 Ensure sshd is not run within containers
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target docker