findings

package
v0.0.0-...-c7f552b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFixableVulnCount

func GetFixableVulnCount(cli *client.Client, i images.ImageFinding) int

GetFixableVulnCount - updates the ImageFinding.FixVersion by looping through the images vulnerabilities Param: cli: *client.Client - The aqua-sdk-go client Param: i: ImageFinding - The image response object Return: int - The FixVersion count

func GetScanHistory

func GetScanHistory(cli *client.Client, registry, image, tag string) []images.ScanHistoryFinding

GetScanHistory calls the aqua-sdk-go GetScanHistory call Param: cli: *client.Client - Aqua client from aqua-sdk-go Param: registry: string - Name of the Aqua configured registry Param: image: string - Name of the image to retrieve scan history Param: tag: string - Image tag Return: []ScanHistoryFinding - slice of ScanHistoryFinding struct for the image

func GetTags

func GetTags(cli *client.Client, image images.Image, q chan images.Tag)

func GetTemplate

func GetTemplate(regData, topData string) string

GetTemplate retrieves the final HTML to be written Param: regData: string - The 'registries: []' data to be replaced Param: topData: string - The 'images: []' data to be replaced Return: string - the findings HTML string

func Handler

func Handler(w http.ResponseWriter, r *http.Request)

Handler needs to handle the incoming request and execute the finding report generation Param: http.ResponseWriter - writer to send back to requester Param: *http.Request - request

func MapContainerToImage

func MapContainerToImage(cl containers.Containers, i images.ImageFinding) bool

MapContainerToImage associates a running container with an image Param: cl: containers.Containers - slice of running containers Param: i: images.ImageFinding - the image to map Return: bool - the value of Running

func MapImageToRegistry

func MapImageToRegistry(rl []registries.RegistryFinding, il []images.ImageFinding)

MapImageToRegistry associates the images to their registry Param: rl: []registries.RegistryFinding - slice of Registry objects Param: il: []images.ImageFinding - slice of Images

func TagHandler

func TagHandler(w http.ResponseWriter, r *http.Request)

TagHandler receives the http request, collects the tag history for all images and returns status to requester

Types

type Finding

type Finding findings.Finding

func (*Finding) Get

func (f *Finding) Get(params map[string]string, queue chan reports.Response) reports.Response

Get - generate the finding report Param: map[string]string - Map of request parameters Param: chan reports.Response - Channel that accepts the JSON response from each finding (TODO) Return: reports.Response - the Json response sent to the requester

func (Finding) ProcessImage

func (f Finding) ProcessImage(cli *client.Client, i imagessdk.Image, q chan images.ImageFinding, cl containers.Containers)

ProcessImage creates an ImageFinding object and sends it to the channel Param: cli: *client.Client - The client from aqua-sdk-go Param: i: SingleResponse - The image response object from the client Param: q: chan ImageFinding - The queue that receives the ImageFinding object Param: cl: Containers - This slice of containers to map is_running

type RepositoryHistory

type RepositoryHistory []images.History

func (*RepositoryHistory) Get

func (rh *RepositoryHistory) Get(params map[string]string, queue chan reports.Response) reports.Response

Jump to

Keyboard shortcuts

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