Scan images in Docker Registry v2 (including Docker Hub)
Most vendors' registries comply with the Docker Registry version 2 API, including Docker Hub.
Create a new registry scan
For Docker Hub repositories:
- To specify an official Docker Hub repository, enter library/, followed by the short string used to designate the repo. For example, to scan the images in the official Alpine Linux repository, enter library/alpine.
- To specify non-official repositories, enter the user name or organization name, followed by a slash, followed by the name of the repo. For example, to specify the alpine repository in onescience’s account, enter onescience/alpine.
- To scan all repos from a user or organization, simply enter the user or organization name, followed by a wildcard (*). For example, to scan all repos created by onescience, enter onescience*.
Prerequisites:
You have installed a Defender somewhere in your environment.- Open Console, and then go toDefend > Vulnerabilities > Registry.
- ClickAdd registry.
- In the dialog, enter the following information:
- In theVersiondrop-down list, selectDocker Registry v2.
- Leave theRegistryfield blank. An empty field specifies Docker Hub (hub.docker.com).
- InRepository name, enter the name of the repo to scan. For example, enterlibrary/alpineto scan the official Alpine image. If the repo is part of an organization, use the organization/repository format. For example,bitnami/nginx.
- Optionally enter the Repositories to exclude them from being scanned.
- InTag, enter an image tag. Leave this field blank to scan all images, regardless of their tag.
- Optionally, enter Tags to exclude, to avoid scanning images with specified tags.
- InCredential, select the credentials to use.If you are scanning a public repository, leave this field blank.If you are scanning a private repository, and Console doesn’t have your credentials yet, clickAdd New. Select eitherBasic authenticationorCertificate-based authentication, and fill out the rest of the fields. For certificate-based authentication, provide a client certificate with private key, and an optional CA certificate.If there are no credentials in the list,Addnew credentials and select the Basic authentication.
- You can optionally enter a customCA certificatein PEM format for Prisma Cloud to validate the Docker registry v2.Custom CA certificate validation is supported only for non-Docker nodes (e.g. OpenShift).Ensure that the Custom CA certificate that you use is not revoked by the issuing authority.
- InOS type, specify whether the repo holdsLinuxorWindowsimages.
- InScanners scope, specify the collections of defenders to use for the scan.Console selects the available Defenders from the scope to execute the scan job according to theNumber of scannerssetting. For more information, see deployment patterns.
- InNumber of scanners, enter the number of Defenders across which scan jobs can be distributed.
- SetCapto the number of most recent images to scan. LeavingCapset to the default value of5will scan the most recent 5 images. Setting this field to0will scan all images.
- ClickAdd.
- Click theSavebutton.
Results
Verify that the images in the repository are being scanned.
- Go toMonitor > Vulnerabilities > Images > Registries.A progress indicator at the top right of the window shows the status of the current scan. As the scan of each image is completed, its findings are added to the results table.
- To get details about the vulnerabilities in an image, click on it.To force a specific repository to be scanned again, selectScanfrom the top right of the results table, then click on the specific registry to rescan.