2021-06-28 02:07:45 -04:00
# 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-06-16 14:10:35 -04:00
# 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-06-28 02:07:45 -04:00
#
2019-05-20 20:06:47 -04:00
# Read more about this feature here: https://docs.gitlab.com/ee/user/application_security/dast/
2021-06-28 02:07:45 -04:00
#
2021-06-28 11:08:03 -04:00
# Configure DAST with CI/CD variables (https://docs.gitlab.com/ee/ci/variables/index.html).
2021-05-25 11:10:33 -04:00
# List of available variables: https://docs.gitlab.com/ee/user/application_security/dast/#available-variables
2019-03-07 22:39:35 -05:00
2020-01-16 07:08:32 -05:00
variables :
2021-06-15 02:10:17 -04:00
DAST_VERSION : 2
2020-05-11 14:09:55 -04:00
# Setting this variable will affect all Security templates
# (SAST, Dependency Scanning, ...)
2022-02-07 22:14:00 -05:00
SECURE_ANALYZERS_PREFIX : "registry.gitlab.com/security-products"
2020-01-16 07:08:32 -05:00
2021-09-23 02:12:14 -04:00
dast :
2019-04-06 12:02:04 -04:00
stage : dast
2019-05-20 20:06:47 -04:00
image :
2020-05-11 14:09:55 -04:00
name : "$SECURE_ANALYZERS_PREFIX/dast:$DAST_VERSION"
2019-04-06 12:02:04 -04:00
variables :
2020-02-21 01:08:58 -05:00
GIT_STRATEGY : none
2021-09-23 02:12:14 -04:00
allow_failure : true
2019-04-06 12:02:04 -04:00
script :
- export DAST_WEBSITE=${DAST_WEBSITE:-$(cat environment_url.txt)}
2020-04-14 17:09:52 -04:00
- 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
2020-04-06 08:10:44 -04:00
- /analyze
2019-04-06 12:02:04 -04:00
artifacts :
reports :
dast : gl-dast-report.json
2020-05-12 14:07:54 -04:00
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-06-23 08:07:58 -04:00
$REVIEW_DISABLED
2020-05-12 14:07:54 -04:00
when : never
- if : $CI_COMMIT_BRANCH &&
2021-11-17 22:14:17 -05:00
($CI_KUBERNETES_ACTIVE || $KUBECONFIG) &&
2020-05-12 14:07:54 -04:00
$GITLAB_FEATURES =~ /\bdast\b/
2020-07-01 05:09:30 -04:00
- if : $CI_COMMIT_BRANCH &&
2021-06-23 08:07:58 -04:00
$GITLAB_FEATURES =~ /\bdast\b/