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) GetSubStatus() apis.ScanningSubStatus
- func (control *ResourceAssociatedControl) ListRules() []ResourceAssociatedRule
- func (control *ResourceAssociatedControl) SetID(id string)
- func (control *ResourceAssociatedControl) SetName(name string)
- func (control *ResourceAssociatedControl) SetStatus(c reporthandling.Control)
- type ResourceAssociatedRule
- func (rule *ResourceAssociatedRule) GetName() string
- func (rule *ResourceAssociatedRule) GetStatus(f *helpersv1.Filters) apis.IStatus
- func (rule *ResourceAssociatedRule) GetSubStatus() apis.ScanningSubStatus
- func (rule *ResourceAssociatedRule) SetName(n string)
- func (rule *ResourceAssociatedRule) SetStatus(s apis.ScanningStatus, f *helpersv1.Filters)
- 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"` Status apis.StatusInfo `json:"status"` 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) GetSubStatus ¶ added in v0.0.227
func (control *ResourceAssociatedControl) GetSubStatus() apis.ScanningSubStatus
GetSubStatus get control sub 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
func (*ResourceAssociatedControl) SetStatus ¶ added in v0.0.227
func (control *ResourceAssociatedControl) SetStatus(c reporthandling.Control)
SetStatus set control status and sub status
SetStatus set control status and sub status according to the following logic: 1. Calculate control status with all the resource associated rules: 1.1 if the status is failed and the control contains attributes of actionRequired: requires/manual review, the status is skipped and the sub status is requires/manual review 1.2 if the control contains attributes of actionRequired: configuration and the configuration is not set, the status is skipped and the sub status is configuration
type ResourceAssociatedRule ¶
type ResourceAssociatedRule struct { ControlConfigurations map[string][]string `json:"controlConfigurations,omitempty"` Name string `json:"name"` Status apis.ScanningStatus `json:"status"` SubStatus apis.ScanningSubStatus `json:"subStatus"` 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
GetStatus get rule status
func (*ResourceAssociatedRule) GetSubStatus ¶ added in v0.0.227
func (rule *ResourceAssociatedRule) GetSubStatus() apis.ScanningSubStatus
GetSubStatus get rule sub status
func (*ResourceAssociatedRule) SetName ¶
func (rule *ResourceAssociatedRule) SetName(n string)
SetName set rule name
func (*ResourceAssociatedRule) SetStatus ¶ added in v0.0.227
func (rule *ResourceAssociatedRule) SetStatus(s apis.ScanningStatus, f *helpersv1.Filters)
SetStatus set rule status and sub status
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, controls map[string]reporthandling.Control, 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.