> For the complete documentation index, see [llms.txt](https://docs.prismacloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prismacloud.io/admin-guide/32/vulnerability-management/registry-scanning/scan-openshift.md).

# OpenShift integrated Docker registry

To scan an OpenShift integrated registry, create a new registry scan setting.

## Create a new registry scan

**Prerequisites:**

* [Install a Defender](/admin-guide/32/install/deploy-defender/defender-types.md) and make sure that the defender can access the OpenShift registry.
* Use the `twistlock-service` service account to authenticate to the internal registry. The Defender authenticates to the OpenShift registry using this service account.
  * Add the cluster role permission of registry-viewer to the `twistlock-service` account.

    ```
    oc adm policy add-cluster-role-to-user registry-viewer system:serviceaccount:<twistlock_project>:twistlock-service
    ```
  * Obtain the password for the twistlock-service account.
    * To get the secret used by the service account run the command - `oc describe sa twistlock-service -n <twistlock_project>`.
    * Use the **Image pull secrets** value (`twistlock-service-dockercfg-64jtt`) in the following command, for example:

      ```
      oc get secret twistlock-service-dockercfg-64jtt -n twistlock --output=json|grep openshift.io/token-secret.value
      ```
    * Copy the openshift.io/token-secret.value to be used later in the workflow.
    * If you use the OpenShift UI to obtain the token, select **view-all** to see the full token.
* Place the CA certificate (`ca.cert`) file in any of the following paths. As soon as the certificate is found in a path, the search stops and doesn’t go the next path.

  `/etc/docker/certs.d/<registry-URL>/`

  `/etc/containers/certs.d/<registry-URL>/`

  `/etc/containerd/certs.d/<registry-URL>/`
* Set up OpenShift credentials with basic authentication in [Credentials store](https://github.com/PaloAltoNetworks/pc-docs-md/tree/main/compute-edition/32/admin-guide/authentication/credentials-store/credentials-store.md) and grant Prisma Cloud access to your repository in OpenShift.

1. Open Console, then go to **Defend > Vulnerabilities > Images > Registry settings**.
2. Select **Add registry**.
3. In **Version**, select **Red Hat OpenShift**.
4. In **Registry**, enter the registry address.

   The internal address to access the OpenShift registry is `image-registry.openshift-image-registry.svc:5000`.
5. In **Repository** , specify the repository to scan.

   If you leave this field blank or enter a wildcard, Prisma Cloud finds and scans all repositories in the registry.

   If you specify a partial string that ends with a wildcard, Prisma Cloud finds and scans all repositories that start with the partial string.

   If you specify an exact match, Prisma Cloud scans just the specified repository.
6. Enter **Tag** numbers to scan, leave blank, or enter a wildcard (\*) to scan all the tags.
7. Optionally, enter **Tags to exclude**, to avoid scanning images with specified tags.
8. In **Credential**, select OpenShift credentials that you created in the prerequisites section.

   In **Password**, enter your service account token.
9. In **OS type**, specify whether the repo holds **Linux** or **Windows** images.
10. In **Scanners 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 the **Number of scanners** setting. For more information, see [deployment patterns](/admin-guide/32/vulnerability-management/registry-scanning/configure-registry-scanning.md#deployment-patterns).
11. In **Number of scanners**, enter the number of Defenders across which scan jobs can be distributed.
12. Set **Cap** to the number of most recent images to scan. Leaving **Cap** set to **5** will scan the 5 most recent images. Setting this field to **0** will scan all images.
13. Select **Add and scan**. Verify that the images in the repository are being scanned under **Monitor > Vulnerabilities > Images > Registries**.

## Troubleshooting

### x509: certificate signed by unknown authority

1. Check if the defender can access the OpenShift registry.
2. Make sure that you have installed the `ca.cert` file in any one of the following locations:

   `/etc/docker/certs.d/<registry-URL>/`

   `/etc/containers/certs.d/<registry-URL>/`

   `/etc/containerd/certs.d/<registry-URL>/`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.prismacloud.io/admin-guide/32/vulnerability-management/registry-scanning/scan-openshift.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
