cs

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

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

Go to latest
Published: May 22, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnchoreAction

func AnchoreAction(workFlows WorkflowResponse, CurrentWFDIndex int, action string)

AnchoreAction will perform in action using the anchore-cli. Currently used to 'add' and 'wait' on images

func CheckWorkflowID

func CheckWorkflowID(workflowID string, workFlows WorkflowResponse) (int, bool)

CheckWorkflowID Checks if workflow ID exists

func GetAllImageAnalysis

func GetAllImageAnalysis(workFlows WorkflowResponse) []byte

GetAllImageAnalysis returns all the reports for all images

func GetAnchoreInfo

func GetAnchoreInfo() map[string]string

GetAnchoreInfo returns the parameters to be used with the Anchore engine

func GetReport

func GetReport(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)

GetReport gets the requested upon Anchore reports

func GetWorkflowImages

func GetWorkflowImages(workFlow workflowdefinition.WorkflowDefinition) []string

GetWorkflowImages Returns a List of images in the provided Workflow

func WorkflowDefinitionCreate

func WorkflowDefinitionCreate(msg *stan.Msg)

WorkflowDefinitionCreate logs when a WorkflowDefinition is created

func WorkflowDefinitionFinished

func WorkflowDefinitionFinished(msg *stan.Msg)

WorkflowDefinitionFinished is used to parse through Workflow, retrieve docker image id's then analyze docker image using Anchore

Types

type ImageReport

type ImageReport struct {
	ImageID           string          `json:"imageID"`
	ImageDigest       string          `json:"imageDigest"`
	Vulnerabilities   []Vulnerability `json:"vulnerabilities"`
	VulnerabilityType string          `json:"vulnerability_type"`
}

ImageReport is the vulnerability report of a single image

func GetImageAnalysis

func GetImageAnalysis(Images []string) []ImageReport

GetImageAnalysis get analysis of provided image(s)

type Vulnerability

type Vulnerability struct {
	Feed           string `json:"feed"`
	FeedGroup      string `json:"feed_group"`
	Fix            string `json:"fix"`
	NvdData        []nvd  `json:"nvd_data"`
	Package        string `json:"package"`
	PackageCPE     string `json:"package_cpe"`
	PackageCPE23   string `json:"package_cpe23"`
	PackageName    string `json:"package_name"`
	PackagePath    string `json:"package_path"`
	PackageType    string `json:"package_type"`
	PackageVersion string `json:"package_version"`
	Severity       string `json:"severity"`
	URL            string `json:"url"`
	VendorData     []nvd  `json:"vendor_data"`
	Vuln           string `json:"vuln"`
}

Vulnerability struct has metadata of found vulnerability

type WFDReports

type WFDReports struct {
	Reports []ImageReport
}

WFDReports has list of all reports

type WorkflowResponse

type WorkflowResponse struct {
	Error               *common.Error
	WorkflowDefinitions []workflowdefinition.WorkflowDefinition `json:"data"`
}

WorkflowResponse struct is used to parse through PublishRequest result

Jump to

Keyboard shortcuts

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