For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/default_rules/jyb-pxc-x25.md. A documentation index is available at /llms.txt.

Containers should have an enabled AppArmor profile

docker

Classification:

compliance

Framework:

cis-docker

Control:

5.2

Description

On a host with AppArmor, containers should run under an AppArmor profile.

Rationale

An AppArmor profile restricts the files, capabilities, and mounts of the processes of a container, which limits what an attacker can do from inside it.

Audit

Inspect the containers:

docker ps --quiet --all | xargs docker inspect --format '{{ .Name }}: AppArmorProfile={{ .AppArmorProfile }}'

Datadog applies the rule to the hosts whose Docker daemon lists AppArmor among its security options, and to the containers that have started: Docker records the profile of a container when it starts it. It passes the rule when a container runs under a profile, such as docker-default, and fails it when the profile is empty or unconfined.

Remediation

Run the containers without --privileged or --security-opt apparmor=unconfined, under docker-default or a profile of your own loaded with apparmor_parser.

Impact

A profile can deny an action that the workload needs, which a profile of its own then allows.

Default value

Docker runs containers under the docker-default profile on hosts with AppArmor.

References

  1. https://docs.docker.com/engine/security/apparmor/
  2. https://docs.docker.com/engine/containers/run/#security-configuration
  3. https://docs.docker.com/engine/security/#other-kernel-security-features