Documentation ¶
Index ¶
Constants ¶
View Source
const ( FieldScopeReport FieldScope = "report" FieldScopeVulnerability FieldScope = "vulnerability" DefaultLabels string = "" /* 233-byte string literal not displayed */ )
View Source
const (
LabelGroupAll = "all"
)
Variables ¶
View Source
var ImageVulnerability *prometheus.GaugeVec
View Source
var VulnerabilityLabels []VulnerabilityLabel
Functions ¶
func GetLabelNames ¶
func GetLabelNames(list []VulnerabilityLabel) []string
func RegisterVulnerabilityCollector ¶
func RegisterVulnerabilityCollector(registry *prometheus.Registry, l string)
RegisterVulnerabilityCollector registers a prometheus type for image vulnerabilities
Types ¶
type Exporter ¶
type Exporter struct { Container *v1.Container Namespace string TrivyResult *types.Result Image *parser.Reference ImageDigest string }
Exporter represents a type which can publish prometheus metrics for scan results
func NewExporter ¶
func NewExporter(container *v1.Container, namespace string, trivyResult *types.Result, image *parser.Reference, imageDigest string) Exporter
NewExporter returns an Exporter type
func (Exporter) PublishReportMetrics ¶
func (e Exporter) PublishReportMetrics()
PublishReportMetrics publishes the trivy scan results for each vulnerability
type FieldScope ¶
type FieldScope string
type VulnerabilityLabel ¶
type VulnerabilityLabel struct { Name string Groups []string Scope FieldScope }
func GetMetricsLabels ¶
func GetMetricsLabels(l string) []VulnerabilityLabel
GetMetricsLabels returns a slice of VulnerabilityLabels from the labels string supplied in the config l = "image_digest, report_name, image_namespace.. etc"
Click to show internal directories.
Click to hide internal directories.