All Products
Search
Document Center

Container Compute Service:Use configuration inspection to check cluster workloads

Last Updated:Oct 14, 2026

Container Compute Service (ACS)provides the inspection feature for workload configurations to help you scan for security risks in the workload configurations of your cluster. After you run an inspection task, ACS generates an inspection report. You can review and remediate the risk items of your cluster based on the report and monitor the health of your cluster in real time.

Prerequisites

  • You have created an ACS cluster.

  • If you are currently using a RAM user, make sure that you have completed the RAM authorization and RBAC authorization as described below.

    • RAM authorization

      Complete the RAM authorization for the ACS configuration inspection page so that the current RAM user has the permissions to operate the configuration inspection page of the current cluster. Otherwise, the features on the configuration inspection page cannot be used because of insufficient permissions. For more information, see Grant RAM permissions.

      Expand to view the configuration inspection authorization code

      {
        "Statement": [
          {
            "Action": [
              "cs:DescribePolarisConfig",
              "cs:DescribePolarisJob",
              "cs:DescribePolarisCronJob",
              "cs:UpdatePolarisJob",
              "cs:UpdatePolarisCronJob"
            ],
            "Effect": "Allow",
            "Resource": [
              "acs:cs:*:*:cluster/<yourclusterID>"
            ]
          }
        ],
        "Version": "1"
      }

      If you also want to use the inspection report feature, complete the RAM authorization for the specified logproject of Simple Log Service (SLS) (the logproject used by the logtail-ds add-on of the current cluster) so that the current RAM user has the permissions to read data from the specified logproject of SLS. Otherwise, inspection reports cannot be viewed because of insufficient permissions. For more information, see RAM custom policy examples.

      Expand to view the SLS log read authorization code

      {
          "Version": "1",
          "Statement": [
              {
                  "Action": [
                      "log:Get*",
                      "log:List*"
                  ],
                  "Resource": "acs:log:*:*:project/<指定的Project名称>/*",
                  "Effect": "Allow"
              }
          ]
      }
    • RBAC authorization

      Complete the RBAC authorization for the resources involved in the ACS configuration inspection page and grant the RAM user the administrator permissions on a specified cluster, so that the RAM user has the permissions to operate the Kubernetes resources involved in the configuration inspection page. For more information, see Configure RBAC permissions for RAM users or roles.

Enable the workload configuration inspection feature for your cluster

  1. Log on to the ACS console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of the target cluster. In the left navigation pane, choose Security > Inspections.

  3. Optional: Install and upgrade the inspection add-on.

    If this is your first use and the inspection add-on is not installed, follow the on-screen instructions to install the security-inspector add-on. If the inspection add-on is not the latest version, follow the on-screen instructions to upgrade the add-on to the latest version. After the add-on is installed, you can also go to the Cluster Information page and, on the Overview tab, click Security Inspection to go to the Inspections page.

    For more information about the security-inspector add-on and its change history, see security-inspector.

  4. In the upper-right corner of the Inspections page, click Inspect. After the inspection is complete, in the Actions column of the Inspections tab, click Details to view the inspection details.

    Important

    To improve system stability and availability and to ensure business continuity and user experience, run inspections during off-peak hours.

  5. Optional: In the upper-right corner of the Inspections page, click Configure Periodic Inspection to enable or disable the feature that automatically runs configuration inspections on a schedule and the check items that are run during configuration inspection.

Inspection details

InspectionsThe page displays the detailed inspection results of different workload in tables and provides the following features:

  • Filters the results by criteria such as Passed or Failed, Namespace, and Workload Type, and displays the number of Number of Passed Items and Number of Failed Items for each workload.

  • Displays the details of each check item in the inspection results, including the check status at the Pod and container level (passed or failed), the detailed description of the check item, and the remediation recommendation. If a failed check item requires no action, you can add it to the whitelist.

  • Allows you to view the YAML file of workload.

Inspection report

The inspection report displays the scan results of the most recent inspection and includes the following types of information:

  • A scan overview, including the total number of check entries, the number and percentage of each checked resource item, and the overall health score.

  • Statistics of scan results by major category, including the results of categories such as health check, image, network, resource, and security.

  • The detailed scan results of each workload configuration, including the resource type, resource name, namespace, check type, check item, and check result.

Check item

The configuration inspection feature scans and displays the scan results of the following check items.

Check item

What is checked and the security risk

Remediation recommendation

hostNetworkSet

Checks whether the Pod Spec of workload specifies hostNetwork: true, which indicates whether the Pod is configured to share and use the network namespace of the host. If this field is configured, containers in the Pod may attack the host network and sniff data on the host network.

