Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Cluster-Image-Scanning.gitlab-ci.yml « Security « templates « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f4f066cc7c2c4a65fa0502578539c19df312ad5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use this template to enable cluster image scanning in your project.
# You should add this template to an existing `.gitlab-ci.yml` file by using the `include:`
# keyword.
# The template should work without modifications but you can customize the template settings if
# needed: https://docs.gitlab.com/ee/user/application_security/cluster_image_scanning/#customize-the-container-scanning-settings
#
# Requirements:
# - A `test` stage to be present in the pipeline.
# - You must define the `CIS_KUBECONFIG` variable to allow analyzer to connect to your Kubernetes cluster and fetch found vulnerabilities.
#
# Configure container scanning with CI/CD variables (https://docs.gitlab.com/ee/ci/variables/README.html).
# List of available variables: https://docs.gitlab.com/ee/user/application_security/cluster_image_scanning/#available-variables

variables:
  CIS_ANALYZER_IMAGE: registry.gitlab.com/gitlab-org/security-products/analyzers/cluster-image-scanning:0

cluster_image_scanning:
  image: "$CIS_ANALYZER_IMAGE"
  stage: test
  allow_failure: true
  artifacts:
    reports:
      cluster_image_scanning: gl-cluster-image-scanning-report.json
    paths: [gl-cluster-image-scanning-report.json]
  dependencies: []
  script:
    - /analyzer run
  rules:
    - if: $CLUSTER_IMAGE_SCANNING_DISABLED
      when: never
    - if: '($KUBECONFIG == null || $KUBECONFIG == "") && ($CIS_KUBECONFIG == null || $CIS_KUBECONFIG == "")'
      when: never
    - if: $CI_COMMIT_BRANCH &&
          $GITLAB_FEATURES =~ /\bcluster_image_scanning\b/