Documentation
¶
Index ¶
- Constants
- type CvePolicy
- type CvePolicyRepository
- type CvePolicyRepositoryImpl
- func (impl *CvePolicyRepositoryImpl) GetActiveByCveIdAndScope(cveId string, envId, appId, clusterId int) (policies []*CvePolicy, err error)
- func (impl *CvePolicyRepositoryImpl) GetAppEnvPolicies(clusterId int, environmentId int, appId int) (policies []*CvePolicy, err error)
- func (impl *CvePolicyRepositoryImpl) GetBlockedCVEList(cves []*CveStore, clusterId, envId, appId int, isAppstore bool) ([]*CveStore, error)
- func (impl *CvePolicyRepositoryImpl) GetById(id int) (*CvePolicy, error)
- func (impl *CvePolicyRepositoryImpl) GetClusterPolicies(clusterId int) (policies []*CvePolicy, err error)
- func (impl *CvePolicyRepositoryImpl) GetEnvPolicies(clusterId int, environmentId int) (policies []*CvePolicy, err error)
- func (impl *CvePolicyRepositoryImpl) GetGlobalPolicies() (policies []*CvePolicy, err error)
- func (impl *CvePolicyRepositoryImpl) SavePolicy(tx *pg.Tx, policy *CvePolicy) (*CvePolicy, error)
- func (impl *CvePolicyRepositoryImpl) UpdatePoliciesInBulk(tx *pg.Tx, policies []*CvePolicy) error
- func (impl *CvePolicyRepositoryImpl) UpdatePolicy(tx *pg.Tx, policy *CvePolicy) (*CvePolicy, error)
- type CveStore
- type CveStoreRepository
- type CveStoreRepositoryImpl
- func (impl CveStoreRepositoryImpl) FindAll() ([]*CveStore, error)
- func (impl CveStoreRepositoryImpl) FindByCveNames(names []string) ([]*CveStore, error)
- func (impl CveStoreRepositoryImpl) FindByName(name string) (*CveStore, error)
- func (impl CveStoreRepositoryImpl) Save(model *CveStore) error
- func (impl CveStoreRepositoryImpl) Update(team *CveStore) error
- func (impl CveStoreRepositoryImpl) VulnerabilityExposure(request *VulnerabilityRequest) ([]*VulnerabilityExposure, error)
- type ExecutionData
- type ImageScanDeployInfo
- type ImageScanDeployInfoRepository
- type ImageScanDeployInfoRepositoryImpl
- func (impl ImageScanDeployInfoRepositoryImpl) FetchByAppIdAndEnvId(appId int, envId int, objectType []string) (*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FetchListingGroupByObject(size int, offset int) ([]*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FindAll() ([]*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FindByIds(ids []int) ([]*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FindByTypeMetaAndTypeId(scanObjectMetaId int, objectType string) (*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) FindOne(id int) (*ImageScanDeployInfo, error)
- func (impl ImageScanDeployInfoRepositoryImpl) Save(model *ImageScanDeployInfo) error
- func (impl ImageScanDeployInfoRepositoryImpl) ScanListingWithFilter(request *repoBean.ImageScanFilter, size int, offset int, deployInfoIds []int) ([]*ImageScanListingResponse, error)
- func (impl ImageScanDeployInfoRepositoryImpl) Update(model *ImageScanDeployInfo) error
- type ImageScanExecutionHistory
- type ImageScanExecutionResult
- type ImageScanHistoryRepository
- type ImageScanHistoryRepositoryImpl
- func (impl ImageScanHistoryRepositoryImpl) FindAll() ([]*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByIds(ids []int) ([]*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByImage(image string) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByImageAndDigest(imageDigest string, image string) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByImageAndDigestWithHistoryMapping(imageDigest string, image string) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindByImageDigests(digest []string) ([]*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) FindOne(id int) (*ImageScanExecutionHistory, error)
- func (impl ImageScanHistoryRepositoryImpl) Save(model *ImageScanExecutionHistory) error
- func (impl ImageScanHistoryRepositoryImpl) Update(team *ImageScanExecutionHistory) error
- type ImageScanListingResponse
- type ImageScanObjectMeta
- type ImageScanObjectMetaRepository
- type ImageScanObjectMetaRepositoryImpl
- func (impl ImageScanObjectMetaRepositoryImpl) FindAll() ([]*ImageScanObjectMeta, error)
- func (impl ImageScanObjectMetaRepositoryImpl) FindByNameAndType(name string, types string) ([]*ImageScanObjectMeta, error)
- func (impl ImageScanObjectMetaRepositoryImpl) FindOne(id int) (*ImageScanObjectMeta, error)
- func (impl ImageScanObjectMetaRepositoryImpl) Save(model *ImageScanObjectMeta) error
- func (impl ImageScanObjectMetaRepositoryImpl) Update(team *ImageScanObjectMeta) error
- type ImageScanResultRepository
- type ImageScanResultRepositoryImpl
- func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionId(scanExecutionId int) ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionIds(ids []int) ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FindAll() ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FindByCveName(name string) ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FindByImage(image string) ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FindByImageDigest(imageDigest string) ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FindByImageDigests(digest []string) ([]*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) FindOne(id int) (*ImageScanExecutionResult, error)
- func (impl ImageScanResultRepositoryImpl) Save(model *ImageScanExecutionResult) error
- func (impl ImageScanResultRepositoryImpl) Update(team *ImageScanExecutionResult) error
- type ResourceScanExecutionResult
- type ResourceScanFormat
- type ResourceScanResultRepository
- type ResourceScanResultRepositoryImpl
- type ResourceScanType
- type ScanExecutionProcessState
- type ScanToolExecutionHistoryMapping
- type ScanToolExecutionHistoryMappingRepository
- type ScanToolExecutionHistoryMappingRepositoryImpl
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) FetchScanHistoryMappingsUsingImageAndImageDigest(image, imageDigest string) ([]*ScanToolExecutionHistoryMapping, error)
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIdAndStates(executionHistoryId int, states []ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIds(ids []int) ([]*ScanToolExecutionHistoryMapping, error)
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByState(state ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) MarkAllRunningStateAsFailedHavingTryCountReachedLimit(tryCount int) error
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) Save(model *ScanToolExecutionHistoryMapping) error
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) SaveInBatch(models []*ScanToolExecutionHistoryMapping) error
- func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) UpdateStateByToolAndExecutionHistoryId(executionHistoryId, toolId int, state ScanExecutionProcessState, ...) error
- type SourceSubType
- type SourceType
- type VulnerabilityExposure
- type VulnerabilityExposureListingResponse
- type VulnerabilityRequest
Constants ¶
View Source
const ( ScanObjectType_APP string = "app" ScanObjectType_CHART string = "chart" ScanObjectType_POD string = "pod" )
View Source
const ( CycloneDxSbom ResourceScanFormat = 1 // SBOM TrivyJson = 2 Json = 3 )
View Source
const ( Vulnerabilities ResourceScanType = 1 License = 2 Config = 3 Secrets = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CvePolicy ¶
type CvePolicy struct {
Id int `sql:"id,pk"`
Global bool `sql:"global,notnull,type:boolean"`
ClusterId int `sql:"cluster_id,type:integer"`
EnvironmentId int `sql:"env_id,type:integer"`
AppId int `sql:"app_id,type:integer"`
CVEStoreId string `sql:"cve_store_id,type:text"`
Action securityBean.PolicyAction `sql:"action, notnull,type:integer"`
Severity *securityBean.Severity `sql:"severity, notnull,type:integer"`
Deleted bool `sql:"deleted, notnull,type:boolean"`
sql.AuditLog
CveStore *CveStore
// contains filtered or unexported fields
}
func (*CvePolicy) PolicyLevel ¶
func (policy *CvePolicy) PolicyLevel() securityBean.PolicyLevel
func (*CvePolicy) UpdateDeleted ¶ added in v1.2.1
type CvePolicyRepository ¶
type CvePolicyRepository interface {
GetGlobalPolicies() (policies []*CvePolicy, err error)
GetClusterPolicies(clusterId int) (policies []*CvePolicy, err error)
GetEnvPolicies(clusterId int, environmentId int) (policies []*CvePolicy, err error)
GetAppEnvPolicies(clusterId int, environmentId int, appId int) (policies []*CvePolicy, err error)
SavePolicy(tx *pg.Tx, policy *CvePolicy) (*CvePolicy, error)
UpdatePolicy(tx *pg.Tx, policy *CvePolicy) (*CvePolicy, error)
GetById(id int) (*CvePolicy, error)
GetBlockedCVEList(cves []*CveStore, clusterId, envId, appId int, isAppstore bool) ([]*CveStore, error)
GetActiveByCveIdAndScope(cveId string, envId, appId, clusterId int) (policies []*CvePolicy, err error)
UpdatePoliciesInBulk(tx *pg.Tx, policies []*CvePolicy) error
}
type CvePolicyRepositoryImpl ¶
type CvePolicyRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewPolicyRepositoryImpl ¶
func NewPolicyRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CvePolicyRepositoryImpl
func (*CvePolicyRepositoryImpl) GetActiveByCveIdAndScope ¶ added in v1.2.1
func (impl *CvePolicyRepositoryImpl) GetActiveByCveIdAndScope(cveId string, envId, appId, clusterId int) (policies []*CvePolicy, err error)
GetActiveByCveIdAndScope returns cvePolicy slice, based on scope, if all scopes are 0 or null then global cvePolicies are returned
func (*CvePolicyRepositoryImpl) GetAppEnvPolicies ¶
func (*CvePolicyRepositoryImpl) GetBlockedCVEList ¶
func (*CvePolicyRepositoryImpl) GetById ¶
func (impl *CvePolicyRepositoryImpl) GetById(id int) (*CvePolicy, error)
func (*CvePolicyRepositoryImpl) GetClusterPolicies ¶
func (impl *CvePolicyRepositoryImpl) GetClusterPolicies(clusterId int) (policies []*CvePolicy, err error)
func (*CvePolicyRepositoryImpl) GetEnvPolicies ¶
func (impl *CvePolicyRepositoryImpl) GetEnvPolicies(clusterId int, environmentId int) (policies []*CvePolicy, err error)
func (*CvePolicyRepositoryImpl) GetGlobalPolicies ¶
func (impl *CvePolicyRepositoryImpl) GetGlobalPolicies() (policies []*CvePolicy, err error)
func (*CvePolicyRepositoryImpl) SavePolicy ¶
func (*CvePolicyRepositoryImpl) UpdatePoliciesInBulk ¶ added in v1.2.1
func (impl *CvePolicyRepositoryImpl) UpdatePoliciesInBulk(tx *pg.Tx, policies []*CvePolicy) error
func (*CvePolicyRepositoryImpl) UpdatePolicy ¶
type CveStore ¶
type CveStore struct {
Name string `sql:"name,pk"`
// Deprecated: Severity, use StandardSeverity for all read purposes
Severity securityBean.Severity `sql:"severity,notnull"`
// Deprecated: Package
Package string `sql:"package,notnull"` // deprecated, storing package data in image_scan_execution_result table
// Deprecated: Version
Version string `sql:"version,notnull"`
// Deprecated: FixedVersion
FixedVersion string `sql:"fixed_version,notnull"`
// StandardSeverity is the actual severity. use GetSeverity method to get severity of the vulnerability
// earlier severity is maintained in Severity column by merging HIGH and CRITICAL severities.
// later we introduced new column StandardSeverity to store raw severity, but didn't migrate the existing Severity data to StandardSeverity.
// currently, we deprecated Severity.
StandardSeverity *securityBean.Severity `sql:"standard_severity"`
sql.AuditLog
// contains filtered or unexported fields
}
func EnforceCvePolicy ¶
func (*CveStore) GetSeverity ¶
func (cve *CveStore) GetSeverity() securityBean.Severity
GetSeverity returns the actual severity of the vulnerability.
func (*CveStore) SetStandardSeverity ¶
func (cve *CveStore) SetStandardSeverity(severity securityBean.Severity)
type CveStoreRepository ¶
type CveStoreRepository interface {
Save(model *CveStore) error
FindAll() ([]*CveStore, error)
FindByCveNames(names []string) ([]*CveStore, error)
FindByName(name string) (*CveStore, error)
Update(model *CveStore) error
VulnerabilityExposure(request *VulnerabilityRequest) ([]*VulnerabilityExposure, error)
}
type CveStoreRepositoryImpl ¶
type CveStoreRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewCveStoreRepositoryImpl ¶
func NewCveStoreRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CveStoreRepositoryImpl
func (CveStoreRepositoryImpl) FindAll ¶
func (impl CveStoreRepositoryImpl) FindAll() ([]*CveStore, error)
func (CveStoreRepositoryImpl) FindByCveNames ¶
func (impl CveStoreRepositoryImpl) FindByCveNames(names []string) ([]*CveStore, error)
func (CveStoreRepositoryImpl) FindByName ¶
func (impl CveStoreRepositoryImpl) FindByName(name string) (*CveStore, error)
func (CveStoreRepositoryImpl) Save ¶
func (impl CveStoreRepositoryImpl) Save(model *CveStore) error
func (CveStoreRepositoryImpl) Update ¶
func (impl CveStoreRepositoryImpl) Update(team *CveStore) error
func (CveStoreRepositoryImpl) VulnerabilityExposure ¶
func (impl CveStoreRepositoryImpl) VulnerabilityExposure(request *VulnerabilityRequest) ([]*VulnerabilityExposure, error)
type ExecutionData ¶
type ExecutionData struct {
Image string
ScanDataJson string
StartedOn time.Time
ScanToolName string
SourceType SourceType
SourceSubType SourceSubType
Types []int `sql:"types" pg:",array"`
Status ScanExecutionProcessState
}
func (*ExecutionData) ContainsType ¶
func (ed *ExecutionData) ContainsType(typeToCheck ResourceScanType) bool
func (*ExecutionData) IsBuiltImage ¶
func (ed *ExecutionData) IsBuiltImage() bool
func (*ExecutionData) IsCode ¶
func (ed *ExecutionData) IsCode() bool
func (*ExecutionData) IsManifest ¶
func (ed *ExecutionData) IsManifest() bool
func (*ExecutionData) IsManifestImage ¶
func (ed *ExecutionData) IsManifestImage() bool
type ImageScanDeployInfo ¶
type ImageScanDeployInfo struct {
Id int `sql:"id,pk"`
ImageScanExecutionHistoryId []int `sql:"image_scan_execution_history_id,notnull" pg:",array"`
ScanObjectMetaId int `sql:"scan_object_meta_id,notnull"`
ObjectType string `sql:"object_type,notnull"`
EnvId int `sql:"env_id,notnull"`
ClusterId int `sql:"cluster_id,notnull"`
sql.AuditLog
// contains filtered or unexported fields
}
* this table contains scanned images registry for deployed object and apps, images which are deployed on cluster by anyway and has scanned result
func (*ImageScanDeployInfo) IsObjectTypeApp ¶ added in v1.2.1
func (r *ImageScanDeployInfo) IsObjectTypeApp() bool
type ImageScanDeployInfoRepository ¶
type ImageScanDeployInfoRepository interface {
Save(model *ImageScanDeployInfo) error
FindAll() ([]*ImageScanDeployInfo, error)
FindOne(id int) (*ImageScanDeployInfo, error)
FindByIds(ids []int) ([]*ImageScanDeployInfo, error)
Update(model *ImageScanDeployInfo) error
FetchListingGroupByObject(size int, offset int) ([]*ImageScanDeployInfo, error)
FetchByAppIdAndEnvId(appId int, envId int, objectType []string) (*ImageScanDeployInfo, error)
FindByTypeMetaAndTypeId(scanObjectMetaId int, objectType string) (*ImageScanDeployInfo, error)
ScanListingWithFilter(request *repoBean.ImageScanFilter, size int, offset int, deployInfoIds []int) ([]*ImageScanListingResponse, error)
}
type ImageScanDeployInfoRepositoryImpl ¶
type ImageScanDeployInfoRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewImageScanDeployInfoRepositoryImpl ¶
func NewImageScanDeployInfoRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ImageScanDeployInfoRepositoryImpl
func (ImageScanDeployInfoRepositoryImpl) FetchByAppIdAndEnvId ¶
func (impl ImageScanDeployInfoRepositoryImpl) FetchByAppIdAndEnvId(appId int, envId int, objectType []string) (*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FetchListingGroupByObject ¶
func (impl ImageScanDeployInfoRepositoryImpl) FetchListingGroupByObject(size int, offset int) ([]*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FindAll ¶
func (impl ImageScanDeployInfoRepositoryImpl) FindAll() ([]*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FindByIds ¶
func (impl ImageScanDeployInfoRepositoryImpl) FindByIds(ids []int) ([]*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FindByTypeMetaAndTypeId ¶
func (impl ImageScanDeployInfoRepositoryImpl) FindByTypeMetaAndTypeId(scanObjectMetaId int, objectType string) (*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) FindOne ¶
func (impl ImageScanDeployInfoRepositoryImpl) FindOne(id int) (*ImageScanDeployInfo, error)
func (ImageScanDeployInfoRepositoryImpl) Save ¶
func (impl ImageScanDeployInfoRepositoryImpl) Save(model *ImageScanDeployInfo) error
func (ImageScanDeployInfoRepositoryImpl) ScanListingWithFilter ¶
func (impl ImageScanDeployInfoRepositoryImpl) ScanListingWithFilter(request *repoBean.ImageScanFilter, size int, offset int, deployInfoIds []int) ([]*ImageScanListingResponse, error)
func (ImageScanDeployInfoRepositoryImpl) Update ¶
func (impl ImageScanDeployInfoRepositoryImpl) Update(model *ImageScanDeployInfo) error
type ImageScanExecutionHistory ¶
type ImageScanExecutionHistory struct {
Id int `sql:"id,pk"`
Image string `sql:"image,notnull"`
ImageHash string `sql:"image_hash,notnull"` // TODO Migrate to request metadata
ExecutionTime time.Time `sql:"execution_time"`
ExecutedBy int `sql:"executed_by,notnull"`
SourceMetadataJson string `sql:"source_metadata_json"` // to have relevant info to process a scan for a given source type and subtype
SourceType SourceType `sql:"source_type"`
SourceSubType SourceSubType `sql:"source_sub_type"`
ScanToolExecutionHistoryMapping *ScanToolExecutionHistoryMapping
// contains filtered or unexported fields
}
type ImageScanExecutionResult ¶
type ImageScanExecutionResult struct {
Id int `sql:"id,pk"`
CveStoreName string `sql:"cve_store_name,notnull"`
ImageScanExecutionHistoryId int `sql:"image_scan_execution_history_id"`
ScanToolId int `sql:"scan_tool_id"`
Package string `sql:"package"`
Version string `sql:"version"`
FixedVersion string `sql:"fixed_version"`
Target string `sql:"target"`
Type string `sql:"type"`
Class string `sql:"class"`
CveStore CveStore
ImageScanExecutionHistory ImageScanExecutionHistory
// contains filtered or unexported fields
}
type ImageScanHistoryRepository ¶
type ImageScanHistoryRepository interface {
Save(model *ImageScanExecutionHistory) error
FindAll() ([]*ImageScanExecutionHistory, error)
FindOne(id int) (*ImageScanExecutionHistory, error)
FindByImageAndDigest(imageDigest string, image string) (*ImageScanExecutionHistory, error)
FindByImageDigests(digest []string) ([]*ImageScanExecutionHistory, error)
FindByIds(ids []int) ([]*ImageScanExecutionHistory, error)
Update(model *ImageScanExecutionHistory) error
FindByImage(image string) (*ImageScanExecutionHistory, error)
FindByImageAndDigestWithHistoryMapping(imageDigest string, image string) (*ImageScanExecutionHistory, error)
}
type ImageScanHistoryRepositoryImpl ¶
type ImageScanHistoryRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewImageScanHistoryRepositoryImpl ¶
func NewImageScanHistoryRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ImageScanHistoryRepositoryImpl
func (ImageScanHistoryRepositoryImpl) FindAll ¶
func (impl ImageScanHistoryRepositoryImpl) FindAll() ([]*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByIds ¶
func (impl ImageScanHistoryRepositoryImpl) FindByIds(ids []int) ([]*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByImage ¶
func (impl ImageScanHistoryRepositoryImpl) FindByImage(image string) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByImageAndDigest ¶
func (impl ImageScanHistoryRepositoryImpl) FindByImageAndDigest(imageDigest string, image string) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByImageAndDigestWithHistoryMapping ¶ added in v1.2.1
func (impl ImageScanHistoryRepositoryImpl) FindByImageAndDigestWithHistoryMapping(imageDigest string, image string) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindByImageDigests ¶
func (impl ImageScanHistoryRepositoryImpl) FindByImageDigests(digest []string) ([]*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) FindOne ¶
func (impl ImageScanHistoryRepositoryImpl) FindOne(id int) (*ImageScanExecutionHistory, error)
func (ImageScanHistoryRepositoryImpl) Save ¶
func (impl ImageScanHistoryRepositoryImpl) Save(model *ImageScanExecutionHistory) error
func (ImageScanHistoryRepositoryImpl) Update ¶
func (impl ImageScanHistoryRepositoryImpl) Update(team *ImageScanExecutionHistory) error
type ImageScanListingResponse ¶
type ImageScanListingResponse struct {
Id int `json:"id"`
ScanObjectMetaId int `json:"scanObjectMetaId"`
ObjectName string `json:"objectName"`
ObjectType string `json:"objectType"`
SecurityScan string `json:"securityScan"`
EnvironmentName string `json:"environmentName"`
LastChecked time.Time `json:"lastChecked"`
TotalCount int `json:"totalCount"`
}
type ImageScanObjectMeta ¶
type ImageScanObjectMetaRepository ¶
type ImageScanObjectMetaRepository interface {
Save(model *ImageScanObjectMeta) error
FindAll() ([]*ImageScanObjectMeta, error)
FindOne(id int) (*ImageScanObjectMeta, error)
FindByNameAndType(name string, types string) ([]*ImageScanObjectMeta, error)
Update(model *ImageScanObjectMeta) error
}
type ImageScanObjectMetaRepositoryImpl ¶
type ImageScanObjectMetaRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewImageScanObjectMetaRepositoryImpl ¶
func NewImageScanObjectMetaRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ImageScanObjectMetaRepositoryImpl
func (ImageScanObjectMetaRepositoryImpl) FindAll ¶
func (impl ImageScanObjectMetaRepositoryImpl) FindAll() ([]*ImageScanObjectMeta, error)
func (ImageScanObjectMetaRepositoryImpl) FindByNameAndType ¶
func (impl ImageScanObjectMetaRepositoryImpl) FindByNameAndType(name string, types string) ([]*ImageScanObjectMeta, error)
func (ImageScanObjectMetaRepositoryImpl) FindOne ¶
func (impl ImageScanObjectMetaRepositoryImpl) FindOne(id int) (*ImageScanObjectMeta, error)
func (ImageScanObjectMetaRepositoryImpl) Save ¶
func (impl ImageScanObjectMetaRepositoryImpl) Save(model *ImageScanObjectMeta) error
func (ImageScanObjectMetaRepositoryImpl) Update ¶
func (impl ImageScanObjectMetaRepositoryImpl) Update(team *ImageScanObjectMeta) error
type ImageScanResultRepository ¶
type ImageScanResultRepository interface {
Save(model *ImageScanExecutionResult) error
FindAll() ([]*ImageScanExecutionResult, error)
FindOne(id int) (*ImageScanExecutionResult, error)
FindByCveName(name string) ([]*ImageScanExecutionResult, error)
Update(model *ImageScanExecutionResult) error
FetchByScanExecutionId(id int) ([]*ImageScanExecutionResult, error)
FetchByScanExecutionIds(ids []int) ([]*ImageScanExecutionResult, error)
FindByImageDigest(imageDigest string) ([]*ImageScanExecutionResult, error)
FindByImageDigests(digest []string) ([]*ImageScanExecutionResult, error)
FindByImage(image string) ([]*ImageScanExecutionResult, error)
}
type ImageScanResultRepositoryImpl ¶
type ImageScanResultRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewImageScanResultRepositoryImpl ¶
func NewImageScanResultRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ImageScanResultRepositoryImpl
func (ImageScanResultRepositoryImpl) FetchByScanExecutionId ¶
func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionId(scanExecutionId int) ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FetchByScanExecutionIds ¶
func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionIds(ids []int) ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FindAll ¶
func (impl ImageScanResultRepositoryImpl) FindAll() ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FindByCveName ¶
func (impl ImageScanResultRepositoryImpl) FindByCveName(name string) ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FindByImage ¶
func (impl ImageScanResultRepositoryImpl) FindByImage(image string) ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FindByImageDigest ¶
func (impl ImageScanResultRepositoryImpl) FindByImageDigest(imageDigest string) ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FindByImageDigests ¶
func (impl ImageScanResultRepositoryImpl) FindByImageDigests(digest []string) ([]*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) FindOne ¶
func (impl ImageScanResultRepositoryImpl) FindOne(id int) (*ImageScanExecutionResult, error)
func (ImageScanResultRepositoryImpl) Save ¶
func (impl ImageScanResultRepositoryImpl) Save(model *ImageScanExecutionResult) error
func (ImageScanResultRepositoryImpl) Update ¶
func (impl ImageScanResultRepositoryImpl) Update(team *ImageScanExecutionResult) error
type ResourceScanExecutionResult ¶
type ResourceScanExecutionResult struct {
Id int `sql:"id,pk"`
ImageScanExecutionHistoryId int `sql:"image_scan_execution_history_id"`
ScanDataJson string `sql:"scan_data_json"`
Format ResourceScanFormat `sql:"format"`
Types []ResourceScanType `sql:"types"`
ScanToolId int `sql:"scan_tool_id"`
// contains filtered or unexported fields
}
type ResourceScanFormat ¶
type ResourceScanFormat int
type ResourceScanResultRepository ¶
type ResourceScanResultRepository interface {
SaveInBatch(tx *pg.Tx, models []*ResourceScanExecutionResult) error
}
type ResourceScanResultRepositoryImpl ¶
type ResourceScanResultRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewResourceScanResultRepositoryImpl ¶
func NewResourceScanResultRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ResourceScanResultRepositoryImpl
func (ResourceScanResultRepositoryImpl) SaveInBatch ¶
func (impl ResourceScanResultRepositoryImpl) SaveInBatch(tx *pg.Tx, models []*ResourceScanExecutionResult) error
type ResourceScanType ¶
type ResourceScanType int
type ScanExecutionProcessState ¶ added in v1.2.1
type ScanExecutionProcessState int
const ( ScanExecutionProcessStateFailed ScanExecutionProcessState = iota - 1 //resolved value = -1 ScanExecutionProcessStateRunning //resolved value = 0 ScanExecutionProcessStateCompleted //resolved value = 1 )
func (ScanExecutionProcessState) String ¶ added in v1.2.1
func (state ScanExecutionProcessState) String() string
type ScanToolExecutionHistoryMapping ¶
type ScanToolExecutionHistoryMapping struct {
Id int `sql:"id,pk"`
ImageScanExecutionHistoryId int `sql:"image_scan_execution_history_id"`
ScanToolId int `sql:"scan_tool_id"`
ExecutionStartTime time.Time `sql:"execution_start_time,notnull"`
ExecutionFinishTime time.Time `sql:"execution_finish_time,notnull"`
State ScanExecutionProcessState `sql:"state"`
TryCount int `sql:"try_count"`
ErrorMessage string `sql:"error_message"`
sql.AuditLog
// contains filtered or unexported fields
}
type ScanToolExecutionHistoryMappingRepository ¶
type ScanToolExecutionHistoryMappingRepository interface {
Save(model *ScanToolExecutionHistoryMapping) error
SaveInBatch(models []*ScanToolExecutionHistoryMapping) error
UpdateStateByToolAndExecutionHistoryId(executionHistoryId, toolId int, state ScanExecutionProcessState, executionFinishTime time.Time) error
MarkAllRunningStateAsFailedHavingTryCountReachedLimit(tryCount int) error
GetAllScanHistoriesByState(state ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
GetAllScanHistoriesByExecutionHistoryIdAndStates(executionHistoryId int, states []ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
GetAllScanHistoriesByExecutionHistoryIds(ids []int) ([]*ScanToolExecutionHistoryMapping, error)
FetchScanHistoryMappingsUsingImageAndImageDigest(image, imageDigest string) ([]*ScanToolExecutionHistoryMapping, error)
}
type ScanToolExecutionHistoryMappingRepositoryImpl ¶
type ScanToolExecutionHistoryMappingRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewScanToolExecutionHistoryMappingRepositoryImpl ¶
func NewScanToolExecutionHistoryMappingRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ScanToolExecutionHistoryMappingRepositoryImpl
func (*ScanToolExecutionHistoryMappingRepositoryImpl) FetchScanHistoryMappingsUsingImageAndImageDigest ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) FetchScanHistoryMappingsUsingImageAndImageDigest(image, imageDigest string) ([]*ScanToolExecutionHistoryMapping, error)
func (*ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIdAndStates ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIdAndStates(executionHistoryId int, states []ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
func (*ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIds ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIds(ids []int) ([]*ScanToolExecutionHistoryMapping, error)
func (*ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByState ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByState(state ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error)
func (*ScanToolExecutionHistoryMappingRepositoryImpl) MarkAllRunningStateAsFailedHavingTryCountReachedLimit ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) MarkAllRunningStateAsFailedHavingTryCountReachedLimit(tryCount int) error
func (*ScanToolExecutionHistoryMappingRepositoryImpl) Save ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) Save(model *ScanToolExecutionHistoryMapping) error
func (*ScanToolExecutionHistoryMappingRepositoryImpl) SaveInBatch ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) SaveInBatch(models []*ScanToolExecutionHistoryMapping) error
func (*ScanToolExecutionHistoryMappingRepositoryImpl) UpdateStateByToolAndExecutionHistoryId ¶
func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) UpdateStateByToolAndExecutionHistoryId(executionHistoryId, toolId int, state ScanExecutionProcessState, executionFinishTime time.Time) error
type SourceSubType ¶
type SourceSubType int
const ( SourceSubTypeCi SourceSubType = 1 // relevant for ci code(2,1) or ci built image(1,1) SourceSubTypeManifest SourceSubType = 2 // relevant for devtron app deployment manifest/helm app manifest(2,2) or images retrieved from manifest(1,2)) )
type SourceType ¶
type SourceType int
multiple history rows for one source event
const ( SourceTypeImage SourceType = 1 SourceTypeCode SourceType = 2 SourceTypeSbom SourceType = 3 // can be used in future for direct sbom scanning )
type VulnerabilityExposure ¶
type VulnerabilityExposure struct {
AppName string `json:"appName"`
EnvName string `json:"envName"`
AppId int `json:"appId"`
EnvId int `json:"envId"`
//ClusterId int `json:"clusterId"`
AppType helper.AppType `json:"appType"`
Blocked bool `json:"blocked"`
PipelineEnvId int `json:"-"`
ChartEnvId int `json:"-"`
}
type VulnerabilityExposureListingResponse ¶
type VulnerabilityExposureListingResponse struct {
Offset int `json:"offset"`
Size int `json:"size"`
Total int `json:"total"`
VulnerabilityExposure []*VulnerabilityExposure `json:"list"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.