diff --git a/reporthandling/attacktrack/v1alpha1/datastructures.go b/reporthandling/attacktrack/v1alpha1/datastructures.go index 7896f0bf..1f403e49 100644 --- a/reporthandling/attacktrack/v1alpha1/datastructures.go +++ b/reporthandling/attacktrack/v1alpha1/datastructures.go @@ -1,10 +1,11 @@ package v1alpha1 const ( - ControlTypeTagDevops string = "devops" - ControlTypeTagSecurity string = "security" - ControlTypeTagCompliance string = "compliance" - ControlTypeTagSecurityImpact string = "security-impact" + ControlTypeTagDevops string = "devops" + ControlTypeTagSecurity string = "security" + ControlTypeTagCompliance string = "compliance" + ControlTypeTagSecurityImpact string = "security-impact" + ControlTypeTagSmartRemediation string = "smartRemediation" ) type AttackTrack struct { diff --git a/reporthandling/datastructuresmethods.go b/reporthandling/datastructuresmethods.go index a7094a9b..e30ca535 100644 --- a/reporthandling/datastructuresmethods.go +++ b/reporthandling/datastructuresmethods.go @@ -7,7 +7,9 @@ import ( "github.com/kubescape/k8s-interface/workloadinterface" "github.com/kubescape/opa-utils/objectsenvelopes" "github.com/kubescape/opa-utils/reporthandling/apis" + "github.com/kubescape/opa-utils/reporthandling/attacktrack/v1alpha1" "github.com/mitchellh/mapstructure" + "golang.org/x/exp/slices" ) const ActionRequiredAttribute string = "actionRequired" @@ -441,6 +443,11 @@ func (control *Control) GetControlTypeTags() []string { return []string{} } +func (control *Control) SupportSmartRemediation() bool { + typeTags := control.GetControlTypeTags() + return slices.Contains(typeTags, v1alpha1.ControlTypeTagSmartRemediation) +} + func (control *Control) GetControlId() string { return control.ControlID }