mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-21 08:07:59 +01:00
Merge pull request #9811 from steven-zou/fix/issue_#9795_add_scan_by
add scan by info in the scan report summary
This commit is contained in:
commit
5cebfd17d2
@ -156,5 +156,7 @@ func GenerateNativeSummary(r *scan.Report, options ...Option) (interface{}, erro
|
|||||||
sum.Severity = overallSev
|
sum.Severity = overallSev
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sum.Scanner = rp.Scanner
|
||||||
|
|
||||||
return sum, nil
|
return sum, nil
|
||||||
}
|
}
|
||||||
|
@ -100,6 +100,10 @@ func (suite *SummaryTestSuite) TestSummaryGenerateSummaryNoOptions() {
|
|||||||
suite.Equal(vuln.High, nativeSummary.Severity)
|
suite.Equal(vuln.High, nativeSummary.Severity)
|
||||||
suite.Nil(nativeSummary.CVEBypassed)
|
suite.Nil(nativeSummary.CVEBypassed)
|
||||||
suite.Equal(2, nativeSummary.Summary.Total)
|
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 ...
|
// TestSummaryGenerateSummaryWithOptions ...
|
||||||
|
@ -16,6 +16,8 @@ package vuln
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
v1 "github.com/goharbor/harbor/src/pkg/scan/rest/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NativeReportSummary is the default supported scan report summary model.
|
// NativeReportSummary is the default supported scan report summary model.
|
||||||
@ -29,6 +31,7 @@ type NativeReportSummary struct {
|
|||||||
CVEBypassed []string `json:"-"`
|
CVEBypassed []string `json:"-"`
|
||||||
StartTime time.Time `json:"start_time"`
|
StartTime time.Time `json:"start_time"`
|
||||||
EndTime time.Time `json:"end_time"`
|
EndTime time.Time `json:"end_time"`
|
||||||
|
Scanner *v1.Scanner `json:"scanner,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// VulnerabilitySummary contains the total number of the found vulnerabilities number
|
// VulnerabilitySummary contains the total number of the found vulnerabilities number
|
||||||
|
Loading…
Reference in New Issue
Block a user