Modify the Pod Spec and delete the hostNetwork field.

Example:

      labels:
        app: nginx
      spec:
-       hostNetwork: true
        containers:
        - name: nginx
          image: nginx:1.14.2

hostIPCSet

Checks whether the Pod Spec of workload specifies hostIPC: true, which indicates whether the Pod is configured to share and use the IPC namespace of the host. If this field is configured, containers in the Pod may attack processes on the host and sniff data of processes on the host.

Modify the Pod Spec and delete the hostIPC field.

Example:

      labels:
        app: nginx
      spec:
-       hostIPC: true
        containers:
        - name: nginx
          image: nginx:1.14.2

hostPIDSet

Checks whether the Pod Spec of workload specifies hostPID: true, which indicates whether the Pod is configured to share and use the PID namespace of the host. If this field is configured, containers in the Pod may attack processes on the host and collect data of processes on the host.

Modify the Pod Spec and delete the hostPID field.

Example:

      labels:
        app: nginx
      spec:
-       hostPID: true
        containers:
        - name: nginx
          image: nginx:1.14.2

hostPortSet

Checks whether the Pod Spec of workload specifies hostPort, which indicates whether the port on which a container listens is mapped to a specified port on the host. If this field is configured, the container may occupy available ports on the host, and unexpected requesters may send requests to the container port.

Modify the Pod Spec and delete the hostPort field.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
-         hostPort: 80

runAsRootAllowed

Checks whether the Pod Spec of workload does not specify runAsNonRoot: true, which indicates whether containers are not configured to run as a non-root user. If this field is not configured, malicious processes in a container may compromise user applications, the host, or even the entire cluster.

Modify the Pod Spec and add runAsNonRoot: true.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
+       securityContext:
+         runAsNonRoot: true

runAsPrivileged

Checks whether the Pod Spec of workload specifies privileged: true, which indicates whether containers are allowed to run in privileged mode. If this field is configured, malicious processes in a container may compromise user applications, the host, or even the cluster.

Modify the Pod Spec and delete the privileged field.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        securityContext:
-         privileged: true

privilegeEscalationAllowed

Checks whether the Pod Spec of workload does not specify allowPrivilegeEscalation: false, which indicates whether child processes in a container are not prohibited from obtaining higher privileges than their parent process. If this field is not configured, malicious processes in a container may perform privilege escalation.

Modify the Pod Spec and add the allowPrivilegeEscalation:false field.

Example:

        ports:
        - containerPort: 80
        securityContext:
+         allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
          runAsNonRoot: true
      volumeMounts:

capabilitiesAdded

Checks the Pod Spec of workload for the capabilities field, which indicates whether processes in a container are allowed to have privileged Linux capabilities such as SYS_ADMIN, NET_ADMIN, and ALL. If this field is configured, malicious processes in a container may use these privileges to compromise user applications or to compromise or damage the add-ons or the cluster.

Modify the Pod Spec to add only the Linux capabilities that are required based on your actual needs, and delete the Linux capabilities that are not required.

If no additional Linux capabilities are required, delete all Linux capabilities that are not required. Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        securityContext:
          capabilities:
-           add:
-           - SYS_ADMIN
-           - NET_ADMIN
-           - KILL
+           drop:
+           - ALL

Add only the required Linux capabilities and delete all Linux capabilities that are not required. Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        securityContext:
          capabilities:
            add:
-           - SYS_ADMIN
-           - NET_ADMIN
-           - KILL
+           - CHOWN
+           drop:
+           - ALL

notReadOnlyRootFileSystem

Checks whether the Pod Spec of workload does not specify readOnlyRootFilesystem: true, which indicates whether the file system in a container is not configured to be unmodifiable. If this field is not configured, malicious processes in a container may modify system files.

Modify the Pod Spec and add readOnlyRootFilesystem: true.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        securityContext:
+         readOnlyRootFilesystem: true

If you need to modify files in a directory, you can use the volumeMounts field.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        securityContext:
+         readOnlyRootFilesystem: true
          runAsNonRoot: true
+       volumeMounts:
+       - mountPath: /path/to/write
+         name: writeable
+   volumes:
+   - emptyDir: {}
+     name: writeable

cpuRequestsMissing

Checks whether the Pod Spec of workload does not specify the resources.requests.cpu field, which indicates whether the minimum CPU resources required to run a container are not configured. If this field is not configured, the Pod may be scheduled to a node with insufficient resources, and processes in the container may run slowly.

Modify the Pod Spec and add the resources.requests.cpu field.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
+       resources:
+         requests:
+           cpu: 100m
        ports:

