spec

package
v0.0.0-...-82b092a Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateAllChecksBySpecID

func AggregateAllChecksBySpecID(multiResults []types.Results, cs ComplianceSpec) map[string]types.Results

AggregateAllChecksBySpecID aggregates all scan results and map it to spec ids

func MapSpecCheckIDToFilteredResults

func MapSpecCheckIDToFilteredResults(result types.Result, checkIDs map[types.Scanner][]string) map[string]types.Results

MapSpecCheckIDToFilteredResults map spec check id to filtered scan results

Types

type ComplianceSpec

type ComplianceSpec struct {
	Spec Spec `yaml:"spec"`
}

ComplianceSpec represent the compliance specification

func GetComplianceSpec

func GetComplianceSpec(specNameOrPath string) (ComplianceSpec, error)

GetComplianceSpec accepct compliance flag name/path and return builtin or file system loaded spec

func (*ComplianceSpec) CheckIDs

func (cs *ComplianceSpec) CheckIDs() map[types.Scanner][]string

CheckIDs return list of compliance check IDs

func (*ComplianceSpec) Scanners

func (cs *ComplianceSpec) Scanners() (types.Scanners, error)

Scanners reads spec control and determines the scanners by check ID prefix

type Control

type Control struct {
	ID            string        `yaml:"id"`
	Name          string        `yaml:"name"`
	Description   string        `yaml:"description,omitempty"`
	Checks        []SpecCheck   `yaml:"checks"`
	Severity      Severity      `yaml:"severity"`
	DefaultStatus ControlStatus `yaml:"defaultStatus,omitempty"`
}

Control represent the cps controls data and mapping checks

type ControlCheck

type ControlCheck struct {
	ID          string   `yaml:"id"`
	Name        string   `yaml:"name"`
	Description string   `yaml:"description,omitempty"`
	PassTotal   int      `yaml:"passTotal"`
	FailTotal   int      `yaml:"failTotal"`
	Severity    Severity `yaml:"severity"`
}

ControlCheck provides the result of conducting a single audit step.

type ControlStatus

type ControlStatus string
const (
	FailStatus ControlStatus = "FAIL"
	PassStatus ControlStatus = "PASS"
	WarnStatus ControlStatus = "WARN"
)

type Severity

type Severity string

type Spec

type Spec struct {
	ID               string    `yaml:"id"`
	Title            string    `yaml:"title"`
	Description      string    `yaml:"description"`
	Version          string    `yaml:"version"`
	RelatedResources []string  `yaml:"relatedResources"`
	Controls         []Control `yaml:"controls"`
}

type SpecCheck

type SpecCheck struct {
	ID string `yaml:"id"`
}

SpecCheck represent the scanner who perform the control check

Jump to

Keyboard shortcuts

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