2019-05-20 20:06:47 -04:00
# Read more about this feature here: https://docs.gitlab.com/ee/user/application_security/dast/
2019-03-07 22:39:35 -05:00
2021-05-25 11:10:33 -04:00
# Configure DAST 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/dast/#available-variables
2019-03-07 22:39:35 -05:00
stages :
- build
- test
- deploy
- dast
2020-01-16 07:08:32 -05:00
variables :
DAST_VERSION : 1
2020-05-11 14:09:55 -04:00
# Setting this variable will affect all Security templates
# (SAST, Dependency Scanning, ...)
SECURE_ANALYZERS_PREFIX : "registry.gitlab.com/gitlab-org/security-products/analyzers"
2020-01-16 07:08:32 -05:00
2019-03-07 22:39:35 -05: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
2019-04-06 12:02:04 -04:00
allow_failure : true
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 &&
$REVIEW_DISABLED && $DAST_WEBSITE == null &&
$DAST_API_SPECIFICATION == null
when : never
- if : $CI_COMMIT_BRANCH &&
2020-07-01 05:09:30 -04:00
$CI_KUBERNETES_ACTIVE &&
2020-05-12 14:07:54 -04:00
$GITLAB_FEATURES =~ /\bdast\b/
2020-07-01 05:09:30 -04:00
- if : $CI_COMMIT_BRANCH &&
$GITLAB_FEATURES =~ /\bdast\b/ &&
$DAST_WEBSITE
- if : $CI_COMMIT_BRANCH &&
$GITLAB_FEATURES =~ /\bdast\b/ &&
$DAST_API_SPECIFICATION