To scan images or repositories (in order to scan configuration files) used in the CI/CD process, add a stage to the CI/CD pipeline that runs the Kaspersky Container Security scanner. The scanning results are forwarded to the Kaspersky Container Security Server and are displayed in the Management console in the Resources → CI/CD section.
Data from listening to and intercepting network traffic must be securely transferred between the CI/CD environment and the product.
Example of configuring integration with GitLab CI/CD
This example uses a specific scanner image with the built-in vulnerability databases located in the image registry of the Kaspersky Container Security manufacturer.
To use the image scanning feature in the GitLab CI/CD process, you should enable the use of the GitLab Container Registry.
Integration configuration includes the following steps:
printf "login:password" | openssl base64 -A
where login and password are the user name and password of an account in the image registry of the Kaspersky Container Security manufacturer.
{
"auths": {
"repo.cloud.tronsec.ru": {
"auth": "base64hash"
}
}
}
where base64hash is the string obtained in step 1a.
printf "login:password" | openssl base64 -A
where login and password are the user name and password of an account in the image registry of the Kaspersky Container Security manufacturer.
To add scanning to the CI/CD pipeline, you should add the following lines to the .gitlab-ci.yml file:
scan_image:
stage: scanner
image:
name: repo.cloud.tronsec.ru/repository/tron-customer/scanner:v1.0.1-with-db
entrypoint: [""]
variables:
SCAN_TARGET: ${CI_REGISTRY_IMAGE}:master
API_TOKEN: base64hash
The example below contains the master
tag, you can also specify another tag.
TRON_EXT_REGISTRY_USERNAME: ${TRON_EXT_REGISTRY_USERNAME}
TRON_EXT_REGISTRY_PASSWORD: ${TRON_EXT_REGISTRY_PASSWORD}
API_BASE_URL: <domain name>
script:
- /bin/sh /entrypoint.sh $SCAN_TARGET --stdout > artifact-result.json
artifacts:
paths:
- artifact-result.json