report

package
v3.9.1-2864 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControlIDColumn   = "ID"
	SeverityColumn    = "Severity"
	ControlNameColumn = "Control Name"
	StatusColumn      = "Status"
	IssuesColumn      = "Issues"
)

Variables

This section is empty.

Functions

func Write

func Write(report *ComplianceReport, option Option) error

Write writes the results in the give format

Types

type ComplianceReport

type ComplianceReport struct {
	ID               string
	Title            string
	Description      string
	Version          string
	RelatedResources []string
	Results          []*ControlCheckResult
}

ComplianceReport represents a kubernetes scan report

func BuildComplianceReport

func BuildComplianceReport(scanResults []types.Results, cs spec.ComplianceSpec) (*ComplianceReport, error)

type ControlCheckResult

type ControlCheckResult struct {
	ID            string
	Name          string
	Description   string
	DefaultStatus defsecTypes.ControlStatus `json:",omitempty"`
	Severity      string
	Results       types.Results
}

type ControlCheckSummary

type ControlCheckSummary struct {
	ID        string
	Name      string
	Severity  string
	TotalFail *int `json:",omitempty"`
}

type JSONWriter

type JSONWriter struct {
	Output io.Writer
	Report string
}

func (JSONWriter) Write

func (jw JSONWriter) Write(report *ComplianceReport) 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
}

type SummaryReport

type SummaryReport struct {
	SchemaVersion   int `json:",omitempty"`
	ID              string
	Title           string
	SummaryControls []ControlCheckSummary `json:",omitempty"`
}

SummaryReport represents a kubernetes scan report with consolidated findings

func BuildSummary

func BuildSummary(cr *ComplianceReport) *SummaryReport

type SummaryWriter

type SummaryWriter struct {
	Output io.Writer
}

func NewSummaryWriter

func NewSummaryWriter(output io.Writer) SummaryWriter

func (SummaryWriter) Write

func (s SummaryWriter) Write(report *ComplianceReport) 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(report *ComplianceReport) error

type Writer

type Writer interface {
	Write(ComplianceReport) 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