clairService

package
v0.0.0-...-a328902 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLAIR_INDEX_REPORT_URL         = "/indexer/api/v1/index_report"
	CLAIR_VULNERABILITY_REPORT_URL = "/matcher/api/v1/vulnerability_report"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClairConfig

type ClairConfig struct {
	ClairAddress string `env:"CLAIR_ADDR" envDefault:"http://localhost:6060"`
}

func GetClairConfig

func GetClairConfig() (*ClairConfig, error)

type ClairService

type ClairService interface {
	ScanImage(scanEvent *common.ImageScanEvent, tool *repository.ScanToolMetadata, executionHistory *repository.ImageScanExecutionHistory) (*common.ScanEventResponse, error)
	CheckIfIndexReportExistsForManifestHash(manifestHash claircore.Digest) (bool, error)
	CreateIndexReportFromManifest(manifest *claircore.Manifest) error
	GetVulnerabilityReportFromManifestHash(manifestHash claircore.Digest) (*claircore.VulnerabilityReport, error)
	DeleteIndexReportFromManifestHash(manifestHash claircore.Digest) error
}

type ClairServiceImpl

type ClairServiceImpl struct {
	Logger                        *zap.SugaredLogger
	ClairConfig                   *ClairConfig
	HttpClient                    *http.Client
	ImageScanService              security.ImageScanService
	DockerArtifactStoreRepository repository.DockerArtifactStoreRepository
	ScanToolMetadataRepository    repository.ScanToolMetadataRepository
	RoundTripperService           roundTripper.RoundTripperService
}

func NewClairServiceImpl

func NewClairServiceImpl(logger *zap.SugaredLogger, clairConfig *ClairConfig,
	httpClient *http.Client, imageScanService security.ImageScanService,
	dockerArtifactStoreRepository repository.DockerArtifactStoreRepository,
	scanToolMetadataRepository repository.ScanToolMetadataRepository, roundTripperService roundTripper.RoundTripperService) *ClairServiceImpl

func (*ClairServiceImpl) CheckIfIndexReportExistsForManifestHash

func (impl *ClairServiceImpl) CheckIfIndexReportExistsForManifestHash(manifestHash claircore.Digest) (bool, error)

func (*ClairServiceImpl) CreateClairManifest

func (impl *ClairServiceImpl) CreateClairManifest(scanEvent *common.ImageScanEvent) (*claircore.Manifest, error)

func (*ClairServiceImpl) CreateIndexReportFromManifest

func (impl *ClairServiceImpl) CreateIndexReportFromManifest(manifest *claircore.Manifest) error

func (*ClairServiceImpl) DeleteIndexReportFromManifestHash

func (impl *ClairServiceImpl) DeleteIndexReportFromManifestHash(manifestHash claircore.Digest) error

func (*ClairServiceImpl) GenerateClairManifestFromImage

func (impl *ClairServiceImpl) GenerateClairManifestFromImage(image v1.Image, reference name.Reference, roundTripper http.RoundTripper) (*claircore.Manifest, error)

func (*ClairServiceImpl) GetVulnerabilityReportFromClair

func (impl *ClairServiceImpl) GetVulnerabilityReportFromClair(scanEvent *common.ImageScanEvent) (*claircore.VulnerabilityReport, error)

func (*ClairServiceImpl) GetVulnerabilityReportFromManifestHash

func (impl *ClairServiceImpl) GetVulnerabilityReportFromManifestHash(manifestHash claircore.Digest) (*claircore.VulnerabilityReport, error)

func (*ClairServiceImpl) ScanImage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL