Multiple DAST aggregated vulnerability scans drop URL evidence
Summary
When running multiple DAST scans with aggregated vulnerabilities turned on within a single pipeline, only the URLs scanned in the first DAST scan are displayed in the vulnerability issue in the security dashboard. Other scanned URLs are silently dropped.
Steps to reproduce
This short youtube video fully explains the below steps.
- Create a new blank project
- Add the following
.gitlab-ci.yml
file
include:
- template: DAST.gitlab-ci.yml
variables:
DAST_WEBSITE: https://google-gruyere.appspot.com/564959828417281418006207909483102970029/
dast:
variables:
DAST_PATHS: "https://google-gruyere.appspot.com/2,https://google-gruyere.appspot.com/3,https://google-gruyere.appspot.com/4"
script:
- export DAST_WEBSITE=${DAST_WEBSITE:-$(cat environment_url.txt)}
- 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 --ff-aggregate-vulnerabilities true
dast2:
extends: dast
variables:
DAST_PATHS: "https://google-gruyere.appspot.com,https://google-gruyere.appspot.com/0,https://google-gruyere.appspot.com/1"
- Commit and merge into the default branch
- When the pipeline is complete navigate to
Security & Compliance
and selectVulnerability Report
- A single vulnerability will be displayed. Navigate to that vulnerability.
- In the
Evidence
section, the URLs listed arehttps://google-gruyere.appspot.com/2,https://google-gruyere.appspot.com/2,https://google-gruyere.appspot.com/4
.https://google-gruyere.appspot.com,https://google-gruyere.appspot.com/1,https://google-gruyere.appspot.com/0
have been lost.
Example Project
What is the current bug behavior?
What is the expected correct behavior?
It is expected that all the URLs:
- https://google-gruyere.appspot.com
- https://google-gruyere.appspot.com/0
- https://google-gruyere.appspot.com/1
- https://google-gruyere.appspot.com/2
- https://google-gruyere.appspot.com/3
- https://google-gruyere.appspot.com/4
are be listed.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Edited by Jonathan Schafer