Docker
TMA-DOCKER-2.15
Ensure containers are restricted from acquiring new privileges
AltaNível 1Automatizadadocker
Descrição
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.
Como é verificado
Método de auditoria: Comando shell
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- Saída esperada
compliant
Como é corrigido
Método de correção: Orientação ou patch de infraestrutura
Set "no-new-privileges": true in /etc/docker/daemon.json and restart the Docker daemon.
Propriedades
- Sistemas operacionais
- Qualquer
- Tags
- dockerdaemon
- Referência
- CIS Docker Benchmark v1.9.0 - 2.15 Ensure containers are restricted from acquiring new privileges
Verificar este host
Execute isto em uma máquina que você tenha permissão para auditar. A varredura é somente leitura.
shell
tmaegis scan --target docker