cpuLimitsMissing

Checks whether the Pod Spec of workload does not specify the resources.limits.cpu field, which indicates whether the maximum CPU resources required to run a container are not configured. If this field is not configured, abnormal processes in a container may consume a large amount of node resources and even exhaust the resources of the entire node or cluster.

Modify the Pod Spec and add the resources.limits.cpu field.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        resources:
          requests:
            cpu: 100m
+         limits:
+           cpu: 100m
        ports:

memoryRequestsMissing

Checks whether the Pod Spec of workload does not specify the resources.requests.memory field, which indicates whether the minimum memory resources required to run a container are not configured. If this field is not configured, the Pod may be scheduled to a node with insufficient resources, and processes in the container may run out of memory (OOM).

Modify the Pod Spec and add the resources.requests.memory field.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        resources:
          requests:
            cpu: 100m
+           memory: 128Mi
          limits:

memoryLimitsMissing

Checks whether the Pod Spec of workload does not specify the resources.limits.memory field, which indicates whether the maximum memory resources required to run a container are not configured. If this field is not configured, abnormal processes in a container may consume a large amount of node resources and even exhaust the resources of the entire node or cluster.

Modify the Pod Spec and add the resources.limits.memory field.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 100m
+           memory: 128Mi
        ports:

readinessProbeMissing

Checks whether the Pod Spec of workload does not specify the readinessProbe field, which indicates whether a probe that detects whether the application in a container can properly handle requests is not configured. If this field is not configured, requests may still be sent to the application in the container when the application is abnormal and cannot handle requests, which causes business exceptions.

Modify the Pod Spec and add the readinessProbe field.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
+       readinessProbe:
+         httpGet:
+           path: /health
+           port: 8080
+         initialDelaySeconds: 5
+         periodSeconds: 20
        resources:

livenessProbeMissing

Checks whether the Pod Spec of workload does not specify livenessProbe, which indicates whether a probe that detects whether the application in a container is abnormal and whether the container needs to be restarted is not configured. If this field is not configured, the container may not be restarted in time when the application in the container is abnormal and can be recovered only after a container restart, which causes business exceptions.

Modify the Pod Spec and add the livenessProbe field.

Example:

    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
+       livenessProbe:
+         httpGet:
+           path: /health
+           port: 8080
+         initialDelaySeconds: 5
+         periodSeconds: 20
        readinessProbe:

tagNotSpecified

Checks the Pod Spec of workload to determine whether the value of the image field does not contain an image tag or uses latest as the image tag, which indicates whether a container image with a specified tag is not configured to run the container. If this field is not configured, an unexpected version of the container image may run when the container runs, which causes business exceptions.

Modify the Pod Spec and modify the image field to use a specified image tag, and do not use latest as the image tag.

Example:

    spec:
      containers:
      - name: nginx
-       image: nginx:latest
+       image: nginx:1.14.2
        livenessProbe:

anonymousUserRBACBinding

Checks the Role-based access control (RBAC) bindings in the cluster to identify the configurations that grant access permissions to anonymous users. If a configuration allows anonymous users to access cluster resources, malicious anonymous users may steal sensitive information about the cluster and attack or compromise the cluster.

Modify the RBAC bindings detected by the scan, and delete the permission configurations that allow anonymous users to access cluster resources based on your actual needs.

Example:

  - apiGroup: rbac.authorization.k8s.io
    kind: Group
    name: 'foo-group'
- - apiGroup: rbac.authorization.k8s.io
-   kind: User
-   name: 'system:anonymous'
- - apiGroup: rbac.authorization.k8s.io
-   kind: Group
-   name: 'system:unauthenticated'

Events

Event type

Event name

Example event message

Event description

Action

Normal

SecurityInspectorConfigAuditStart

Start to running config audit

The inspection task starts.

No action is required.

Normal

SecurityInspectorConfigAuditFinished

Finished running once config audit

The inspection task is complete.

No action is required.

Warning

SecurityInspectorConfigAuditHighRiskFound

2 high risks have been found after running config audit

After the inspection is complete, high-risk check items that are not remediated are found in some workload.

  1. On the Inspections page of the cluster, view the detailed inspection results.

  2. Use the Failed, All Namespaces, and Show All Workloads filter options to filter and view the workloads that have risks. Then, click Details to view the check result and remediation recommendation of each check item in the workload.

    • For a check item that you confirm does not need to be remediated, click Add to Whitelist to add the check item to the whitelist.

    • For a check item that you confirm needs to be remediated, remediate it based on the remediation recommendation.