rule

package
v4.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Remediation

type Remediation struct {
	// Patch for machines.
	Patch *string `json:"patch,omitempty"`
	// Text for humans.
	Text string `json:"text"`
	// Text in markdown format for humans.
	Markdown string `json:"markdown"`
	// Effort to remediate.
	Effort RemediationEffort `json:"effort"`
}

Remediation represents the remediation for a finding.

type RemediationEffort

type RemediationEffort int

RemediationEffort indicates the estimated effort necessary to remediate a finding.

const (
	// RemediationEffortNone indicates a no remediation effort.
	RemediationEffortNone RemediationEffort = iota
	// RemediationEffortLow indicates a low remediation effort.
	RemediationEffortLow
	// RemediationEffortMedium indicates a medium remediation effort.
	RemediationEffortMedium
	// RemediationEffortHigh indicates a high remediation effort.
	RemediationEffortHigh
)

func (*RemediationEffort) String

func (r *RemediationEffort) String() string

String stringifies the enum.

func (*RemediationEffort) UnmarshalYAML

func (r *RemediationEffort) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML is a custom unmarshalling function to transform the string into an enum.

type Risk

type Risk int

Risk indicates a risk.

const (
	// RiskNone is a no risk.
	RiskNone Risk = iota
	// RiskLow is a low risk.
	RiskLow
	// RiskMedium is a medium risk.
	RiskMedium
	// RiskHigh is a high risk.
	RiskHigh
	// RiskCritical is a critical risk.
	RiskCritical
)

func (*Risk) GreaterThan

func (r *Risk) GreaterThan(rr Risk) bool

GreaterThan compare risks.

func (*Risk) String

func (r *Risk) String() string

String stringifies the enum.

func (*Risk) UnmarshalYAML

func (r *Risk) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML is a custom unmarshalling function to transform the string into an enum.

type Rule

type Rule struct {
	Name        string
	Short       string
	Desc        string
	Motivation  string
	Risk        Risk
	Remediation *Remediation
}

nolint: govet

func New

func New(loc embed.FS, rule string) (*Rule, error)

New create a new rule.

Jump to

Keyboard shortcuts

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