Enable the Docker service
An XCCDF Rule
Description
The docker service is commonly needed to
create containers.
The docker
service can be enabled with the following command:
$ sudo systemctl enable docker.service
Rationale
To be able to find any problems with misconfiguration of the docker daemon and running containers, the docker service has to be enabled.
- ID
- xccdf_org.ssgproject.content_rule_service_docker_enabled
- Severity
- Medium
- Updated
Remediation - OS Build Blueprint
[customizations.services]
enabled = ["docker"]
Remediation - Puppet
include enable_docker
class enable_docker {
service {'docker':
enable => true,
ensure => 'running',
Remediation - Ansible
- name: Enable service docker
block:
- name: Gather the package facts
package_facts:
manager: auto
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" unmask 'docker.service'
"$SYSTEMCTL_EXEC" start 'docker.service'