Versions in this module Expand all Collapse all v1 v1.1.0 Dec 20, 2024 Changes in this version + const Config + const CycloneDxSbom + const Json + const License + const ScanObjectType_APP + const ScanObjectType_CHART + const ScanObjectType_POD + const Secrets + const TrivyJson + const Vulnerabilities + type CvePolicy struct + Action securityBean.PolicyAction + AppId int + CVEStoreId string + ClusterId int + CveStore *CveStore + Deleted bool + EnvironmentId int + Global bool + Id int + Severity *securityBean.Severity + func (policy *CvePolicy) PolicyLevel() securityBean.PolicyLevel + type CvePolicyRepository interface + GetAppEnvPolicies func(clusterId int, environmentId int, appId int) (policies []*CvePolicy, err error) + GetBlockedCVEList func(cves []*CveStore, clusterId, envId, appId int, isAppstore bool) ([]*CveStore, error) + GetById func(id int) (*CvePolicy, error) + GetClusterPolicies func(clusterId int) (policies []*CvePolicy, err error) + GetEnvPolicies func(clusterId int, environmentId int) (policies []*CvePolicy, err error) + GetGlobalPolicies func() (policies []*CvePolicy, err error) + SavePolicy func(policy *CvePolicy) (*CvePolicy, error) + UpdatePolicy func(policy *CvePolicy) (*CvePolicy, error) + type CvePolicyRepositoryImpl struct + func NewPolicyRepositoryImpl(dbConnection *pg.DB) *CvePolicyRepositoryImpl + 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(policy *CvePolicy) (*CvePolicy, error) + func (impl *CvePolicyRepositoryImpl) UpdatePolicy(policy *CvePolicy) (*CvePolicy, error) + type CveStore struct + FixedVersion string + Name string + Package string + Severity securityBean.Severity + StandardSeverity *securityBean.Severity + Version string + func EnforceCvePolicy(cves []*CveStore, cvePolicy map[string]*CvePolicy, ...) (blockedCVE []*CveStore) + func (cve *CveStore) GetSeverity() securityBean.Severity + func (cve *CveStore) SetStandardSeverity(severity securityBean.Severity) + type CveStoreRepository interface + FindAll func() ([]*CveStore, error) + FindByCveNames func(names []string) ([]*CveStore, error) + FindByName func(name string) (*CveStore, error) + Save func(model *CveStore) error + Update func(model *CveStore) error + VulnerabilityExposure func(request *VulnerabilityRequest) ([]*VulnerabilityExposure, error) + type CveStoreRepositoryImpl struct + func NewCveStoreRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *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 struct + Image string + ScanDataJson string + ScanToolName string + SourceSubType SourceSubType + SourceType SourceType + StartedOn time.Time + Status serverBean.ScanExecutionProcessState + Types []int + func (ed *ExecutionData) ContainsType(typeToCheck ResourceScanType) bool + func (ed *ExecutionData) IsBuiltImage() bool + func (ed *ExecutionData) IsCode() bool + func (ed *ExecutionData) IsManifest() bool + func (ed *ExecutionData) IsManifestImage() bool + type ImageScanDeployInfo struct + ClusterId int + EnvId int + Id int + ImageScanExecutionHistoryId []int + ObjectType string + ScanObjectMetaId int + type ImageScanDeployInfoRepository interface + FetchByAppIdAndEnvId func(appId int, envId int, objectType []string) (*ImageScanDeployInfo, error) + FetchListingGroupByObject func(size int, offset int) ([]*ImageScanDeployInfo, error) + FindAll func() ([]*ImageScanDeployInfo, error) + FindByIds func(ids []int) ([]*ImageScanDeployInfo, error) + FindByTypeMetaAndTypeId func(scanObjectMetaId int, objectType string) (*ImageScanDeployInfo, error) + FindOne func(id int) (*ImageScanDeployInfo, error) + Save func(model *ImageScanDeployInfo) error + ScanListingWithFilter func(request *securityBean.ImageScanFilter, size int, offset int, ...) ([]*ImageScanListingResponse, error) + Update func(model *ImageScanDeployInfo) error + type ImageScanDeployInfoRepositoryImpl struct + func NewImageScanDeployInfoRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *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 *securityBean.ImageScanFilter, size int, offset int, ...) ([]*ImageScanListingResponse, error) + func (impl ImageScanDeployInfoRepositoryImpl) Update(model *ImageScanDeployInfo) error + type ImageScanExecutionHistory struct + ExecutedBy int + ExecutionTime time.Time + Id int + Image string + ImageHash string + ScanToolExecutionHistoryMapping *ScanToolExecutionHistoryMapping + SourceMetadataJson string + SourceSubType SourceSubType + SourceType SourceType + type ImageScanExecutionResult struct + Class string + CveStore CveStore + CveStoreName string + FixedVersion string + Id int + ImageScanExecutionHistory ImageScanExecutionHistory + ImageScanExecutionHistoryId int + Package string + ScanToolId int + Target string + Type string + Version string + type ImageScanHistoryRepository interface + FindAll func() ([]*ImageScanExecutionHistory, error) + FindByIds func(ids []int) ([]*ImageScanExecutionHistory, error) + FindByImage func(image string) (*ImageScanExecutionHistory, error) + FindByImageAndDigest func(imageDigest string, image string) (*ImageScanExecutionHistory, error) + FindByImageDigests func(digest []string) ([]*ImageScanExecutionHistory, error) + FindOne func(id int) (*ImageScanExecutionHistory, error) + Save func(model *ImageScanExecutionHistory) error + Update func(model *ImageScanExecutionHistory) error + type ImageScanHistoryRepositoryImpl struct + func NewImageScanHistoryRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *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) 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 struct + EnvironmentName string + Id int + LastChecked time.Time + ObjectName string + ObjectType string + ScanObjectMetaId int + SecurityScan string + TotalCount int + type ImageScanObjectMeta struct + Active bool + Id int + Image string + Name string + type ImageScanObjectMetaRepository interface + FindAll func() ([]*ImageScanObjectMeta, error) + FindByNameAndType func(name string, types string) ([]*ImageScanObjectMeta, error) + FindOne func(id int) (*ImageScanObjectMeta, error) + Save func(model *ImageScanObjectMeta) error + Update func(model *ImageScanObjectMeta) error + type ImageScanObjectMetaRepositoryImpl struct + func NewImageScanObjectMetaRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *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 interface + FetchByScanExecutionId func(id int) ([]*ImageScanExecutionResult, error) + FetchByScanExecutionIds func(ids []int) ([]*ImageScanExecutionResult, error) + FindAll func() ([]*ImageScanExecutionResult, error) + FindByCveName func(name string) ([]*ImageScanExecutionResult, error) + FindByImage func(image string) ([]*ImageScanExecutionResult, error) + FindByImageDigest func(imageDigest string) ([]*ImageScanExecutionResult, error) + FindByImageDigests func(digest []string) ([]*ImageScanExecutionResult, error) + FindOne func(id int) (*ImageScanExecutionResult, error) + Save func(model *ImageScanExecutionResult) error + Update func(model *ImageScanExecutionResult) error + type ImageScanResultRepositoryImpl struct + func NewImageScanResultRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *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 struct + Format ResourceScanFormat + Id int + ImageScanExecutionHistoryId int + ScanDataJson string + ScanToolId int + Types []ResourceScanType + type ResourceScanFormat int + type ResourceScanResultRepository interface + SaveInBatch func(tx *pg.Tx, models []*ResourceScanExecutionResult) error + type ResourceScanResultRepositoryImpl struct + func NewResourceScanResultRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ResourceScanResultRepositoryImpl + func (impl ResourceScanResultRepositoryImpl) SaveInBatch(tx *pg.Tx, models []*ResourceScanExecutionResult) error + type ResourceScanType int + type ScanTargetType string + type ScanToolExecutionHistoryMapping struct + ErrorMessage string + ExecutionFinishTime time.Time + ExecutionStartTime time.Time + Id int + ImageScanExecutionHistoryId int + ScanToolId int + State serverBean.ScanExecutionProcessState + TryCount int + type ScanToolExecutionHistoryMappingRepository interface + FetchScanHistoryMappingsUsingImageAndImageDigest func(image, imageDigest string) ([]*ScanToolExecutionHistoryMapping, error) + GetAllScanHistoriesByExecutionHistoryIdAndStates func(executionHistoryId int, states []serverBean.ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error) + GetAllScanHistoriesByExecutionHistoryIds func(ids []int) ([]*ScanToolExecutionHistoryMapping, error) + GetAllScanHistoriesByState func(state serverBean.ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error) + MarkAllRunningStateAsFailedHavingTryCountReachedLimit func(tryCount int) error + Save func(model *ScanToolExecutionHistoryMapping) error + SaveInBatch func(models []*ScanToolExecutionHistoryMapping) error + UpdateStateByToolAndExecutionHistoryId func(executionHistoryId, toolId int, state serverBean.ScanExecutionProcessState, ...) error + type ScanToolExecutionHistoryMappingRepositoryImpl struct + func NewScanToolExecutionHistoryMappingRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ScanToolExecutionHistoryMappingRepositoryImpl + func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) FetchScanHistoryMappingsUsingImageAndImageDigest(image, imageDigest string) ([]*ScanToolExecutionHistoryMapping, error) + func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIdAndStates(executionHistoryId int, states []serverBean.ScanExecutionProcessState) ([]*ScanToolExecutionHistoryMapping, error) + func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByExecutionHistoryIds(ids []int) ([]*ScanToolExecutionHistoryMapping, error) + func (repo *ScanToolExecutionHistoryMappingRepositoryImpl) GetAllScanHistoriesByState(state serverBean.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 serverBean.ScanExecutionProcessState, ...) error + type ScanToolMetadata struct + Active bool + Deleted bool + Id int + Name string + ResultDescriptorTemplate string + ScanTarget ScanTargetType + ServerBaseUrl string + ToolMetaData string + Version string + type ScanToolMetadataRepository interface + FindActiveById func(id int) (*ScanToolMetadata, error) + FindActiveTool func() (*ScanToolMetadata, error) + FindActiveToolByScanTarget func(scanTarget ScanTargetType) (*ScanToolMetadata, error) + FindAllActiveTools func() ([]*ScanToolMetadata, error) + FindByNameAndVersion func(name, version string) (*ScanToolMetadata, error) + MarkOtherToolsInActive func(toolName string, tx *pg.Tx, version string) error + MarkToolAsActive func(toolName, version string, tx *pg.Tx) error + MarkToolDeletedById func(id int) error + Save func(model *ScanToolMetadata) (*ScanToolMetadata, error) + Update func(model *ScanToolMetadata) (*ScanToolMetadata, error) + type ScanToolMetadataRepositoryImpl struct + func NewScanToolMetadataRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *ScanToolMetadataRepositoryImpl + func (repo *ScanToolMetadataRepositoryImpl) FindActiveById(id int) (*ScanToolMetadata, error) + func (repo *ScanToolMetadataRepositoryImpl) FindActiveTool() (*ScanToolMetadata, error) + func (repo *ScanToolMetadataRepositoryImpl) FindActiveToolByScanTarget(scanTargetType ScanTargetType) (*ScanToolMetadata, error) + func (repo *ScanToolMetadataRepositoryImpl) FindAllActiveTools() ([]*ScanToolMetadata, error) + func (repo *ScanToolMetadataRepositoryImpl) FindByNameAndVersion(name, version string) (*ScanToolMetadata, error) + func (repo *ScanToolMetadataRepositoryImpl) MarkOtherToolsInActive(toolName string, tx *pg.Tx, version string) error + func (repo *ScanToolMetadataRepositoryImpl) MarkToolAsActive(toolName, version string, tx *pg.Tx) error + func (repo *ScanToolMetadataRepositoryImpl) MarkToolDeletedById(id int) error + func (repo *ScanToolMetadataRepositoryImpl) Save(model *ScanToolMetadata) (*ScanToolMetadata, error) + func (repo *ScanToolMetadataRepositoryImpl) Update(model *ScanToolMetadata) (*ScanToolMetadata, error) + type SourceSubType int + const SourceSubTypeCi + const SourceSubTypeManifest + type SourceType int + const SourceTypeCode + const SourceTypeImage + const SourceTypeSbom + type VulnerabilityExposure struct + AppId int + AppName string + AppType helper.AppType + Blocked bool + ChartEnvId int + EnvId int + EnvName string + PipelineEnvId int + type VulnerabilityExposureListingResponse struct + Offset int + Size int + Total int + VulnerabilityExposure []*VulnerabilityExposure + type VulnerabilityRequest struct + AppName string + ClusterIds []int + CveName string + EnvIds []int + Offset int + Size int