Skip to content

Commit

Permalink
Merge branch 'main' of github.com:fjogeleit/trivy-operator-polr-adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Jogeleit committed Mar 13, 2023
2 parents a02f12b + 00821b5 commit dea47ec
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/adapters/vulnr/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ func (m *mapper) Map(report *v1alpha1.VulnerabilityReport, polr *v1alpha2.Policy
props["primaryLink"] = vuln.PrimaryLink
}

for source, cvss := range vuln.CVSS {
if cvss.V2Score != 0 {
props[fmt.Sprintf("%s.v2_score", source)] = fmt.Sprint(cvss.V2Score)
}
if cvss.V2Vector != "" {
props[fmt.Sprintf("%s.v2_vector", source)] = cvss.V2Vector
}

if cvss.V3Score != 0 {
props[fmt.Sprintf("%s.v3_score", source)] = fmt.Sprint(cvss.V3Score)
}
if cvss.V3Vector != "" {
props[fmt.Sprintf("%s.v3_vector", source)] = cvss.V3Vector
}
}

polr.Results = append(polr.Results, v1alpha2.PolicyReportResult{
Policy: vuln.VulnerabilityID,
Message: vuln.Title,
Expand Down

0 comments on commit dea47ec

Please sign in to comment.