Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 5 additions & 4 deletions internal/sql/repository/security/CveStoreRepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package security

import (
"fmt"
"github.com/devtron-labs/devtron/internal/sql/repository/helper"
"github.com/devtron-labs/devtron/pkg/sql"
"github.com/go-pg/pg"
"go.uber.org/zap"
Expand Down Expand Up @@ -51,10 +52,10 @@ type VulnerabilityExposure struct {
AppId int `json:"appId"`
EnvId int `json:"envId"`
//ClusterId int `json:"clusterId"`
AppStore bool `json:"appStore"`
Blocked bool `json:"blocked"`
PipelineEnvId int `json:"-"`
ChartEnvId int `json:"-"`
AppType helper.AppType `json:"appType"`
Blocked bool `json:"blocked"`
PipelineEnvId int `json:"-"`
ChartEnvId int `json:"-"`
}

type VulnerabilityExposureListingResponse struct {
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 == helper.ChartStoreApp {
envId = item.ChartEnvId
} else {
} else if item.AppType == helper.CustomApp {
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 == 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