service

package
v0.0.0-...-ddeca49 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success CheckResult = "success"
	Error               = "error"
	Warning             = "warning"
	NoData              = "nodata"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Id               string      `json:"id"`
	Description      string      `json:"description"`
	GroupName        string      `json:"group"`
	ResourceCategory string      `json:"category"`
	ResourceFullName string      `json:"resourceName"`
	Result           CheckResult `json:"result"`
}

type CheckResult

type CheckResult string

type ClusterSummary

type ClusterSummary struct {
	Name            string `json:"name"`
	Version         string `json:"version"`
	NodesCount      int    `json:"nodes"`
	NamespacesCount int    `json:"namespaces"`
	PodsCount       int    `json:"pods"`
	Score           uint   `json:"score"`
	Grade           string `json:"grade"`
}

type Handler

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

func NewHandler

func NewHandler(c *config.Config, port int, basePath string) *Handler

func (*Handler) GetRouter

func (h *Handler) GetRouter() *mux.Router

type ImageScanResult

type ImageScanResult struct {
	Image       string                 `json:"image"`
	ScanResult  string                 `json:"scanResult"`
	Description string                 `json:"description"`
	Counters    []VulnerabilityCounter `json:"counters"`
	Attributes  []string               `json:"attributes"`
	Pods        []string               `json:"pods"`
}

ImageScanResult is a short description of a single container image vulnerabilities audit

type ImageScansSummary

type ImageScansSummary struct {
	Images []ImageScanResult `json:"images"`
}

ImageScansSummary represents a summary of container images vulnerabilities audit

func CreateImageScansSummary

func CreateImageScansSummary(pods []corev1.Pod, scans []scanner.ImageScanResultSummary) *ImageScansSummary

type KubeOverview

type KubeOverview struct {
	Cluster             ClusterSummary  `json:"cluster"`
	Checks              []Check         `json:"checks"`
	CheckGroupSummary   []ResultSummary `json:"checkGroupSummary"`
	NamespaceSummary    []ResultSummary `json:"namespaceSummary"`
	CheckResultsSummary ResultSummary   `json:"checkResultsSummary"`
}

func CreateKubeOverview

func CreateKubeOverview(kube *kube.ResourceProvider, auditData *validator.AuditData, imageScanner *scanner.ImageScanner) *KubeOverview

type RequestAuditResponse

type RequestAuditResponse struct {
	RequestId string `json:"requestId"`
}

RequestAuditResponse DTO to represent a new scan/audit response

type ResultSummary

type ResultSummary struct {
	Name      string `json:"resultName"`
	Successes uint
	Warnings  uint
	Errors    uint
	NoDatas   uint
}

func (*ResultSummary) Add

func (result *ResultSummary) Add(checkResult CheckResult)

type VulnerabilityCounter

type VulnerabilityCounter struct {
	Severity string `json:"severity"`
	Count    int    `json:"count"`
}

VulnerabilityCounter represents amount of issues with specified severity

Jump to

Keyboard shortcuts

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