Documentation ¶
Index ¶
- type ResourceAssociatedControl
- func (control *ResourceAssociatedControl) GetID() string
- func (control *ResourceAssociatedControl) GetName() string
- func (control *ResourceAssociatedControl) GetStatus(f *helpersv1.Filters) apis.IStatus
- func (control *ResourceAssociatedControl) ListRules() []ResourceAssociatedRule
- func (control *ResourceAssociatedControl) SetID(id string)
- func (control *ResourceAssociatedControl) SetName(name string)
- type ResourceAssociatedRule
- type Result
- func (result *Result) GetResourceID() string
- func (result *Result) GetStatus(f *helpersv1.Filters) apis.IStatus
- func (result *Result) ListControls() []ResourceAssociatedControl
- func (result *Result) ListControlsIDs(f *helpersv1.Filters) *helpersv1.AllLists
- func (result *Result) ListControlsNames(f *helpersv1.Filters) *helpersv1.AllLists
- func (result *Result) ListRules() []ResourceAssociatedRule
- func (result *Result) ListRulesOfControl(controlID, controlName string) []ResourceAssociatedRule
- func (result *Result) SetExceptions(workload workloadinterface.IMetadata, ...)
- func (result *Result) SetResourceID(resourceID string)
- type ResultOption
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 { ControlConfigurations map[string][]string `json:"controlConfigurations,omitempty"` Name string `json:"name"` Status apis.ScanningStatus `json:"status"` Paths []armotypes.PosturePaths `json:"paths,omitempty"` Exception []armotypes.PostureExceptionPolicy `json:"exception,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 { RawResource *reporthandling.Resource `json:"rawResource,omitempty"` PrioritizedResource *prioritization.PrioritizedResource `json:"prioritizedResource,omitempty"` ResourceID string `json:"resourceID"` // <apigroup>/<namespace>/<kind>/<name> AssociatedControls []ResourceAssociatedControl `json:"controls,omitempty"` // contains filtered or unexported fields }
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 ¶
GetResourceID get the resource ID
func (*Result) ListControls ¶
func (result *Result) ListControls() []ResourceAssociatedControl
// ListControls return list of controls
func (*Result) ListControlsIDs ¶
ListFailedControls return list of failed controls IDs
func (*Result) ListControlsNames ¶
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, opts ...ResultOption)
SetExceptions add exceptions to result.
If the caller has already instanciated an exceptions processor, the latter may be reused with option "WithExceptionsProcessor(processor)".
func (*Result) SetResourceID ¶
SetResourceID set the resource ID
type ResultOption ¶ added in v0.0.225
type ResultOption func(*resultOptions)
ResultOption allows for fine-grained tuning of the Result methods.
func WithExceptionsProcessor ¶ added in v0.0.225
func WithExceptionsProcessor(processor *exceptions.Processor) ResultOption
WithExceptionsProcessor allows the SetExceptions method to reuse an already allocated exceptions.Processor.