13.4. Accessing delegated image scanning
You can have isolated container image registries that are only accessible from your secured clusters. The delegated image scanning feature enables you to scan images from any registry in your secured clusters.
Currently, by default, Central Services Scanner performs both indexing (identification of components) and vulnerability matching (enrichment of components with vulnerability data) for images observed in your secured clusters, with the exception of images from the OpenShift Container Platform integrated registry.
For images from the OpenShift Container Platform integrated registry, Scanner-slim installed in your secured cluster performs the indexing, and the Central Services Scanner performs the vulnerability matching.
The delegated image scanning feature extends scanning functionality by allowing Scanner-slim to index images from any registry and then send them to Central for vulnerability matching. To use this feature, ensure that Scanner-slim is installed in your secured clusters. If Scanner-slim is not present, scan requests are sent directly to Central.
13.4.2. Scanning images by using secured clusters 复制链接链接已复制到粘贴板!
To scan images by using the secured clusters instead of the Central services, you can use the delegated image scanning feature.
A new delegated scanning configuration specifies the registries from which you can delegate image scans. For images that Sensor observes, you can use the delegated registry configuration to delegate scans from no registries, all registries, or specific registries.
To enable delegation of scans by using the roxctl CLI, Jenkins plugin, or API, you must also specify a destination cluster and source registry.
Prerequisites
You have installed Scanner in the secured cluster to scan images.
注意Enabling Scanner is supported on OpenShift Container Platform and Kubernetes secured clusters.
Procedure
-
In the RHACS portal, click Platform Configuration
Clusters. - In the Clusters view header, click Delegated scanning.
In the Delegated Image Scanning page, provide the following information:
Delegate scanning for: To choose the scope of the image delegation, select one of the following options:
- None: The default option. This option specifies that the secured clusters do not scan any images, except for images from the integrated OpenShift image registry.
- All registries: This option indicates that the secured clusters scan all the images.
- Specified registries: This option specifies the images that secured clusters should scan based on the registries list.
-
Select default cluster to delegate to: From the drop-down list, select the name of the default cluster. The default cluster processes the scan requests coming from the command-line interface (CLI) and API. This is optional and you can select
Noneif required. Optional: To specify the source registry and destination cluster details, click Add registry.
For example, specify the source registry as
example.com, and selectremotefrom the drop-down list for the destination cluster. You can add more than one source registry and destination cluster if required.重要You can select the destination cluster as
Noneif the scan requests are not coming from the CLI and API.
- Click Save.
Image integrations are now synchronized between Central and Sensor, and Sensor captures pull secrets from each namespace. Sensor then uses these credentials to authenticate to the image registries.
13.4.3.1. Using the Operator 复制链接链接已复制到粘贴板!
RHACS Operator installs a Scanner-slim version on each secured cluster to scan images in the OpenShift Container Platform integrated registry and optionally other registries.
For more information, see Installing RHACS on secured clusters by using the Operator.
13.4.3.2. Using Helm 复制链接链接已复制到粘贴板!
Secured Cluster Services Helm chart (secured-cluster-services) installs a Scanner-slim version on each secured cluster. In Kubernetes, the secured cluster services include Scanner-slim. On OpenShift Container Platform, however, RHACS installs a Scanner-slim version on each secured cluster to scan images in the OpenShift Container Platform integrated registry and optionally other registries.
- For OpenShift Container Platform installations, see Installing the secured-cluster-services Helm chart without customization.
- For non-OpenShift Container Platform installations, such as Amazon Elastic Kubernetes Service (Amazon EKS), Google Kubernetes Engine (Google GKE), and Microsoft Azure Kubernetes Service (Microsoft AKS), see Installing the secured-cluster-services Helm chart without customization.
13.4.3.3. Verifying after installation 复制链接链接已复制到粘贴板!
Procedure
Verify that the status of the secured cluster indicates that Scanner is present and healthy:
-
In the RHACS portal, go to Platform Configuration
Clusters. - In the Clusters view, select a cluster to view its details.
- In the Health Status card, ensure that Scanner is present and is marked as Healthy.
-
In the RHACS portal, go to Platform Configuration
13.4.3.4. Using image scanning 复制链接链接已复制到粘贴板!
You can scan images stored in a cluster specific OpenShift Container Platform integrated image registry by using roxctl CLI, Jenkins, and API. You can specify the appropriate cluster in the delegated scanning configuration or use the cluster parameter available in roxctl CLI, Jenkins, and API.
For more information about how to scan images by using the roxctl CLI, see Image scanning by using the roxctl CLI.