To start the scanner in lite SBOM mode in GitLab, when configuring image scanning in CI/CD process, edit the .gitlab-ci.yml configuration file as follows:
scan_image:
stage: scanner
image:
name:repo.cloud.example.com/repository/company/scanner:v.2.0.0-lite
entrypoint: [""]
pull_policy: always
k8s
In the example provided, the k8s
tag is specified for Kubernetes, you can also specify the tag for another supported orchestration platform.
SCAN_TARGET: ${CI_REGISTRY_IMAGE}:master
COMPANY_EXT_REGISTRY_USERNAME: ${COMPANY_EXT_REGISTRY_USERNAME}
COMPANY_EXT_REGISTRY_PASSWORD: ${COMPANY_EXT_REGISTRY_PASSWORD}
COMPANY_EXT_REGISTRY_TLS_CERT: ${COMPANY_EXT_REGISTRY_TLS_CERT}
BUILD_NUMBER: ${CI_JOB_ID}
BUILD_PIPELINE: ${CI_PIPELINE_ID}
API_TOKEN: <API token value>
HTTP_PROXY
– <proxy server for HTTP requests>
HTTPS_PROXY
– <proxy server for HTTPS requests>
NO_PROXY
– <domains or appropriate domain masks to be excluded from proxying>
The details of the certificate for secure connection to the image registry in the COMPANY_EXT_REGISTRY_TLS_CERT
variable are specified as a string in the .PEM format:
-----BEGIN CERTIFICATE-----\n...
certificate details
> ...\n-----END CERTIFICATE-----
.
API_CA_CERT: ${KCS_CA_CERT}
If the API_CA_CERT
variable is not set, scanning will start but will not be completed.
API_BASE_URL: <web address>
script:
- /bin/sh /entrypoint.sh $SCAN_TARGET --stdout > artifact-result.json
artifacts:
paths:
- artifact-result.json
script:
- /bin/sh /entrypoint.sh $SCAN_TARGET --html --stdout > artifact-result.html
artifacts:
paths:
- artifact-result.html
script:
- /bin/sh /entrypoint.sh $SCAN_TARGET --spdx --stdout > artifact-result.spdx
artifacts:
paths:
- artifact-result.spdx
script:
- /bin/sh /entrypoint.sh $SCAN_TARGET --cdx --stdout > artifact-result.cdx.json
artifacts:
paths:
- artifact-result.cdx.json