Container Compute Service (ACS) provides an inspection feature for workload configurations. This feature helps you scan your clusters for workload configuration security risks. After you run an inspection task, ACS generates an inspection report. You can use the report to view and handle failed items in your cluster and monitor the real-time health status of your cluster.
Prerequisites
-
You have created an ACS cluster.
-
If you use a RAM user, complete the required RAM authorization and RBAC authorization.
-
RAM authorization
Complete the RAM authorization on the ACS inspection page to grant the current RAM user permissions to operate on the page for the current cluster. Otherwise, you cannot use the features on the page due to insufficient permissions. For more information, see Grant RAM permissions to a RAM user or RAM role.
If you also need to use the inspection report feature, complete the RAM authorization for the
logprojectthat is specified for Simple Log Service. Thislogprojectis the one used by the logtail-ds component of the current cluster. This ensures that the current RAM user has permissions to read data from thelogproject. Otherwise, you cannot view inspection reports due to insufficient permissions. For more information, see RAM Custom Authorization Examples. -
RBAC authorization
Complete the RBAC authorization for resources on the ACS inspection page. Grant the RAM user administrator permissions for a specified cluster to ensure that the RAM user has the permissions to manage the Kubernetes resources on the inspection page. For more information, see Configure RBAC authorization for a RAM user or RAM role.
-
Enable the cluster workload inspection feature
-
Log on to the ACS console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, choose Security > Inspections.
-
Optional: Install and update the inspection component.
If the inspection component is not installed, follow the on-screen prompts to install the security-inspector component. If the component is not up-to-date, follow the prompts to update it to the latest version. After the component is installed, you can also go to the Cluster Information page, select the Overview tab, and then click Security Inspection to open the Inspections page.
For more information about the security-inspector component and its change history, see security-inspector.
-
In the upper-right corner of the Inspections page, click Inspect. When the inspection finishes, go to the Inspections tab and click Details in the Actions column to view the results.
ImportantTo minimize the impact on cluster stability and availability, run inspections during off-peak hours.
-
Optional: In the upper-right corner of the Inspections page, click Configure Periodic Inspection to enable or disable automatic periodic inspections and configure the items to check.
Inspection details
The Inspections page displays detailed inspection results for different workloads in a tabular format and includes the following features:
-
Filter results by criteria such as Passed or Failed, Namespace, and Workload Type, and view the number of Number of Passed Items and Number of Failed Items for each workload.
-
View details for each inspection item, including the check status at the pod and container levels (passed or failed), a detailed description, and hardening recommendations. If a failed item does not require action, you can add it to the whitelist.
-
View the YAML file of a workload.
Inspection report
The inspection report shows the results of the most recent scan, including:
-
A scan overview, including the total number of items checked, the number and percentage of checked resources, and the overall health score.
-
Statistics by category, including results for health checks, images, networking, resources, and security.
-
Detailed scan results for each workload configuration, including resource type, resource name, namespace, check type, inspection item, and check result.
Inspection items
The configuration inspection feature scans for and displays the results for the following inspection items.
|
Inspection item |
Description |
Remediation |
|
hostNetworkSet |
Check the Pod Spec of the workload for the |
Modify the Pod Spec and delete the Example:
|
|
hostIPCSet |
Check if a workload shares the host's IPC namespace by inspecting its Pod Spec for the |
Modify the Pod Spec and remove the Example:
|
|
hostPIDSet |
Determine if the host's PID namespace is shared by checking if |
Modify the Pod Spec and remove the Example:
|
|
hostPortSet |
By checking the |
Modify the Pod Spec and remove the Example:
|
|
runAsRootAllowed |
Check if a container is allowed to run as the root user by verifying that |
Modify the Pod spec and add Example:
|
|
runAsPrivileged |
Check the Pod spec of the workload to determine if |
Modify the Pod Spec and delete the Example:
|
|
privilegeEscalationAllowed |
Check if |
Modify the Pod spec to add the Example:
|
|
capabilitiesAdded |
Check the |
Modify the pod spec to add only the necessary Linux capabilities and remove all others. If no extra Linux capabilities are needed, remove all unnecessary ones. Example:
Add only required Linux capabilities and remove all unnecessary ones. Example:
|
|
notReadOnlyRootFileSystem |
Check the Pod Spec of the workload to determine if |
Modify the Pod Spec and add Example:
If you need to modify files in a specific directory, you can use the Example:
|
|
cpuRequestsMissing |
You can check if the minimum required CPU resources for a container are specified by inspecting the |
Modify the Pod Spec and add the Example:
|
|
cpuLimitsMissing |
Check if the |
Modify the Pod Spec and add the Example:
|
|
memoryRequestsMissing |
Check if the |
Modify the Pod Spec and add the Example:
|
|
memoryLimitsMissing |
Check if the |
Modify the Pod Spec and add the Example:
|
|
readinessProbeMissing |
If the |
Modify the Pod Spec and add the Example:
|
|
livenessProbeMissing |
This check verifies whether a |
Modify the Pod Spec and add the Example:
|
|
tagNotSpecified |
Through checking if the value of the |
Modify the Example:
|
|
anonymousUserRBACBinding |
Checks the Role-based access control (RBAC) bindings in the cluster for configurations that grant access to anonymous users. If anonymous access to cluster resources is allowed, anonymous users could steal sensitive information or attack and compromise the cluster. |
Modify the identified RBAC bindings to remove permissions that allow anonymous users to access cluster resources. Example:
|
Events
|
Type |
Name |
Example message |
Description |
Actions |
|
Normal |
SecurityInspectorConfigAuditStart |
Starting config audit |
The inspection task starts. |
No action is required. |
|
Normal |
SecurityInspectorConfigAuditFinished |
Config audit finished |
The inspection task is complete. |
No action is required. |
|
Warning |
SecurityInspectorConfigAuditHighRiskFound |
Config audit found 2 high risks |
The inspection found unresolved high-risk items in one or more workloads. |
|