manager

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type M

type M struct {
	tools.RunOpts
	policy.Store
}

func (*M) DetectPolicy

func (m *M) DetectPolicy(dir string) error

TODO update from policys to policies Finds and loads policies in a directory. The directory may be any directory in the policies tree. Only policies underneath the directory will be loaded. Policy directories have the following layout:

policies/ policies/<policy-tyoe> policies/<policy-type>/<policy> (must contain metadata.yaml) policies/<policy-type>/<policy>/<target>

<target> is optional depending on <policy-type>.

func (*M) Register

func (m *M) Register(cmd *cobra.Command)

func (*M) RegisterDownload added in v0.5.43

func (m *M) RegisterDownload(cmd *cobra.Command)

func (*M) RegisterUpload added in v0.5.47

func (m *M) RegisterUpload(cmd *cobra.Command)

func (*M) TestPolicies added in v0.5.35

func (m *M) TestPolicies() (TestMetrics, error)

func (*M) ValidatePolicies added in v0.5.35

func (m *M) ValidatePolicies() ValidateResult

type PassFail added in v0.5.29

type PassFail *bool

type PolicyTestMetrics added in v0.5.35

type PolicyTestMetrics struct {
	Path     string        `json:"path"`
	Target   policy.Target `json:"target"`
	TestPath string        `json:"test_path"`
	TestType string        `json:"test_type"`
	Success  bool          `json:"success"`
}

type PolicyType added in v0.5.35

type PolicyType interface {
	policy.PolicyType
	ValidatePolicies(runOpts tools.RunOpts, policies []*policy.Policy) 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.
	FindPolicyResult(findings assessments.Findings, id string) []PassFail
}

type TestMetrics

type TestMetrics struct {
	Policies []PolicyTestMetrics `json:"policies,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)

Jump to

Keyboard shortcuts

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