spec

package
v0.0.0-...-c5f19f0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 8 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 GetComplianceSpec

func GetComplianceSpec(specNameOrPath string) ([]byte, error)

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

func MapSpecCheckIDToFilteredResults

func MapSpecCheckIDToFilteredResults(result types.Result, checkIDs map[types.SecurityCheck][]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 (*ComplianceSpec) CheckIDs

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

CheckIDs return list of compliance check IDs

func (*ComplianceSpec) SecurityChecks

func (cs *ComplianceSpec) SecurityChecks() ([]types.SecurityCheck, error)

SecurityChecks 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