scanner

package
v2.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunScanner

func RunScanner(configPath string, stop <-chan struct{})

RunScanner ...

Types

type Config

type Config struct {
	Hub         HubConfig
	ImageFacade ImageFacadeConfig
	Perceptor   PerceptorConfig
	Scanner     ScannerConfig

	LogLevel string
}

Config ...

func GetConfig

func GetConfig(configPath string) (*Config, error)

GetConfig ...

func (*Config) GetLogLevel

func (config *Config) GetLogLevel() (log.Level, error)

GetLogLevel ...

type HubConfig

type HubConfig struct {
	User           string
	PasswordEnvVar string
	Port           int
}

HubConfig ...

type ImageFacadeClient

type ImageFacadeClient struct {
	ImageFacadeHost string
	ImageFacadePort int
	// contains filtered or unexported fields
}

ImageFacadeClient ...

func NewImageFacadeClient

func NewImageFacadeClient(imageFacadeHost string, imageFacadePort int) *ImageFacadeClient

NewImageFacadeClient ...

func (*ImageFacadeClient) PullImage

func (ifp *ImageFacadeClient) PullImage(image *common.Image) error

PullImage ...

type ImageFacadeClientInterface

type ImageFacadeClientInterface interface {
	PullImage(image *common.Image) error
}

ImageFacadeClientInterface ...

type ImageFacadeConfig

type ImageFacadeConfig struct {
	Host string
	Port int
}

ImageFacadeConfig ...

func (*ImageFacadeConfig) GetHost

func (ifc *ImageFacadeConfig) GetHost() string

GetHost ...

type Manager

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

Manager ...

func NewManager

func NewManager(config *Config, stop <-chan struct{}) (*Manager, error)

NewManager ...

func (*Manager) StartRequestingScanJobs

func (sm *Manager) StartRequestingScanJobs()

StartRequestingScanJobs will start asking for work

type OSType

type OSType int

OSType describes the state of an image in perceptor

const (
	OSTypeLinux OSType = iota
	OSTypeMac   OSType = iota
)

.....

func (OSType) String

func (t OSType) String() string

String .....

type PerceptorClient

type PerceptorClient struct {
	Resty *resty.Client
	Host  string
	Port  int
}

PerceptorClient ...

func NewPerceptorClient

func NewPerceptorClient(host string, port int) *PerceptorClient

NewPerceptorClient ...

func (*PerceptorClient) GetNextImage

func (pc *PerceptorClient) GetNextImage() (*api.NextImage, error)

GetNextImage ...

func (*PerceptorClient) PostFinishedScan

func (pc *PerceptorClient) PostFinishedScan(scan *api.FinishedScanClientJob) error

PostFinishedScan ...

type PerceptorClientInterface

type PerceptorClientInterface interface {
	GetNextImage() (*api.NextImage, error)
	PostFinishedScan(scan *api.FinishedScanClientJob) error
}

PerceptorClientInterface ...

type PerceptorConfig

type PerceptorConfig struct {
	Host string
	Port int
}

PerceptorConfig ...

type ScanClient

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

ScanClient implements ScanClientInterface using the Black Duck hub and scan client programs.

func NewScanClient

func NewScanClient(username string, password string, port int) (*ScanClient, error)

NewScanClient requires hub login credentials

func (*ScanClient) Scan

func (sc *ScanClient) Scan(host string, path string, projectName string, versionName string, scanName string) error

Scan ...

func (*ScanClient) ScanSh

func (sc *ScanClient) ScanSh(host string, path string, projectName string, versionName string, scanName string) error

ScanSh invokes scan.cli.sh example:

BD_HUB_PASSWORD=??? ./bin/scan.cli.sh --host ??? --port 443 --scheme https --username sysadmin --insecure --name ??? --release ??? --project ??? ???.tar

type ScanClientInfo

type ScanClientInfo struct {
	HubVersion string
	RootPath   string
	OSType     OSType
}

ScanClientInfo ...

func DownloadScanClient

func DownloadScanClient(osType OSType, cliRootPath string, hubHost string, hubUser string, hubPassword string, hubPort int, timeout time.Duration) (*ScanClientInfo, error)

DownloadScanClient ...

func NewScanClientInfo

func NewScanClientInfo(hubVersion string, rootPath string, osType OSType) *ScanClientInfo

NewScanClientInfo ...

func (*ScanClientInfo) ScanCliImplJarPath

func (sci *ScanClientInfo) ScanCliImplJarPath() string

ScanCliImplJarPath ...

func (*ScanClientInfo) ScanCliJarPath

func (sci *ScanClientInfo) ScanCliJarPath() string

ScanCliJarPath ...

func (*ScanClientInfo) ScanCliJavaPath

func (sci *ScanClientInfo) ScanCliJavaPath() string

ScanCliJavaPath ...

func (*ScanClientInfo) ScanCliShPath

func (sci *ScanClientInfo) ScanCliShPath() string

ScanCliShPath ...

func (*ScanClientInfo) ScanCliZipPath

func (sci *ScanClientInfo) ScanCliZipPath() string

ScanCliZipPath ...

type ScanClientInterface

type ScanClientInterface interface {
	Scan(host string, path string, projectName string, versionName string, scanName string) error
}

ScanClientInterface ...

type Scanner

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

Scanner ...

func NewScanner

func NewScanner(ifClient ImageFacadeClientInterface, scanClient ScanClientInterface, imageDirectory string, stop <-chan struct{}) *Scanner

NewScanner ...

func (*Scanner) ScanFile

func (scanner *Scanner) ScanFile(host string, path string, hubProjectName string, hubVersionName string, hubScanName string) error

ScanFile runs the scan client against a single file

func (*Scanner) ScanFullDockerImage

func (scanner *Scanner) ScanFullDockerImage(apiImage *api.ImageSpec) error

ScanFullDockerImage runs the scan client on a full tar from 'docker export'

type ScannerConfig

type ScannerConfig struct {
	ImageDirectory          string
	Port                    int
	HubClientTimeoutSeconds int
}

ScannerConfig ...

func (*ScannerConfig) GetImageDirectory

func (config *ScannerConfig) GetImageDirectory() string

GetImageDirectory ...

Jump to

Keyboard shortcuts

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