Kaspersky Container Security

Setting up integration with external image registries

Kaspersky Container Security can scan images from the following external image registries:

  • Harbor
  • GitLab Registry
  • JFrog Artifactory
  • Sonatype Nexus Repository OSS
  • Yandex Registry
  • Docker Hub
  • Docker Registry

You should integrate Kaspersky Container Security with external registries containing images to be scanned. Images from registries integrated with Kaspersky Container Security can be scanned automatically or manually, depending on the configured image pulling and scanning settings for each registry.

In this Help section

Minimum sufficient rights for integration with registries

Working with public registries without authorization

Viewing information about integrations with registries

Adding integrations with external image registries

Deleting integration with external registry

Page top
[Topic 259061]

Minimum sufficient rights for integration with registries

To integrate with external image registries, a Kaspersky Container Security account must have a certain set of rights, which differs depending on the registry type. The list of the minimum account rights required for integration is given below for each registry type.

GitLab

To integrate the solution with a GitLab user's registry, you should define the parameter values as follows:

  • User role in the project or group: Reporter.
  • Level of access to the project: Reporter.
  • Rights assigned to the user token: read_api, read_registry.

JFrog

To integrate the solution with a JFrog user's registry, you need to define the parameter values as follows:

  • User role in the project or group: Manage Reports.
  • Project access: Can Update Profile.
  • User rights: the right to read any repository (ANY repository).

Harbor

To integrate the solution with a Harbor user's registry, you should define the parameter values as follows:

  • Member type: user. To do this, specify User in the Member Type column of the table in the ProjectsMembers section.
  • User role in the project or group: user with limited rights. To do this, you must specify Limited Guest in the Role column of the table in the ProjectsMembers section.
  • User rights: user without administrator rights. To do this, in the Administrator column of the table in the Users section, select No.

Nexus

To integrate the solution with a Nexus user's registry, you should define the parameter values as follows:

  • User role in the project or group: user.
  • Rights assigned to the user role in the project or group: nx-apikey-all, nx-repository-view-docker-*-browse, nx-repository-view-docker-*-read.

Docker Hub

The solution integrates with a Docker Hub user's registry after authorization using the user name and password.

This Docker Hub registry integration option only applies to a personal namespace.

Page top

[Topic 265977]

Working with public registries without authorization

Kaspersky Container Security 1.1 does not work with public registries without authorization. For example, you cannot use the solution to scan images when Docker Hub is accessed anonymously.

If you do not authorize in public registries, you can use such image registries in a cluster, add them to Kaspersky Container Security and manually assign them to a specific scope. If the scope includes only one or several public registries for which you are not authorized, and you try to add an image in the ResourcesAssetsRegistries section, the solution displays an error indicating that it is impossible to add images as the solution is not integrated with image registries.

Page top
[Topic 267912]

Viewing information about integrations with registries

You can view a list of all registries integrated with Kaspersky Container Security in the AdministrationIntegrations → Image registries section.

You can use the list to do the following:

Page top
[Topic 250403]

Adding integrations with external image registries

Integrated registries support only local image repositories that directly contain the images. In version 1.1, Kaspersky Container Security does not support working with remote or virtual repositories.

To add an integration with an external registry:

  1. In the AdministrationIntegrationsImage registries section, click the Add registry button.

    The integration settings window opens.

  2. On the Registry settings tab, specify the settings for connection to the registry:
    1. Enter the name of the registry.
    2. If required, enter a description of the registry.
    3. Select the registry type from the drop-down list.
    4. If you set up JFrog Artifactory registry integration, to access Docker, in the Repository Path method drop-down list, select one of the following methods:
      • Repository path.
      • Subdomain.
      • Port.
    5. If you set up a JFrog Artifactory, Harbor, or Sonatype Nexus Repository OSS registry integration, enter the full web address of the registry. We recommend that you use HTTPS connection (HTTP connection is also supported).

      If you use HTTP or HTTPS with a self-signed or invalid certificate, you should check the insecure-registry box for the Docker engine on the nodes where the server and scanner are installed.

    6. If you set up a Gitlab Registry registry integration, provide the full web addresses (URLs) of the registry and registry API.
    7. If you set up a registry integration for Docker Hub or JFrog Artifactory, choose an authentication method: with an account or API key. For Sonatype Nexus Repository OSS registries, you can only use authentication with an account.
    8. Specify the data required for authentication.
  3. Go to the Image scan details tab and specify the scan timeout for scanning images from this registry (in minutes).

    If image scanning lasts longer than the specified time, the scanning stops and the image is returned to the scanning queue. The solution will requeue the image up to 3 times. This means that the time required to scan an image from the registry may be tripled.

  4. Configure the image pull and scan settings for the registry. By default, the Manual option is selected in Pull and scan images: images are not automatically pulled from the registry, but the user can manually add images to the list of images for scanning. New images are automatically queued for scanning.

    If you want images to be pulled from the registry and queued for scanning automatically, select Automatic in Pull and scan images and configure the settings for image pulling and scanning. The following options are available:

    • Scan timeout—a block of settings that determine the frequency at which images are pulled from the registry for scanning. The time is specified in accordance with the time of the node on which the Kaspersky Container Security Server is deployed.
    • Rescan images—if you check this box, images that were previously pulled from the registry are rescanned each time new images are scanned.
    • Name/tag criteria—you can use name criterion and/or image tag pattern to specify which images to pull and scan. If you check the box, Kaspersky Container Security will only pull those images that match the specified patterns for scanning.

      You can use criteria in the following patterns:

      • by image name and tag – <name><:tag>
      • by image name only – <name>
      • by image tag only – <:tag>

      For example:

      • for the alpine pattern, all images with the name "alpine" are pulled, regardless of the tag;
      • for the 4 pattern, all images with tag 4 are pulled, regardless of the image name;
      • for the alpine:4 pattern, all images with the name "alpine" and tag 4 are pulled.

      When generating criteria, you can use the * character, which replaces any number of characters.

      To add a criterion, enter it in the field and click the Add button. You can add one or more criteria.

    • Additional conditions for image pulling.
      • If no additional conditions are required, select No additional conditions.
      • Images created within – select this option if you want to only pull images created within a specific period (for a specified number of days, months, or years). Specify the duration of the period and the unit of measurement in the fields on the right. By default, the period is 60 days long.
      • Latest - select this option if you want to only pull images with the latest tags (from the date of the image creation). In the field on the right, specify the number of latest tags to consider.
    • Never pull images with the name/tag pattern - using image name/tag patterns you can specify, which images are excluded from pulling and scanning.
    • Always pull images with the name/tag pattern—using image name/tag patterns you can specify, which images are always pulled and scanned, regardless of other conditions set above.
  5. Click the Save button in the top of the window to save the registry integration settings.
Page top
[Topic 266472]

Deleting integration with external registry

To delete an integration with an external registry:

  1. In the AdministrationIntegrationsImage registries section, select the integration you want to delete by selecting the check box in the row with the registry name. You can select one or more integrations.
  2. In the line containing the name of the integration with the image registry that you want to delete, click the delete icon ("Delete" icon.).
  3. In the window that opens, confirm the action.

Kaspersky Container Security does not scan images from a registry it is no longer integrated with.

Page top
[Topic 250405]