Skip to content

Commit

Permalink
Better detection of Not Affected components
Browse files Browse the repository at this point in the history
  • Loading branch information
p-rog committed Sep 5, 2022
1 parent ba7e675 commit 5736686
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/cve-analyser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ func processLines(wg *sync.WaitGroup, jobs <-chan []string, results chan<- Outpu
//}
if lookNotFixed.CPE == cpe {
for _, rpm := range image_rpm_manifest {
if rpm == strings.Split(lookNotFixed.RPM, ":")[0] {
// If the component is not affected, then the component name might be a little different than the full source rpm package name
// hence it's better to check if the container rpm manifest contains a package similar to the not affected rpm package name
//if rpm == strings.Split(lookNotFixed.RPM, ":")[0] {
if strings.Contains(rpm, lookNotFixed.RPM) {
if lookNotFixed.Fix_State == "Not affected" {
info_not_fixed = append(info_not_fixed, fmt.Sprintf("(%+v|%+v|%+v)", lookNotFixed.Product_name, lookNotFixed.Fix_State, lookNotFixed.RPM))
} else {
Expand Down

0 comments on commit 5736686

Please sign in to comment.