mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-18 08:15:16 +01:00
add scan by info in the scan report summary
- fix #9795 Signed-off-by: Steven Zou <szou@vmware.com>
This commit is contained in:
parent
b1a756e34b
commit
7bdf24961c
@ -156,5 +156,7 @@ func GenerateNativeSummary(r *scan.Report, options ...Option) (interface{}, erro
|
||||
sum.Severity = overallSev
|
||||
}
|
||||
|
||||
sum.Scanner = rp.Scanner
|
||||
|
||||
return sum, nil
|
||||
}
|
||||
|
@ -100,6 +100,10 @@ func (suite *SummaryTestSuite) TestSummaryGenerateSummaryNoOptions() {
|
||||
suite.Equal(vuln.High, nativeSummary.Severity)
|
||||
suite.Nil(nativeSummary.CVEBypassed)
|
||||
suite.Equal(2, nativeSummary.Summary.Total)
|
||||
|
||||
suite.Equal("Clair", nativeSummary.Scanner.Name)
|
||||
suite.Equal("Harbor", nativeSummary.Scanner.Vendor)
|
||||
suite.Equal("0.1.0", nativeSummary.Scanner.Version)
|
||||
}
|
||||
|
||||
// TestSummaryGenerateSummaryWithOptions ...
|
||||
|
@ -16,6 +16,8 @@ package vuln
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
v1 "github.com/goharbor/harbor/src/pkg/scan/rest/v1"
|
||||
)
|
||||
|
||||
// NativeReportSummary is the default supported scan report summary model.
|
||||
@ -29,6 +31,7 @@ type NativeReportSummary struct {
|
||||
CVEBypassed []string `json:"-"`
|
||||
StartTime time.Time `json:"start_time"`
|
||||
EndTime time.Time `json:"end_time"`
|
||||
Scanner *v1.Scanner `json:"scanner,omitempty"`
|
||||
}
|
||||
|
||||
// VulnerabilitySummary contains the total number of the found vulnerabilities number
|
||||
|
Loading…
Reference in New Issue
Block a user