Skip to content

Commit

Permalink
Merge pull request #142 from kubescape/smartremediation
Browse files Browse the repository at this point in the history
controlTypeTag smartRemediation
  • Loading branch information
kooomix authored Nov 20, 2023
2 parents 3e869e8 + d4326e0 commit 83db3f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 5 additions & 4 deletions reporthandling/attacktrack/v1alpha1/datastructures.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions reporthandling/datastructuresmethods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 83db3f4

Please sign in to comment.