Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
- html - added CVE URL references
Browse files Browse the repository at this point in the history
  • Loading branch information
gadinaor committed Oct 26, 2020
1 parent a7f3be1 commit 9963ad5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion pkg/advisor/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"time"
)

func GenerateAdvisorReport(res *types.ScanTaskResult) (*AdvisorClusterReport, error) {
func GenerateAdvisorReport(res *types.ScanTaskResult, clusterUID string) (*AdvisorClusterReport, error) {
advisorReport := &AdvisorClusterReport{
AdvisorReportHeader: AdvisorReportHeader{
CreationTimeStamp: time.Now().Format(time.RFC3339),
Expand All @@ -23,6 +23,7 @@ func GenerateAdvisorReport(res *types.ScanTaskResult) (*AdvisorClusterReport, er
ScannerVersion: fmt.Sprintf("%v-%v", version.Version, version.Commit),
MSTimeStamp: 0,
ProfileID: "iskan",
ClusterUID: clusterUID,
},
Reports: map[string]*AdvisorReportData{},
}
Expand Down Expand Up @@ -104,6 +105,13 @@ func GenerateAdvisorReport(res *types.ScanTaskResult) (*AdvisorClusterReport, er
}
}

if len(vul.RelatedUrls) > 0 {
finding.References = make([]string, len(vul.RelatedUrls))
for i, urlRef := range vul.RelatedUrls {
finding.References[i] = urlRef.Url
}
}

findings.Findings = append(findings.Findings, finding)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/scan/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (cs *ClusterScanner) Scan() (*types.ClusterScanReport, error) {
}

//FIXME: REMOVE OUTSIDE
cs.advisorReport, _ = advisor.GenerateAdvisorReport(res)
cs.advisorReport, _ = advisor.GenerateAdvisorReport(res, report.ClusterId)

return report, errors.NewAggregate(errs)
}

0 comments on commit 9963ad5

Please sign in to comment.