This topic describes how to integrate Azure with the Unified Agent in order to scan Docker Images.
An authorized account to Azure Container Registry
Permissions for image pulling from Azure Container Registry
Unified Agent will scan the images on your localhost (after they are pulled from Azure Container Registry).
Unified Agent requires downloading a JAR file and a configuration file. You can download them manually or by using the steps described below.
Downloading the Unified Agent & Configuration File
It is advised to use the below commands only once a week to download the latest version of the Unified Agent for performance reasons and not as part of every build. You can do this using a scheduler task, such as cron.
Use the following options to download the latest version of the WhiteSource Unified Agent JAR file and configuration file to your local host.
Windows Using CURL
Download CURL, and add it to your PATH environment variable.
Update the configuration file (whitesource-fs-agent.config) that you downloaded in step 2 according to your specific requirements. Enable the relevant lines by removing the '#' symbol at the beginning of the lines. You can find a description about each line and its meaning here. Example of values for uncommented lines:
This configuration sets the Unified Agent to scan all the docker repositories named *alpine.* except for the two image tags in the 'exclude' section. Alternatively, you can leave the docker.excludes parameter commented if you want to scan all your image containers.
Enables pulling Docker Images from Azure Container registry.
Note: Verify that the 'docker.scanImages' and 'docker.pull.enable' parameter values are also set to 'true'
Username for Azure Container registry
Password for Azure Container registry
Yes. Not mandatory if you already logged in manually to your Azure account via the Azure Client CLI.
Docker repository names in Azure Container registry separated by a space
Authentication Type for Azure Container registry. Either “containerRegistry” or "userAccount".
Scanning Information The scanner saves your required images and scans the file system and installed packages. It scans all the image layers and handles archive files in the layers based on the value in the property 'archiveExtractionDepth'. The Docker image is saved to the temporary directory defined in your environment and is deleted immediately after the scan. The scanning results are presented in a new WhiteSource project identified by the name of the image in the following format: <image id> <repository> <tag>. The project is created in the WhiteSource product specified in the configuration file or command line.