debian-mirror-gitlab/lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml

58 lines
2 KiB
YAML
Raw Normal View History

2021-09-30 23:02:18 +05:30
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml
2021-09-04 01:27:46 +05:30
# To use this template, add the following to your .gitlab-ci.yml file:
#
# include:
# template: DAST.gitlab-ci.yml
#
# You also need to add a `dast` stage to your `stages:` configuration. A sample configuration for DAST:
#
# stages:
# - build
# - test
# - deploy
# - dast
2021-09-30 23:02:18 +05:30
#
2021-09-04 01:27:46 +05:30
# Read more about this feature here: https://docs.gitlab.com/ee/user/application_security/dast/
2021-09-30 23:02:18 +05:30
#
# Configure DAST with CI/CD variables (https://docs.gitlab.com/ee/ci/variables/index.html).
2021-09-04 01:27:46 +05:30
# List of available variables: https://docs.gitlab.com/ee/user/application_security/dast/#available-variables
2019-07-07 11:18:12 +05:30
2020-03-13 15:44:24 +05:30
variables:
2021-09-04 01:27:46 +05:30
DAST_VERSION: 2
2020-05-24 23:13:21 +05:30
# Setting this variable will affect all Security templates
# (SAST, Dependency Scanning, ...)
2022-05-07 20:08:51 +05:30
SECURE_ANALYZERS_PREFIX: "registry.gitlab.com/security-products"
2020-03-13 15:44:24 +05:30
2019-07-07 11:18:12 +05:30
dast:
stage: dast
2019-09-04 21:01:54 +05:30
image:
2020-05-24 23:13:21 +05:30
name: "$SECURE_ANALYZERS_PREFIX/dast:$DAST_VERSION"
2019-07-07 11:18:12 +05:30
variables:
2020-04-08 14:13:33 +05:30
GIT_STRATEGY: none
2019-07-07 11:18:12 +05:30
allow_failure: true
script:
- export DAST_WEBSITE=${DAST_WEBSITE:-$(cat environment_url.txt)}
2020-04-22 19:07:51 +05:30
- if [ -z "$DAST_WEBSITE$DAST_API_SPECIFICATION" ]; then echo "Either DAST_WEBSITE or DAST_API_SPECIFICATION must be set. See https://docs.gitlab.com/ee/user/application_security/dast/#configuration for more details." && exit 1; fi
- /analyze
2019-07-07 11:18:12 +05:30
artifacts:
reports:
dast: gl-dast-report.json
2020-05-24 23:13:21 +05:30
rules:
- if: $DAST_DISABLED
when: never
- if: $DAST_DISABLED_FOR_DEFAULT_BRANCH &&
$CI_DEFAULT_BRANCH == $CI_COMMIT_REF_NAME
when: never
- if: $CI_DEFAULT_BRANCH != $CI_COMMIT_REF_NAME &&
2021-09-30 23:02:18 +05:30
$REVIEW_DISABLED
2020-05-24 23:13:21 +05:30
when: never
- if: $CI_COMMIT_BRANCH &&
2021-12-11 22:18:48 +05:30
($CI_KUBERNETES_ACTIVE || $KUBECONFIG) &&
2020-05-24 23:13:21 +05:30
$GITLAB_FEATURES =~ /\bdast\b/
2020-07-28 23:09:34 +05:30
- if: $CI_COMMIT_BRANCH &&
2021-09-30 23:02:18 +05:30
$GITLAB_FEATURES =~ /\bdast\b/