scan

package
v0.0.0-test Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 39 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddScanner

func AddScanner(id string) error

func CheckRegistry

func CheckRegistry(name string) bool

func FedRoleChangeNotify

func FedRoleChangeNotify(fedRole string)

func FixRegRepoForAdmCtrl

func FixRegRepoForAdmCtrl(result *share.ScanResult)

Normalize the request if the registry URL is added to the repo field

func GetAwsEcrAuthToken

func GetAwsEcrAuthToken(awsKey *share.CLUSAWSAccountKey, proxy string) (*awsEcrAuth, error)

func GetImageCVECount

func GetImageCVECount(name, id string) (int, int, int, error)

func GetProxy

func GetProxy(registry string) string

func GetRegistryCount

func GetRegistryCount() int

used internally, so access control

func GetRegistryState

func GetRegistryState(name string) string

func GetScannedImageSummary

func GetScannedImageSummary(reqImgRegistry utils.Set, reqImgRepo, reqImgTag string, vpf scanUtils.VPFInterface) []*nvsysadmission.ScannedImageSummary

func InitContext

func InitContext(ctx *Context, leader bool)

func IsRegistryImageScanned

func IsRegistryImageScanned(id string) bool

func LeadChangeNotify

func LeadChangeNotify(isLeader bool)

func RegTaskCount

func RegTaskCount() int

func RegistryConfigHandler

func RegistryConfigHandler(nType cluster.ClusterNotifyType, key string, value []byte)

func RegistryImageStateUpdate

func RegistryImageStateUpdate(name, id string, sum *share.CLUSRegistryImageSummary, calculateLayers bool, vpf scanUtils.VPFInterface) (
	utils.Set, []string, []string, []string, []scanUtils.FixedVulInfo, []scanUtils.FixedVulInfo, map[string][]string, map[string][]string, map[string][]string)

func RegistryScanCacheRefresh

func RegistryScanCacheRefresh(ctx context.Context, vpf scanUtils.VPFInterface)

func RegistryStateUpdate

func RegistryStateUpdate(name string, state *share.CLUSRegistryState)

Allow manual start/stop scan even if auto-scan is enabled, scan can be restarted manually or when new images added

func RemoveScanner

func RemoveScanner(id string) error

func ScannerChangeNotify

func ScannerChangeNotify(isScanner bool)

func ScannerDBChange

func ScannerDBChange(db *share.CLUSScannerDB)

func UpdateProxy

func UpdateProxy(httpProxy, httpsProxy *share.CLUSProxy)

Types

type Context

type Context struct {
	AuditQueue cluster.ObjectQueueInterface
	ScanChan   chan *resource.Event
	TimerWheel *utils.TimerWheel
	ScanLog    *log.Logger
	MutexLog   *log.Logger
	FedRole    string
}

type Registry

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

type ScanInterface

type ScanInterface interface {
	// registry
	GetRegistry(name string, acc *access.AccessControl) (*api.RESTRegistry, error)
	GetRegistryState(name string, acc *access.AccessControl) (*share.CLUSRegistryState, error)
	GetRegistrySummary(name string, acc *access.AccessControl) (*api.RESTRegistrySummary, error)
	GetAllRegistrySummary(scope string, acc *access.AccessControl) []*api.RESTRegistrySummary
	GetRegistryImageSummary(name string, vpf scanUtils.VPFInterface, acc *access.AccessControl) []*api.RESTRegistryImageSummary
	GetRegistryVulnerabilities(name string, vpf scanUtils.VPFInterface, showTag string, acc *access.AccessControl) (map[string][]*api.RESTVulnerability, map[string][]api.RESTIDName, error)
	GetRegistryBenches(name string, tagMap map[string][]string, acc *access.AccessControl) (map[string][]*api.RESTBenchItem, map[string][]api.RESTIDName, error)
	GetRegistryImageReport(name, id string, vpf scanUtils.VPFInterface, showTag string, tagMap map[string][]string, acc *access.AccessControl) (*api.RESTScanReport, error)
	GetRegistryLayersReport(name, id string, vpf scanUtils.VPFInterface, showTag string, acc *access.AccessControl) (*api.RESTScanLayersReport, error)
	GetRegistryDebugImages(source string) []*api.RESTRegistryDebugImage
	StartRegistry(name string) error
	StopRegistry(name string) error
	GetFedRegistryCache(getCfg, getNames bool) ([]*share.CLUSRegistryConfig, utils.Set)
	CheckRegistry(name string) bool
	GetRegistryImagesIDs(name string, vpf scanUtils.VPFInterface, showTag string, acc *access.AccessControl) ([]string, error)

	// GetScannedImageSummary(reqImgRegistry utils.Set, reqImgRepo, reqImgTag string, vpf scanUtils.VPFInterface) []*nvsysadmission.ScannedImageSummary
	// RegistryImageStateUpdate(name, id string, sum *share.CLUSRegistryImageSummary, vpf scanUtils.VPFInterface) (utils.Set, []string, []string)
	StoreRepoScanResult(result *share.ScanResult) error
	TestRegistry(ctx context.Context, config *share.CLUSRegistryConfig, tracer httptrace.HTTPTrace) error
}

func Init

func Init(ctx *Context, leader bool) ScanInterface

Jump to

Keyboard shortcuts

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