debian-mirror-gitlab/lib/gitlab/ci/templates/Security/Container-Scanning.gitlab-ci.yml

41 lines
1.7 KiB
YAML
Raw Normal View History

2019-12-04 20:38:33 +05:30
# Read more about this feature here: https://docs.gitlab.com/ee/user/application_security/container_scanning/
2019-07-07 11:18:12 +05:30
2019-12-21 20:55:43 +05:30
variables:
2020-01-01 13:55:28 +05:30
CS_MAJOR_VERSION: 2
2019-12-21 20:55:43 +05:30
2019-07-07 11:18:12 +05:30
container_scanning:
stage: test
2019-12-04 20:38:33 +05:30
image:
2019-12-21 20:55:43 +05:30
name: registry.gitlab.com/gitlab-org/security-products/analyzers/klar:$CS_MAJOR_VERSION
2019-12-04 20:38:33 +05:30
entrypoint: []
2019-07-07 11:18:12 +05:30
variables:
2019-12-26 22:10:19 +05:30
# By default, use the latest clair vulnerabilities database, however, allow it to be overridden here with a specific image
# to enable container scanning to run offline, or to provide a consistent list of vulnerabilities for integration testing purposes
CLAIR_DB_IMAGE_TAG: "latest"
CLAIR_DB_IMAGE: "arminc/clair-db:$CLAIR_DB_IMAGE_TAG"
# Override the GIT_STRATEGY variable in your `.gitlab-ci.yml` file and set it to `fetch` if you want to provide a `clair-whitelist.yml`
# file. See https://docs.gitlab.com/ee/user/application_security/container_scanning/index.html#overriding-the-container-scanning-template
2019-12-04 20:38:33 +05:30
# for details
2019-07-07 11:18:12 +05:30
GIT_STRATEGY: none
allow_failure: true
services:
2019-12-26 22:10:19 +05:30
- name: $CLAIR_DB_IMAGE
2019-12-04 20:38:33 +05:30
alias: clair-vulnerabilities-db
2019-07-07 11:18:12 +05:30
script:
2019-12-04 20:38:33 +05:30
# the kubernetes executor currently ignores the Docker image entrypoint value, so the start.sh script must
# be explicitly executed here in order for this to work with both the kubernetes and docker executors
# see this issue for more details https://gitlab.com/gitlab-org/gitlab-runner/issues/4125
- /container-scanner/start.sh
2019-07-07 11:18:12 +05:30
artifacts:
reports:
container_scanning: gl-container-scanning-report.json
dependencies: []
only:
refs:
- branches
variables:
- $GITLAB_FEATURES =~ /\bcontainer_scanning\b/
except:
variables:
- $CONTAINER_SCANNING_DISABLED