diff --git a/ee/changelogs/unreleased/aling-dast-lf-with-other-parsers.yml b/ee/changelogs/unreleased/aling-dast-lf-with-other-parsers.yml new file mode 100644 index 0000000000000000000000000000000000000000..64cbf5f1dbaa3cc6ff6eb2f13ee3c6513b7ac4bc --- /dev/null +++ b/ee/changelogs/unreleased/aling-dast-lf-with-other-parsers.yml @@ -0,0 +1,5 @@ +--- +title: Improve DAST location fingerprints +merge_request: 10487 +author: +type: changed diff --git a/ee/lib/gitlab/ci/parsers/security/dast.rb b/ee/lib/gitlab/ci/parsers/security/dast.rb index 3d7e4dd27c45101b039ed67a602a13d059af105e..a71273e5f0ff635fa9b67285b84d73c10378b0a2 100644 --- a/ee/lib/gitlab/ci/parsers/security/dast.rb +++ b/ee/lib/gitlab/ci/parsers/security/dast.rb @@ -46,7 +46,7 @@ def flatten_vulnerabilities(vulnerability, host) end def generate_location_fingerprint(location) - Digest::SHA1.hexdigest("#{location['param']} #{location['method']} #{location['path']}") + Digest::SHA1.hexdigest("#{location['path']}:#{location['param']}:#{location['method']}") end end end diff --git a/ee/spec/lib/gitlab/ci/parsers/security/dast_spec.rb b/ee/spec/lib/gitlab/ci/parsers/security/dast_spec.rb index 0238ff28cb4da2eb4cfeb222eb84be41b238bf0f..319a0c861aaf6a450fcfa517d0ffa33e73e0455b 100644 --- a/ee/spec/lib/gitlab/ci/parsers/security/dast_spec.rb +++ b/ee/spec/lib/gitlab/ci/parsers/security/dast_spec.rb @@ -24,8 +24,8 @@ end it 'generates expected location fingerprint' do - expected1 = Digest::SHA1.hexdigest('X-Content-Type-Options GET ') - expected2 = Digest::SHA1.hexdigest('X-Content-Type-Options GET /') + expected1 = Digest::SHA1.hexdigest(':X-Content-Type-Options:GET') + expected2 = Digest::SHA1.hexdigest('/:X-Content-Type-Options:GET') expect(report.occurrences.first[:location_fingerprint]).to eq(expected1) expect(report.occurrences.last[:location_fingerprint]).to eq(expected2)