Skip to content

Commit

Permalink
Merge pull request #120 from kubescape/scanning-scope-support
Browse files Browse the repository at this point in the history
control fields for scanning scope
  • Loading branch information
David Wertenteil authored Jul 25, 2023
2 parents 1287d2c + 0b8953a commit 823bc6f
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions reporthandling/datastructures.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ type ControlConfigInputs struct {
Description string `json:"description" bson:"description"`
}

type ScanningScopeType string

const (
ScopeCloudAKS ScanningScopeType = "AKS"
ScopeCloudGKE ScanningScopeType = "GKE"
ScopeCloudEKS ScanningScopeType = "EKS"
ScopeCloud ScanningScopeType = "cloud"
ScopeCluster ScanningScopeType = "cluster"
ScopeFile ScanningScopeType = "file"
)

type ScanningScope struct {
Matches []ScanningScopeType `json:"matches"`
}

// PolicyRule represents single rule, the fundamental executable block of policy
type PolicyRule struct {
armotypes.PortalBase `json:",inline" bson:"inline"`
Expand All @@ -56,15 +71,16 @@ type Control struct {
FixedInput map[string][]string `json:"fixedInput,omitempty"`
RulesIDs *[]string `json:"rulesIDs,omitempty" bson:"rulesIDs,omitempty"`
armotypes.PortalBase `json:",inline" bson:"inline"`
Control_ID string `json:"id,omitempty" bson:"id,omitempty" `
ControlID string `json:"controlID" bson:"controlID"`
CreationTime string `json:"creationTime" bson:"creationTime"`
Description string `json:"description" bson:"description"`
Remediation string `json:"remediation" bson:"remediation"`
Rules []PolicyRule `json:"rules" bson:"rules,omitempty"`
FrameworkNames []string `json:"frameworkNames,omitempty" bson:"frameworkNames,omitempty"`
BaseScore float32 `json:"baseScore,omitempty" bson:"baseScore,omitempty"`
ARMOImprovementFactor float32 `json:"ARMOImprovementFactor,omitempty" bson:"ARMOImprovementFactor,omitempty"`
Control_ID string `json:"id,omitempty" bson:"id,omitempty" `
ControlID string `json:"controlID" bson:"controlID"`
CreationTime string `json:"creationTime" bson:"creationTime"`
Description string `json:"description" bson:"description"`
Remediation string `json:"remediation" bson:"remediation"`
Rules []PolicyRule `json:"rules" bson:"rules,omitempty"`
FrameworkNames []string `json:"frameworkNames,omitempty" bson:"frameworkNames,omitempty"`
BaseScore float32 `json:"baseScore,omitempty" bson:"baseScore,omitempty"`
ARMOImprovementFactor float32 `json:"ARMOImprovementFactor,omitempty" bson:"ARMOImprovementFactor,omitempty"`
ScanningScope ScanningScope `json:"scanningScope" bson:"scanningScope"`
}

type UpdatedControl struct {
Expand Down

0 comments on commit 823bc6f

Please sign in to comment.