scheme

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByResourceScheme

type ByResourceScheme = *orderedmap.OrderedMap // Must be exported for json marshal

ByResourceScheme maps Resource to the default scheme

func NewByResourceScheme

func NewByResourceScheme() ByResourceScheme

type BySeverityScheme

type BySeverityScheme = *orderedmap.OrderedMap // Must be exported for json marshal

BySeverityScheme maps Resource to the default scheme

func NewBySeverityScheme

func NewBySeverityScheme() BySeverityScheme

type ByTypeScheme

type ByTypeScheme = *orderedmap.OrderedMap // Must be exported for json marshal

ByTypeScheme maps Entity Type to the default scheme

func NewByTypeScheme

func NewByTypeScheme() ByTypeScheme

type FlattenedScheme

type FlattenedScheme struct {
	orderedmap.OrderedMap

} // Must be exported for json marshal

FlattenedScheme maps policy-qualified-names to OutputData It is used as the default output, from which the converter selects the desired scheme

func FilterPoliciesByViolations

func FilterPoliciesByViolations(output FlattenedScheme, filter ViolationFilter) FlattenedScheme

func FilterViolationsByStatus

func FilterViolationsByStatus(output FlattenedScheme, status analyzers.PolicyStatus) FlattenedScheme

func NewFlattenedScheme

func NewFlattenedScheme() FlattenedScheme

func OnlyFailedViolations

func OnlyFailedViolations(output FlattenedScheme) FlattenedScheme

func SortScheme

func SortScheme(output FlattenedScheme, inplace bool, lessFunc func(a *orderedmap.Pair, b *orderedmap.Pair) bool) FlattenedScheme

func SortSchemeByNamespace

func SortSchemeByNamespace(output FlattenedScheme, inplace bool) FlattenedScheme

func SortSchemeBySeverity

func SortSchemeBySeverity(output FlattenedScheme, inplace bool) FlattenedScheme

func (FlattenedScheme) AsOrderedMap

func (s FlattenedScheme) AsOrderedMap() *orderedmap.OrderedMap

func (*FlattenedScheme) Clone

func (s *FlattenedScheme) Clone() FlattenedScheme

func (FlattenedScheme) GetPolicyData

func (s FlattenedScheme) GetPolicyData(policyName string) OutputData

type OutputData

type OutputData struct {
	PolicyInfo PolicyInfo  `json:"policyInfo"`
	Violations []Violation `json:"violations"`
}

func AppendViolations

func AppendViolations(o OutputData, violations ...Violation) OutputData

func NewOutputData

func NewOutputData(policyInfo PolicyInfo) OutputData

func (OutputData) Clone

func (o OutputData) Clone() OutputData

type PolicyInfo

type PolicyInfo struct {
	Title                    string              `json:"title"`
	Description              string              `json:"description"`
	PolicyName               string              `json:"policyName"`
	FullyQualifiedPolicyName string              `json:"fullyQualifiedPolicyName"`
	Severity                 severity.Severity   `json:"severity"`
	RemediationSteps         []string            `json:"remediationSteps"`
	Namespace                namespace.Namespace `json:"namespace"`
}

type Violation

type Violation struct {
	ViolationEntityType string                          `json:"violationEntityType"`
	CanonicalLink       string                          `json:"canonicalLink"`
	Aux                 map[string]enrichers.Enrichment `json:"aux"`
	Status              analyzers.PolicyStatus
}

type ViolationFilter

type ViolationFilter func(violation Violation) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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