From 07e7f319a0af2061e93ae6c5982025690171bd50 Mon Sep 17 00:00:00 2001 From: Or Zinger <94623525+orz25@users.noreply.github.com> Date: Sun, 28 Jan 2024 17:03:38 +0200 Subject: [PATCH] Add multi_scan_id to scan params for sca scan flow (#891) --- xray/services/scan.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xray/services/scan.go b/xray/services/scan.go index 002728554..18f49dc6b 100644 --- a/xray/services/scan.go +++ b/xray/services/scan.go @@ -46,6 +46,8 @@ const ( XscGraphAPI = "api/v1/sca/scan/graph" + multiScanIdParam = "multi_scan_id=" + scanTechQueryParam = "tech=" XscVersionAPI = "api/v1/system/version" @@ -83,6 +85,7 @@ func createScanGraphQueryParams(scanParams XrayGraphScanParams) string { } if scanParams.XscVersion != "" { + params = append(params, multiScanIdParam+scanParams.MultiScanId) gitInfoContext := scanParams.XscGitInfoContext if gitInfoContext != nil { if len(gitInfoContext.Technologies) > 0 { @@ -108,6 +111,7 @@ func (ss *ScanService) ScanGraph(scanParams XrayGraphScanParams) (string, error) if err != nil { return "", fmt.Errorf("failed sending Git Info to XSC service, error: %s ", err.Error()) } + scanParams.MultiScanId = multiScanId if err = os.Setenv("JF_MSI", multiScanId); err != nil { // Not a fatal error, if not set the scan will not be shown at the XSC UI, should not fail the scan. log.Debug(fmt.Sprintf("failed setting MSI as environment variable. Cause: %s", err.Error())) @@ -281,6 +285,7 @@ type XrayGraphScanParams struct { IncludeLicenses bool XscGitInfoContext *XscGitInfoContext XscVersion string + MultiScanId string } type RequestScanResponse struct {