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.
If you also want to use the inspection report feature, complete the RAM authorization for the specified
logprojectof Simple Log Service (SLS) (thelogprojectused by the logtail-ds add-on of the current cluster) so that the current RAM user has the permissions to read data from the specifiedlogprojectof SLS. Otherwise, inspection reports cannot be viewed because of insufficient permissions. For more information, see RAM custom policy examples. -
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
-
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 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.
-
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.
ImportantTo improve system stability and availability and to ensure business continuity and user experience, run inspections during off-peak hours.
-
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 |
Modify the Pod Spec and delete the Example:
|
|
hostIPCSet |
Checks whether the Pod Spec of workload specifies |
Modify the Pod Spec and delete the Example:
|
|
hostPIDSet |
Checks whether the Pod Spec of workload specifies |
Modify the Pod Spec and delete the Example:
|
|
hostPortSet |
Checks whether the Pod Spec of workload specifies |
Modify the Pod Spec and delete the Example:
|
|
runAsRootAllowed |
Checks whether the Pod Spec of workload does not specify |
Modify the Pod Spec and add Example:
|
|
runAsPrivileged |
Checks whether the Pod Spec of workload specifies |
Modify the Pod Spec and delete the Example:
|
|
privilegeEscalationAllowed |
Checks whether the Pod Spec of workload does not specify |
Modify the Pod Spec and add the Example:
|
|
capabilitiesAdded |
Checks the Pod Spec of workload for the |
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:
Add only the required Linux capabilities and delete all Linux capabilities that are not required. Example:
|
|
notReadOnlyRootFileSystem |
Checks whether the Pod Spec of workload does not specify |
Modify the Pod Spec and add Example:
If you need to modify files in a directory, you can use the Example:
|
|
cpuRequestsMissing |
Checks whether the Pod Spec of workload does not specify the |
Modify the Pod Spec and add the Example:
|
|
cpuLimitsMissing |
Checks whether the Pod Spec of workload does not specify the |
Modify the Pod Spec and add the Example:
|
|
memoryRequestsMissing |
Checks whether the Pod Spec of workload does not specify the |
Modify the Pod Spec and add the Example:
|
|
memoryLimitsMissing |
Checks whether the Pod Spec of workload does not specify the |
Modify the Pod Spec and add the Example:
|
|
readinessProbeMissing |
Checks whether the Pod Spec of workload does not specify the |
Modify the Pod Spec and add the Example:
|
|
livenessProbeMissing |
Checks whether the Pod Spec of workload does not specify |
Modify the Pod Spec and add the Example:
|
|
tagNotSpecified |
Checks the Pod Spec of workload to determine whether the value of the |
Modify the Pod Spec and modify the Example:
|
|
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:
|
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. |
|