File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ import (
12
12
"golang.org/x/exp/slices"
13
13
)
14
14
15
- const ActionRequiredAttribute string = "actionRequired"
15
+ const (
16
+ ActionRequiredAttribute string = "actionRequired"
17
+ ControlAttributeKeyIsFixedByNetworkPolicy string = "isFixedByNetworkPolicy"
18
+ )
16
19
17
20
// ==============================================================================================
18
21
// ========================== PostureReport =====================================================
@@ -443,6 +446,19 @@ func (control *Control) GetControlTypeTags() []string {
443
446
return []string {}
444
447
}
445
448
449
+ // returns true if control has attribute "isFixedByNetworkPolicy" and its value is true
450
+ func (control * Control ) IsFixedByNetworkPolicy () bool {
451
+ if control .Attributes == nil {
452
+ return false
453
+ }
454
+ if v , exist := control .Attributes [ControlAttributeKeyIsFixedByNetworkPolicy ]; exist {
455
+ if isFixedByNetworkPolicy , ok := v .(bool ); ok {
456
+ return isFixedByNetworkPolicy
457
+ }
458
+ }
459
+ return false
460
+ }
461
+
446
462
func (control * Control ) SupportSmartRemediation () bool {
447
463
typeTags := control .GetControlTypeTags ()
448
464
return slices .Contains (typeTags , v1alpha1 .ControlTypeTagSmartRemediation )
You can’t perform that action at this time.
0 commit comments