-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Security Hardened Kubernetes Cluster ruleset to managedk8s provider #359
Add Security Hardened Kubernetes Cluster ruleset to managedk8s provider #359
Conversation
Security Hardened Kubernetes Cluster
ruleset to managedk8s
providerThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, some small change requests.
docs/providers/managedk8s.md
Outdated
@@ -10,6 +10,8 @@ The `Managed Kubernetes` provider implements the following `rulesets`: | |||
- [DISA Kubernetes Security Technical Implementation Guide](../rulesets/disa-k8s-stig/ruleset.md) | |||
- v2r1 | |||
- v1r11 | |||
- [Security Hardened Shoot Cluster](../rulesets/security-hardened-k8s-cluster/ruleset.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [Security Hardened Shoot Cluster](../rulesets/security-hardened-k8s-cluster/ruleset.md) | |
- [Security Hardened Kubernetes Cluster](../rulesets/security-hardened-k8s-cluster/ruleset.md) |
example/config/managedk8s.yaml
Outdated
@@ -170,6 +170,14 @@ providers: # contains information about known providers | |||
# foo: bar | |||
# nodeGroupByLabels: | |||
# - foo | |||
- id: security-hardened-k8s-cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- id: security-hardened-k8s-cluster | |
- id: security-hardened-k8s |
pkg/provider/builder/managedk8s.go
Outdated
@@ -12,6 +12,7 @@ import ( | |||
"github.com/gardener/diki/pkg/provider" | |||
"github.com/gardener/diki/pkg/provider/managedk8s" | |||
"github.com/gardener/diki/pkg/provider/managedk8s/ruleset/disak8sstig" | |||
"github.com/gardener/diki/pkg/provider/managedk8s/ruleset/securityhardenedcluster" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"github.com/gardener/diki/pkg/provider/managedk8s/ruleset/securityhardenedcluster" | |
"github.com/gardener/diki/pkg/provider/managedk8s/ruleset/securityhardenedk8s" |
|
||
const ( | ||
// RulesetID is a constant containing the id of a Security Hardened Kubernetes Cluster Ruleset | ||
RulesetID = "security-hardened-k8s-cluster" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RulesetID = "security-hardened-k8s-cluster" | |
RulesetID = "security-hardened-k8s" |
|
||
func (r *Ruleset) registerV01Rules(ruleOptions map[string]config.RuleOptionsConfig) error { // TODO: add to FromGenericConfig | ||
_, err := client.New(r.Config, client.Options{ | ||
Scheme: gardenerk8s.GardenScheme, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scheme should be the same as the other managed k8s ruleset
) | ||
|
||
const ( | ||
// RulesetID is a constant containing the id of a Security Hardened Kubernetes Cluster Ruleset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// RulesetID is a constant containing the id of a Security Hardened Kubernetes Cluster Ruleset | |
// RulesetID is a constant containing the id of the Security Hardened Kubernetes Cluster Ruleset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
What this PR does / why we need it:
This PR adds the
Security Hardened Kubernetes Cluster
rulesetv0.1.0
to themanagedk8s
provider.Which issue(s) this PR fixes:
Part of #356
Special notes for your reviewer:
Release note: