From 3d7e50e4ce69a5d99bd21c4dff085257cb9778e1 Mon Sep 17 00:00:00 2001 From: Ramanan Ravikumar <38394463+ramanan-ravi@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:52:34 +0530 Subject: [PATCH] Add reference link in malware result (#2383) --- deepfence_server/model/scans.go | 2 +- deepfence_worker/ingesters/malware.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/deepfence_server/model/scans.go b/deepfence_server/model/scans.go index d40f948f87..1c9c0a2384 100644 --- a/deepfence_server/model/scans.go +++ b/deepfence_server/model/scans.go @@ -453,6 +453,7 @@ type Malware struct { Filetype string `json:"filetype"` Info string `json:"info"` Version string `json:"version"` + Reference string `json:"reference"` SeverityScore int `json:"severity_score"` StringsToMatch []interface{} `json:"strings_to_match"` Summary string `json:"summary"` @@ -485,7 +486,6 @@ type MalwareRule struct { Filetype string `json:"filetype"` Info string `json:"info"` Version string `json:"version"` - Reference string `json:"reference"` FileSeverity string `json:"file_severity"` Masked bool `json:"masked" required:"true"` Payload string `json:"payload" required:"true"` diff --git a/deepfence_worker/ingesters/malware.go b/deepfence_worker/ingesters/malware.go index 051b936058..8978f5a424 100644 --- a/deepfence_worker/ingesters/malware.go +++ b/deepfence_worker/ingesters/malware.go @@ -81,6 +81,7 @@ func malwareToMaps(data []ingestersUtil.Malware) ([]map[string]map[string]interf malware["node_id"] = generateHashFromString(fmt.Sprintf("%v:%v", i.MetaRules.RuleID, i.CompleteFilename)) + malware["reference"] = i.MetaRules.Reference malwares = append(malwares, map[string]map[string]interface{}{ "Rule": utils.ToMap(i.MetaRules),