Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/sql/repository/security/CveStoreRepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type VulnerabilityExposure struct {
AppId int `json:"appId"`
EnvId int `json:"envId"`
//ClusterId int `json:"clusterId"`
AppStore bool `json:"appStore"`
AppType int `json:"appType"`
Blocked bool `json:"blocked"`
PipelineEnvId int `json:"-"`
ChartEnvId int `json:"-"`
Expand Down
8 changes: 5 additions & 3 deletions pkg/security/ImageScanService.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,15 +581,17 @@ func (impl ImageScanServiceImpl) VulnerabilityExposure(request *security.Vulnera
cveStores = append(cveStores, cveStore)
for _, item := range vulnerabilityExposureList {
envId := 0
if item.AppStore {
if item.AppType == 1 {
envId = item.ChartEnvId
} else {
} else if item.AppType == 0 {
envId = item.PipelineEnvId
}
env := envMap[envId]
item.EnvId = envId
item.EnvName = env.Environment
blockCveList, err := impl.policyService.GetBlockedCVEList(cveStores, env.ClusterId, envId, item.AppId, item.AppStore)
var appStore bool
appStore = item.AppType == int(helper.ChartStoreApp)
blockCveList, err := impl.policyService.GetBlockedCVEList(cveStores, env.ClusterId, envId, item.AppId, appStore)
if err != nil {
impl.Logger.Errorw("error while fetching blocked list", "err", err)
return nil, err
Expand Down