What would you like to be added:
Diki should be able to handle rule options configurations with multiple records of the same rule. This can be accomplished by extending the Options interface with a Merge(opt Option method.
|
// Option that can be validated in order to ensure |
|
// that configurations are correctly defined |
|
type Option interface { |
|
Validate(fldPath *field.Path) field.ErrorList |
|
} |
Ideally there should be a way to configure a merge strategy. There should be 2 such strategies: replace (override) and combine
replace would only use the last defined rule option for the specific rule
combine will use the Merge() method of the Option
The merge strategy can be configured on ruleset level:
providers:
- id: managedk8s
name: "Managed Kubernetes"
rulesets:
- id: disa-kubernetes-stig
name: DISA Kubernetes Security Technical Implementation Guide
version: v2r4
args:
mergeStrategy: replace
Why is this needed:
Enhance the user experience of writing diki configs. Provide a way without editing recommended rule options to add on additional.
What would you like to be added:
Diki should be able to handle rule options configurations with multiple records of the same rule. This can be accomplished by extending the Options interface with a
Merge(opt Optionmethod.diki/pkg/shared/kubernetes/option/options.go
Lines 20 to 24 in 9c26eee
Ideally there should be a way to configure a merge strategy. There should be 2 such strategies:
replace(override) andcombinereplacewould only use the last defined rule option for the specific rulecombinewill use theMerge()method of theOptionThe merge strategy can be configured on ruleset level:
Why is this needed:
Enhance the user experience of writing diki configs. Provide a way without editing recommended rule options to add on additional.