Skip to content

Commit

Permalink
NVSHAS-8842 add support for new amazon linux versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Acmarr committed Mar 27, 2024
1 parent ee23045 commit 02f2a48
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 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 @@ -141,7 +142,7 @@ func (u *AmazonFetcher) fetchOvalFeed(o *ovalInfo, net updater.NetInterface) ([]
Link: item.Link,
}

switch tokens[1] {
switch strings.ToLower(tokens[1]) {
case "(critical):":
vuln.FeedRating = "Critical"
vuln.Severity = common.Critical
Expand All @@ -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 02f2a48

Please sign in to comment.