mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
feat(CVE): add CVE severity counters to returned images and CVE list calls (#2131)
For CLI output is similar to: CRITICAL 0, HIGH 1, MEDIUM 1, LOW 0, UNKNOWN 0, TOTAL 2 ID SEVERITY TITLE CVE-2023-0464 HIGH openssl: Denial of service by excessive resou... CVE-2023-0465 MEDIUM openssl: Invalid certificate policies in leaf... Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
@@ -11,7 +11,7 @@ type CveInfoMock struct {
|
||||
GetImageListForCVEFn func(ctx context.Context, repo, cveID string) ([]cvemodel.TagInfo, error)
|
||||
GetImageListWithCVEFixedFn func(ctx context.Context, repo, cveID string) ([]cvemodel.TagInfo, error)
|
||||
GetCVEListForImageFn func(ctx context.Context, repo string, reference string, searchedCVE string,
|
||||
pageInput cvemodel.PageInput) ([]cvemodel.CVE, common.PageInfo, error)
|
||||
pageInput cvemodel.PageInput) ([]cvemodel.CVE, cvemodel.ImageCVESummary, common.PageInfo, error)
|
||||
GetCVESummaryForImageMediaFn func(ctx context.Context, repo string, digest, mediaType string,
|
||||
) (cvemodel.ImageCVESummary, error)
|
||||
}
|
||||
@@ -37,6 +37,7 @@ func (cveInfo CveInfoMock) GetCVEListForImage(ctx context.Context, repo string,
|
||||
searchedCVE string, pageInput cvemodel.PageInput,
|
||||
) (
|
||||
[]cvemodel.CVE,
|
||||
cvemodel.ImageCVESummary,
|
||||
common.PageInfo,
|
||||
error,
|
||||
) {
|
||||
@@ -44,7 +45,7 @@ func (cveInfo CveInfoMock) GetCVEListForImage(ctx context.Context, repo string,
|
||||
return cveInfo.GetCVEListForImageFn(ctx, repo, reference, searchedCVE, pageInput)
|
||||
}
|
||||
|
||||
return []cvemodel.CVE{}, common.PageInfo{}, nil
|
||||
return []cvemodel.CVE{}, cvemodel.ImageCVESummary{}, common.PageInfo{}, nil
|
||||
}
|
||||
|
||||
func (cveInfo CveInfoMock) GetCVESummaryForImageMedia(ctx context.Context, repo, digest, mediaType string,
|
||||
|
||||
Reference in New Issue
Block a user