Skip to content

Commit

Permalink
NVSHAS-8842 add support for new linux versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Acmarr committed Mar 26, 2024
1 parent ee23045 commit 96e6b12
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions updater/fetchers/amazon/amazon.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ var (
ovals []ovalInfo = []ovalInfo{
ovalInfo{"amazon/alas.rss.gz", "Amazon Linux", 1},
ovalInfo{"amazon/alas2.rss.gz", "Amazon Linux 2", 2},
// ovalInfo{"amazon/alas2022.rss.gz", "Amazon Linux 2022"},
ovalInfo{"amazon/alas2022.rss.gz", "Amazon Linux 2022", 2022},
ovalInfo{"amazon/alas2023.rss.gz", "Amazon Linux 2023", 2023},
}
)

Expand Down Expand Up @@ -157,9 +158,15 @@ func (u *AmazonFetcher) fetchOvalFeed(o *ovalInfo, net updater.NetInterface) ([]

cves := strings.Split(item.CVEs, " ")
vuln.CVEs = make([]common.CVE, len(cves))
for i, cve := range cves {
vuln.CVEs[i].Name = strings.TrimRight(cve, ",")
count := 0
for _, cve := range cves {
name := strings.TrimRight(cve, ",\n ")
if name != "" {
vuln.CVEs[count].Name = name
count++
}
}
vuln.CVEs = vuln.CVEs[:count]

vuln.IssuedDate, _ = time.Parse(time.RFC1123, item.Issued)
vuln.LastModDate, _ = time.Parse(time.RFC1123, item.LastMod)
Expand Down

0 comments on commit 96e6b12

Please sign in to comment.