Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type M ¶
func (*M) DetectPolicy ¶
Finds and loads rules in a directory. The directory may be any directory in the policies tree. Only rules underneath the directory will be loaded. Policy directories have the following layout:
policies/ policies/<rule-tyoe> policies/<rule-type>/<rule> (must contain metadata.yaml) policies/<rule-type>/<rule>/<target>
<target> is optional depending on <rule-type>.
func (*M) TestRules ¶
func (m *M) TestRules() (TestMetrics, error)
func (*M) ValidateRules ¶
func (m *M) ValidateRules() ValidateResult
type RuleTestMetrics ¶
type RuleType ¶
type RuleType interface { policy.RuleType ValidateRules(runOpts tools.RunOpts, rules []*policy.Rule) ValidateResult GetTestRunner(runOpts tools.RunOpts, target policy.Target) tools.Single // Find a test result. This must be tool-specific because the // findings have not been normalized. FindRuleResult(findings assessments.Findings, id string) PassFail }
type TestMetrics ¶
type TestMetrics struct { Rules []RuleTestMetrics `json:"rules,omitempty"` Passed int `json:"passed"` Failed int `json:"failed"` }
type ValidateResult ¶ added in v0.5.29
type ValidateResult struct { Errors error `json:"-"` Valid int `json:"valid"` Invalid int `json:"invalid"` }
func (*ValidateResult) AppendError ¶ added in v0.5.29
func (vr *ValidateResult) AppendError(err error)
Click to show internal directories.
Click to hide internal directories.