result

package
v0.61.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSet

func NewSet(resourceBlock block.Block) *resultSet

Types

type Annotation added in v0.52.0

type Annotation struct {
	IgnoreRuleID  string
	Expiry        *time.Time
	Workspace     string
	AllowedValues []string
}

type Result

type Result struct {
	RuleID          string            `json:"rule_id"`
	LegacyRuleID    string            `json:"legacy_rule_id"`
	RuleSummary     string            `json:"rule_description"`
	RuleProvider    provider.Provider `json:"rule_provider"`
	Impact          string            `json:"impact"`
	Resolution      string            `json:"resolution"`
	Links           []string          `json:"links"`
	Description     string            `json:"description"`
	RangeAnnotation string            `json:"-"`
	Severity        severity.Severity `json:"severity"`
	Status          Status            `json:"status"`
	Location        block.Range       `json:"location"`
	Resource        string            `json:"resource"`
	// contains filtered or unexported fields
}

Result is a positive result for a security check. It encapsulates a code unique to the specific check it was raised by, a human-readable description and a range

func New

func New(resourceBlock block.Block) *Result

func (*Result) Annotations added in v0.52.0

func (res *Result) Annotations() []Annotation

func (*Result) Blocks added in v0.52.0

func (r *Result) Blocks() block.Blocks

func (*Result) HashCode

func (r *Result) HashCode() string

func (*Result) IsIgnored added in v0.52.0

func (res *Result) IsIgnored(workspace string) bool

func (*Result) IsOnAttribute added in v0.52.0

func (r *Result) IsOnAttribute() bool

func (*Result) Passed

func (r *Result) Passed() bool

func (*Result) Range

func (r *Result) Range() block.Range

func (*Result) WithAttribute added in v0.52.0

func (r *Result) WithAttribute(attr block.Attribute) *Result

func (*Result) WithBlock added in v0.52.0

func (r *Result) WithBlock(block block.Block) *Result

func (*Result) WithDescription

func (r *Result) WithDescription(description string, parts ...interface{}) *Result

func (*Result) WithImpact

func (r *Result) WithImpact(impact string) *Result

func (*Result) WithLegacyRuleID added in v0.50.0

func (r *Result) WithLegacyRuleID(id string) *Result
func (r *Result) WithLink(link string) *Result
func (r *Result) WithLinks(links []string) *Result

func (*Result) WithResolution

func (r *Result) WithResolution(resolution string) *Result

func (*Result) WithRuleID

func (r *Result) WithRuleID(id string) *Result

func (*Result) WithRuleProvider

func (r *Result) WithRuleProvider(provider provider.Provider) *Result

func (*Result) WithRuleSummary

func (r *Result) WithRuleSummary(description string) *Result

func (*Result) WithSeverity

func (r *Result) WithSeverity(sev severity.Severity) *Result

func (*Result) WithStatus

func (r *Result) WithStatus(status Status) *Result

type Set

type Set interface {
	AddResult() *Result
	WithRuleID(id string) Set
	WithLegacyRuleID(id string) Set
	WithRuleSummary(description string) Set
	WithRuleProvider(provider provider.Provider) Set
	WithImpact(impact string) Set
	WithResolution(resolution string) Set
	WithLinks(links []string) Set
	All() []*Result
}

type Status

type Status string
const (
	Failed  Status = "failed"
	Passed  Status = "passed"
	Ignored Status = "ignored"
)

Jump to

Keyboard shortcuts

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