Help Center/ Host Security Service/ FAQs/ Baseline Inspection/ How Do I Fix the Docker Baseline in a Cluster Environment?
Updated on 2026-11-05 GMT+08:00

How Do I Fix the Docker Baseline in a Cluster Environment?

In a managed cluster such as Kubernetes, Swarm, or CCE, the Docker daemon parameters and container runtime are centrally managed by the cluster control plane.

Applying baseline suggestions directly to a node can cause the following issues:

  • Configuration rollback: When a node is re-enrolled or a container is rebuilt, the orchestration system automatically rolls back manual changes on specifications.
  • Cluster exception: After the dockerd startup parameters are modified, a node becomes unreachable or a pod cannot be scheduled.
  • No modification entry: Containers managed by workloads (Deployment, StatefulSet, DaemonSet) cannot be configured directly on individual nodes.

Therefore, Docker baseline remediation must be approached at two distinct levels: node-level remediation and cluster/workload-level remediation.

How Do I Determine Whether the Environment Is a Cluster Environment?

Before fixing the Docker baseline, check whether the target host belongs to a managed cluster. If any of the following conditions are met, the host is in a managed cluster environment.

Table 1 Procedure

No.

Procedure

1

Check the cluster component processes.

ps -ef | grep -E 'kubelet|kube-proxy|docker-swarm|containerd' | grep -v grep

2

Check the cluster configuration file.

ls /etc/kubernetes/ 2>/dev/null

systemctl status kubelet 2>/dev/null

3

Check the container orchestration indicator.

docker info 2>/dev/null | grep -iE 'swarm|cluster'

If an orchestration indicator exists, the current environment is a managed cluster environment.

4

Check the environment variable CLUSTER_ID.

env | grep CLUSTER_ID

If the CLUSTER_ID environment variable exists, the current environment is a managed cluster environment.

5

Check nodes under cloud platform management.

If the agent process exists on a CCE or cloud-managed node, or node labels or annotations contain cluster identifiers, the current environment is a managed cluster environment.

Remediation Suggestions for Common Scenarios

Based on the following scenarios, determine whether a baseline finding should be remediated at the node level or at the cluster/workload level.

Table 2 Remediation scenarios

Scenario

Risk Level

Suggestion

File permission/ownership

Low

Remediation can be directly performed on nodes. Common items are as follows:

  • docker.service file ownership
  • systemd unit file permissions and ownership (chmod/chown): In managed clusters, unit files may be generated by cluster installers. Manual changes might be reverted during cluster upgrades.
  • docker.sock ownership
  • socket file permissions and ownership (chown/chmod)
  • /etc/docker directory ownership
  • Docker daemon audit

Host partition

High

Create a separate partition for the container, for example, mount /var/lib/docker to an independent partition (LVM). You need to stop the Docker service, migrate data, and modify the mount configuration in /etc/fstab. You are advised to apply for a downtime window in advance and manually perform the operations. Automatic online fixing is not recommended.

dockerd startup parameters

High

dockerd startup parameters affect the entire daemon process. In managed cluster environments, modifying these parameters directly on individual nodes is prohibited.

Running container configuration

High

You are advised to fix it at the cluster or workload level.

  • Runtime container configurations checked via docker inspect
  • Kubernetes settings: securityContext, Resources, and restartPolicy in pod specifications
  • Network configurations: custom networks and privileged ports
  • Configurations remediated by standardizing container images (such as removing embedded SSH services and prohibiting docker.sock mounts)