From e07b6a916080426af5ad92e13383ca72c31330d1 Mon Sep 17 00:00:00 2001 From: Kota Kanbe Date: Tue, 12 Oct 2021 09:09:58 +0900 Subject: [PATCH] feat(report): show Amazon ALAS link to report (#1318) --- oval/redhat.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/oval/redhat.go b/oval/redhat.go index 1efb01fc..e7c43ca7 100644 --- a/oval/redhat.go +++ b/oval/redhat.go @@ -64,6 +64,19 @@ func (o RedHatBase) FillWithOval(r *models.ScanResult) (nCVEs int, err error) { vuln.CveContents[models.Oracle][i] = cont } } + case models.Amazon: + for _, d := range vuln.DistroAdvisories { + if conts, ok := vuln.CveContents[models.Amazon]; ok { + for i, cont := range conts { + if strings.HasPrefix(d.AdvisoryID, "ALAS2-") { + cont.SourceLink = fmt.Sprintf("https://alas.aws.amazon.com/AL2/%s.html", strings.ReplaceAll(d.AdvisoryID, "ALAS2", "ALAS")) + } else if strings.HasPrefix(d.AdvisoryID, "ALAS-") { + cont.SourceLink = fmt.Sprintf("https://alas.aws.amazon.com/%s.html", d.AdvisoryID) + } + vuln.CveContents[models.Amazon][i] = cont + } + } + } } }