2021-06-02 11:09:59 -04:00
|
|
|
# Read more about this feature here: https://docs.gitlab.com/ee/user/application_security/secret_detection
|
|
|
|
#
|
2021-06-09 05:10:18 -04:00
|
|
|
# Configure the scanning tool through the environment variables.
|
|
|
|
# List of the variables: https://docs.gitlab.com/ee/user/application_security/secret_detection/#available-variables
|
|
|
|
# How to set: https://docs.gitlab.com/ee/ci/yaml/#variables
|
2021-06-02 11:09:59 -04:00
|
|
|
|
|
|
|
variables:
|
2022-08-10 20:09:45 -04:00
|
|
|
SECURE_ANALYZERS_PREFIX: "$CI_TEMPLATE_REGISTRY_HOST/security-products"
|
2022-04-15 14:09:57 -04:00
|
|
|
SECRET_DETECTION_IMAGE_SUFFIX: ""
|
|
|
|
|
2022-05-17 05:08:20 -04:00
|
|
|
SECRETS_ANALYZER_VERSION: "4"
|
2021-06-02 11:09:59 -04:00
|
|
|
SECRET_DETECTION_EXCLUDED_PATHS: ""
|
|
|
|
|
|
|
|
.secret-analyzer:
|
|
|
|
stage: test
|
2022-04-15 14:09:57 -04:00
|
|
|
image: "$SECURE_ANALYZERS_PREFIX/secrets:$SECRETS_ANALYZER_VERSION$SECRET_DETECTION_IMAGE_SUFFIX"
|
2021-06-02 11:09:59 -04:00
|
|
|
services: []
|
|
|
|
allow_failure: true
|
2022-01-17 10:16:12 -05:00
|
|
|
variables:
|
|
|
|
GIT_DEPTH: "50"
|
2021-06-02 11:09:59 -04:00
|
|
|
# `rules` must be overridden explicitly by each child job
|
|
|
|
# see https://gitlab.com/gitlab-org/gitlab/-/issues/218444
|
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
secret_detection: gl-secret-detection-report.json
|
|
|
|
|
|
|
|
secret_detection:
|
|
|
|
extends: .secret-analyzer
|
|
|
|
rules:
|
|
|
|
- if: $SECRET_DETECTION_DISABLED
|
|
|
|
when: never
|
2021-06-09 05:10:18 -04:00
|
|
|
- if: $CI_COMMIT_BRANCH
|
2021-06-02 11:09:59 -04:00
|
|
|
script:
|
|
|
|
- /analyzer run
|