clairService

package
v0.0.0-...-5cd06b7 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 28 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
	GetRoundTripper(ctx context.Context, ref string, authenticator authn.Authenticator) (http.RoundTripper, error)
}

type ClairServiceImpl

type ClairServiceImpl struct {
	// contains filtered or unexported fields
}

func NewClairServiceImpl

func NewClairServiceImpl(logger *zap.SugaredLogger, clairConfig *ClairConfig,
	httpClient *http.Client, imageScanService security.ImageScanService,
	dockerArtifactStoreRepository repository.DockerArtifactStoreRepository,
	scanToolMetadataRepository repository.ScanToolMetadataRepository) *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) GetAuthenticatorByDockerRegistryId

func (impl *ClairServiceImpl) GetAuthenticatorByDockerRegistryId(dockerRegistryId string) (authn.Authenticator, error)

func (*ClairServiceImpl) GetRoundTripper

func (impl *ClairServiceImpl) GetRoundTripper(ctx context.Context, ref string, authenticator authn.Authenticator) (http.RoundTripper, 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