: Scan images in OpenShift integrated Docker registry
Focus
Focus

Scan images in OpenShift integrated Docker registry

Table of Contents

Scan images in 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 and make sure that the defender can access the OpenShift registry.
  • Install a Defender within in your OpenShift cluster.
  • 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.
  • Set up OpenShift credentials with basic authentication in Credentials store 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.
  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. Ensure that the defender is installed in the same cluster as the OpenShift registry.
  3. Make sure that you have installed the ca.cert file in any one of the following locations:

Recommended For You