Documentation ¶
Index ¶
- Constants
- Variables
- func FindLocationFromStatus(status *Status) []string
- func FindScanStatusFile(path string) (string, error)
- type Client
- func (c *Client) DownloadDetect() error
- func (c *Client) DownloadDetectIfNotExists() error
- func (c *Client) GetAllSquashedScanFlags(squashedImageTarFilePath, fullImageName string) string
- func (c *Client) GetAllUnsquashedScanFlags(unsquashedImageTarFilePath string) string
- func (c *Client) GetBinaryAndSignatureScanFlags(imageTarFilePath string) string
- func (c *Client) GetBinaryScanOnlyFlags(imageTarFilePath string) string
- func (c *Client) GetCodeLocationNameFlag(codeLocationName string) string
- func (c *Client) GetConcurrentDockerInspectorScanFlags() string
- func (c *Client) GetDetectDockerImageDefaultScanFlags(fullImageName string) string
- func (c *Client) GetDockerInspectorAndSignatureOnlyScanFlags(fullImageName string) string
- func (c *Client) GetDockerInspectorScanOnlyFlags(fullImageName string) string
- func (c *Client) GetPersistentDockerInspectorServicesFlags() string
- func (c *Client) GetProjectNameFlag(projectName string) string
- func (c *Client) GetProjectVersionNameFlag(projectVersionName string) string
- func (c *Client) GetSignatureScanOnlyFlags(imageTarFilePath string) string
- func (c *Client) RunImageScan(fullImageName, projectName, imageName, imageTag, outputDirName, ... string) error
- func (c *Client) SetupPersistentDockerInspectorServices() error
- func (c *Client) StopAndCleanupPersistentDockerInspectorServices() error
- type Status
Constants ¶
const ( // TODO: maybe makes sense to put detect script under ~/blackduck as well (other than the bootstrap problem) DefaultDetectDownloadFilePath = "./detect.sh" DefaultDetectURL = "https://detect.synopsys.com/detect.sh" WindowsDetectURL = "https://detect.synopsys.com/detect.ps1" // Modified from here: https://github.com/blackducksoftware/blackduck-docker-inspector/blob/9.1.1/deployment/docker/runDetectAgainstDockerServices/setup.sh // TODO: keep sync'd to runDetectAgainstDockerServices.sh and/or delete that bash script RunDetectAgainstDockerServicesBashScript = `` /* 5565-byte string literal not displayed */ )
Variables ¶
var ( DefaultDetectBlackduckDirectory = fmt.Sprintf("%s/blackduck", util.GetHomeDir()) DefaultToolsDirectory = fmt.Sprintf("%s/tools", DefaultDetectBlackduckDirectory) )
Functions ¶
func FindLocationFromStatus ¶
func FindScanStatusFile ¶
Types ¶
type Client ¶
type Client struct { DetectPath string DetectURL string RestyClient *resty.Client DockerCLIClient *docker.DockerCLIClient }
func NewDefaultClient ¶
func NewDefaultClient() *Client
func (*Client) DownloadDetect ¶
func (*Client) DownloadDetectIfNotExists ¶
func (*Client) GetAllSquashedScanFlags ¶
GetAllSquashedScanFlags [squashed] docker-inspector + signature + binary
func (*Client) GetAllUnsquashedScanFlags ¶
GetAllUnsquashedScanFlags [unsquashed] docker-inspector + signature + binary
func (*Client) GetBinaryAndSignatureScanFlags ¶
GetBinaryAndSignatureScanFlags signature + binary scanners
func (*Client) GetBinaryScanOnlyFlags ¶
GetBinaryScanOnlyFlags binary scanner only
func (*Client) GetCodeLocationNameFlag ¶
GetCodeLocationNameFlag sets up the code location name flag
func (*Client) GetConcurrentDockerInspectorScanFlags ¶
GetConcurrentDockerInspectorScanFlags: ask inspector not to cleanup services it spins up to re-use; must wait a bit after first scan and then run concurrently TODO: not working, check application properties to see if flag actually gets passed
https://synopsys.atlassian.net/wiki/spaces/INTDOCS/pages/760381459/Concurrent+Execution
func (*Client) GetDetectDockerImageDefaultScanFlags ¶
GetDetectDockerImageDefaultScanFlags: this is the default scan that detect invokes (which is just docker-inspector + squashed signature scanner)
func (*Client) GetDockerInspectorAndSignatureOnlyScanFlags ¶
GetDockerInspectorAndSignatureOnlyScanFlags: explicitly only run DOCKER,SIGNATURE_SCAN scans for specified image
func (*Client) GetDockerInspectorScanOnlyFlags ¶
GetDockerInspectorScanOnlyFlags docker-inspector only
func (*Client) GetPersistentDockerInspectorServicesFlags ¶
GetPersistentDockerInspectorServicesFlags: flags to pass to detect if docker-inspector is setup to run on host with each image inspector service runs in a container https://blackducksoftware.github.io/blackduck-docker-inspector/latest/deployment/#deployment-sample-for-docker-using-persistent-image-inspector-services https://github.com/blackducksoftware/blackduck-docker-inspector/blob/9.1.1/deployment/docker/runDetectAgainstDockerServices/setup.sh#L111 https://synopsys.atlassian.net/wiki/spaces/INTDOCS/pages/760021042/Docker+Inspector+Properties
func (*Client) GetProjectNameFlag ¶
GetProjectNameFlag sets up the project name flag
func (*Client) GetProjectVersionNameFlag ¶
GetProjectVersionNameFlag sets up the project version name flag
func (*Client) GetSignatureScanOnlyFlags ¶
GetSignatureScanOnlyFlags signature scanner only
func (*Client) RunImageScan ¶
func (*Client) SetupPersistentDockerInspectorServices ¶
SetupPersistentDockerInspectorServices: sets up persistent docker services on host; goes together with GetPersistentDockerInspectorServicesFlags https://github.com/blackducksoftware/blackduck-docker-inspector/blob/9.1.1/deployment/docker/runDetectAgainstDockerServices/setup.sh
func (*Client) StopAndCleanupPersistentDockerInspectorServices ¶
type Status ¶
type Status struct { FormatVersion string `json:"formatVersion"` DetectVersion string `json:"detectVersion"` ProjectName string `json:"projectName"` ProjectVersion string `json:"projectVersion"` Detectors []interface{} `json:"detectors"` Status []struct { Key string `json:"key"` Status string `json:"status"` } `json:"status"` Issues []interface{} `json:"issues"` Results []struct { Location string `json:"location"` Message string `json:"message"` } `json:"results"` UnrecognizedPaths struct { } `json:"unrecognizedPaths"` CodeLocations []struct { CodeLocationName string `json:"codeLocationName"` } `json:"codeLocations"` }