resourcesresults

package
v0.0.202 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 7 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceAssociatedControl

type ResourceAssociatedControl struct {
	ControlID               string                   `json:"controlID"`
	Name                    string                   `json:"name"`
	ResourceAssociatedRules []ResourceAssociatedRule `json:"rules,omitempty"`
}

ResourceAssociatedControl control that is associated to a resource

func (*ResourceAssociatedControl) GetID

func (control *ResourceAssociatedControl) GetID() string

GetID get control ID

func (*ResourceAssociatedControl) GetName

func (control *ResourceAssociatedControl) GetName() string

GetID get control ID

func (*ResourceAssociatedControl) GetStatus

func (control *ResourceAssociatedControl) GetStatus(f *helpersv1.Filters) apis.IStatus

Status get control status

func (*ResourceAssociatedControl) ListRules

func (control *ResourceAssociatedControl) ListRules() []ResourceAssociatedRule

ListRules return list of rules

func (*ResourceAssociatedControl) SetID

func (control *ResourceAssociatedControl) SetID(id string)

SetID set control ID

func (*ResourceAssociatedControl) SetName

func (control *ResourceAssociatedControl) SetName(name string)

SetID set control ID

type ResourceAssociatedRule

type ResourceAssociatedRule struct {
	Name                  string                             `json:"name"` // rule name
	Status                apis.ScanningStatus                `json:"status"`
	Paths                 []armotypes.PosturePaths           `json:"paths,omitempty"`
	Exception             []armotypes.PostureExceptionPolicy `json:"exception,omitempty"`
	ControlConfigurations map[string][]string                `json:"controlConfigurations,omitempty"`
}

ResourceAssociatedRule failed rule that is associated to a resource

func (*ResourceAssociatedRule) GetName

func (rule *ResourceAssociatedRule) GetName() string

GetName get rule name

func (*ResourceAssociatedRule) GetStatus

func (rule *ResourceAssociatedRule) GetStatus(f *helpersv1.Filters) apis.IStatus

SetName set rule name

func (*ResourceAssociatedRule) SetName

func (rule *ResourceAssociatedRule) SetName(n string)

SetName set rule name

type Result

type Result struct {
	ResourceID string `json:"resourceID"` // <apigroup>/<namespace>/<kind>/<name>

	AssociatedControls  []ResourceAssociatedControl         `json:"controls,omitempty"`
	RawResource         *reporthandling.Resource            `json:"rawResource,omitempty"`
	PrioritizedResource *prioritization.PrioritizedResource `json:"prioritizedResource,omitempty"`
}

Result - resource result resourceID and the controls that where tested against the resource, along with the raw resource and prioritization information

func MockResults

func MockResults() []Result

func (*Result) GetResourceID

func (result *Result) GetResourceID() string

GetResourceID get the resource ID

func (*Result) GetStatus

func (result *Result) GetStatus(f *helpersv1.Filters) apis.IStatus

Status get resource status

func (*Result) ListControls

func (result *Result) ListControls() []ResourceAssociatedControl

// ListControls return list of controls

func (*Result) ListControlsIDs

func (result *Result) ListControlsIDs(f *helpersv1.Filters) *helpersv1.AllLists

ListFailedControls return list of failed controls IDs

func (*Result) ListControlsNames

func (result *Result) ListControlsNames(f *helpersv1.Filters) *helpersv1.AllLists

ListFailedControls return list of controls IDs

func (*Result) ListRules

func (result *Result) ListRules() []ResourceAssociatedRule

ListRules return list of rules

func (*Result) ListRulesOfControl

func (result *Result) ListRulesOfControl(controlID, controlName string) []ResourceAssociatedRule

ListRulesOfControl return list of rules related to a controlID or controlName

func (*Result) SetExceptions

func (result *Result) SetExceptions(workload workloadinterface.IMetadata, exceptionsPolicies []armotypes.PostureExceptionPolicy, clusterName string)

SetExceptions add exceptions to result

func (*Result) SetResourceID

func (result *Result) SetResourceID(resourceID string)

SetResourceID set the resource ID

Jump to

Keyboard shortcuts

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