crawler

package
v0.0.0-...-d1992f0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMD5Hash

func GetMD5Hash(text string) string

GetMD5Hash returns a MD5 hash of a string

func K8s

func K8s(c *K8sCrawler)

K8s func init

func ParseImageDigest

func ParseImageDigest(imageDigestPath string) (imageDigest string, err error)

ParseImageDigest func init

func ParseImageTagPath

func ParseImageTagPath(imagePath string) (imageRegistry, imageRepo, imagTag, imageDigest string, err error)

ParseImageTagPath func init

func Registry

func Registry(backend datastore.Backend, cc clairclient.Client, regCrawler *RegCrawler)

Registry crawler gets a list of images including their manifests and layers from a defined Docker V2 registry. Then a semaphore channel is opened and the images are fed to the Clair instances for scanning.

func ScanImage

func ScanImage(db datastore.Backend, cc clairclient.Client, token *docker.Token, image *docker.Image) (*datastore.Image, error)

ScanImage sends a single image to Clair

Types

type K8sCrawler

type K8sCrawler struct {
	CrawlerID   int64
	Store       datastore.Backend
	Context     string
	KubeConfig  *clientcmdapi.Config
	MaxThreads  uint
	RegAuth     []map[string]string
	ClairClient clairclient.Client
	Scan        bool
}

K8sCrawler struct init

func (*K8sCrawler) GetContainerImages

func (c *K8sCrawler) GetContainerImages() ([]*datastore.Container, string, error)

GetContainerImages func init

func (*K8sCrawler) GetStoredCredentials

func (c *K8sCrawler) GetStoredCredentials(dc *datastore.Container) (username, password string, match bool)

GetStoredCredentials func init

func (*K8sCrawler) ScanContainerImage

func (c *K8sCrawler) ScanContainerImage(dc *datastore.Container, user, pass string) error

ScanContainerImage func init

type RegCrawler

type RegCrawler struct {
	CrawlerID   int64
	MaxThreads  uint
	Username    string
	Password    string
	RegistryURL string
	Token       *docker.Token
	Repos       map[string]interface{} `json:"repos"`
	Tags        map[string]interface{} `json:"tags"`
}

RegCrawler configuration struct

Jump to

Keyboard shortcuts

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