Commit 6be45816 authored by Nikola Milojevic's avatar Nikola Milojevic

Merge branch 'track-label-and-property-with-scan-event' into 'master'

Add more properties to the Secure scan snowplow tracking event

See merge request gitlab-org/gitlab!66303
parents fed6566c 09594af4
......@@ -29,7 +29,9 @@ module Security
context: [context],
idempotency_key: Digest::SHA256.hexdigest(idempotency_key),
user: build.user_id,
project: build.project_id)
project: build.project_id,
label: analyzer_id(report),
property: scan_type(report, report_type))
end
def data_to_track(report_type, report)
......@@ -38,7 +40,7 @@ module Security
primary_scanner = report&.primary_scanner
{
analyzer: analyzer&.id,
analyzer: analyzer_id(report),
analyzer_vendor: analyzer&.vendor,
analyzer_version: analyzer&.version,
end_time: scan&.end_time,
......@@ -55,5 +57,9 @@ module Security
def scan_type(report, report_type)
report&.scan&.type || report_type
end
def analyzer_id(report)
report&.analyzer&.id
end
end
end
......@@ -43,7 +43,9 @@ RSpec.describe Security::TrackScanService do
}],
idempotency_key: '82fc6391e4be61e03e51fa8c5c6bfc32b3d3f0065ad2fe0a01211606952b8d82',
user: user.id,
project: project.id)
project: project.id,
label: 'gitlab-dast',
property: 'dast')
end
end
......@@ -78,7 +80,9 @@ RSpec.describe Security::TrackScanService do
}],
idempotency_key: '62bc6c62686b327dbf420f8891e1418406b60f49e574b6ff22f4d6a272dbc595',
user: user.id,
project: project.id)
project: project.id,
label: nil,
property: 'dast')
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment