report

package
v0.50.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 20 Imported by: 9

Documentation

Index

Constants

View Source
const (
	AllReport     = "all"
	SummaryReport = "summary"
)
View Source
const (
	NamespaceColumn         = "Namespace"
	ResourceColumn          = "Resource"
	VulnerabilitiesColumn   = "Vulnerabilities"
	MisconfigurationsColumn = "Misconfigurations"
	SecretsColumn           = "Secrets"
	RbacAssessmentColumn    = "RBAC Assessment"
)

Variables

This section is empty.

Functions

func ColumnHeading added in v0.30.0

func ColumnHeading(scanners types.Scanners, components, availableColumns []string) []string

func InfraColumns added in v0.33.0

func InfraColumns() []string

func RoleColumns added in v0.30.0

func RoleColumns() []string

func SeparateMisconfigReports added in v0.43.0

func SeparateMisconfigReports(k8sReport Report, scanners types.Scanners, components []string) []reports

SeparateMisconfigReports returns 3 reports based on scanners and components flags, - misconfiguration report - rbac report - infra checks report

func WorkloadColumns added in v0.30.0

func WorkloadColumns() []string

Types

type ConsolidatedReport

type ConsolidatedReport struct {
	SchemaVersion int `json:",omitempty"`
	ClusterName   string
	Findings      []Resource `json:",omitempty"`
}

ConsolidatedReport represents a kubernetes scan report with consolidated findings

type CycloneDXWriter added in v0.43.0

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

CycloneDXWriter implements types.Writer

func NewCycloneDXWriter added in v0.43.0

func NewCycloneDXWriter(output io.Writer, format cdx.BOMFileFormat, appVersion string) CycloneDXWriter

NewCycloneDXWriter constract new CycloneDXWriter

func (CycloneDXWriter) Write added in v0.43.0

func (w CycloneDXWriter) Write(ctx context.Context, component *core.BOM) error

type JSONWriter

type JSONWriter struct {
	Output io.Writer
	Report string
}

func (JSONWriter) Write

func (jw JSONWriter) Write(report Report) error

Write writes the results in JSON format

type Option

type Option struct {
	Format        types.Format
	Report        string
	Output        io.Writer
	Severities    []dbTypes.Severity
	ColumnHeading []string
	Scanners      types.Scanners
	Components    []string
	APIVersion    string
}

type Report

type Report struct {
	SchemaVersion int `json:",omitempty"`
	ClusterName   string
	Resources     []Resource `json:",omitempty"`
	BOM           *core.BOM  `json:"-"`
	// contains filtered or unexported fields
}

Report represents a kubernetes scan report

func (Report) Failed

func (r Report) Failed() bool

Failed returns whether the k8s report includes any vulnerabilities or misconfigurations

func (Report) PrintErrors added in v0.43.0

func (r Report) PrintErrors()

type Resource

type Resource struct {
	Namespace string `json:",omitempty"`
	Kind      string
	Name      string
	Metadata  types.Metadata `json:",omitempty"`
	Results   types.Results  `json:",omitempty"`
	Error     string         `json:",omitempty"`

	// original report
	Report types.Report `json:"-"`
}

Resource represents a kubernetes resource report

func CreateResource

func CreateResource(artifact *artifacts.Artifact, report types.Report, err error) Resource

type SummaryWriter

type SummaryWriter struct {
	Output           io.Writer
	Severities       []string
	SeverityHeadings []string
	ColumnsHeading   []string
}

func NewSummaryWriter

func NewSummaryWriter(output io.Writer, requiredSevs []dbTypes.Severity, columnHeading []string) SummaryWriter

func (SummaryWriter) Write

func (s SummaryWriter) Write(report Report) error

Write writes the results in a summarized table format

type TableWriter

type TableWriter struct {
	Report        string
	Output        io.Writer
	Severities    []dbTypes.Severity
	ColumnHeading []string
}

func (TableWriter) Write

func (tw TableWriter) Write(ctx context.Context, report Report) error

type Writer

type Writer interface {
	Write(Report) error
}

Writer defines the result write operation

Jump to

Keyboard shortcuts

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