-
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
[Security Hardened Shoot Cluster] Rule 2000 Implementation #362
Conversation
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.
Looks good, just 2 changes to test names.
pkg/provider/garden/ruleset/securityhardenedshoot/rules/2000_test.go
Outdated
Show resolved
Hide resolved
pkg/provider/garden/ruleset/securityhardenedshoot/rules/2000_test.go
Outdated
Show resolved
Hide resolved
} | ||
}) | ||
|
||
DescribeTable("Run cases", func(updateFn func(), expectedCheckResults []rule.CheckResult) { |
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.
DescribeTable("Run cases", func(updateFn func(), expectedCheckResults []rule.CheckResult) { | |
DescribeTable("Run cases", func(updateFn func(), expectedCheckResult rule.CheckResult) { |
Last comment, no need for expectedCheckResults
to be a slice when the function can only return a single rule.CheckResult
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
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.
Just a single wording change request.
case *shoot.Spec.Kubernetes.KubeAPIServer.EnableAnonymousAuthentication: | ||
return rule.Result(r, rule.FailedCheckResult("Anonymous authentication is enabled on the kube-apiserver.", rule.NewTarget())), nil | ||
default: | ||
return rule.Result(r, rule.PassedCheckResult("Anonymous authentication is disabled on the kube-apiserver.", rule.NewTarget())), nil |
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.
case *shoot.Spec.Kubernetes.KubeAPIServer.EnableAnonymousAuthentication: | |
return rule.Result(r, rule.FailedCheckResult("Anonymous authentication is enabled on the kube-apiserver.", rule.NewTarget())), nil | |
default: | |
return rule.Result(r, rule.PassedCheckResult("Anonymous authentication is disabled on the kube-apiserver.", rule.NewTarget())), nil | |
case *shoot.Spec.Kubernetes.KubeAPIServer.EnableAnonymousAuthentication: | |
return rule.Result(r, rule.FailedCheckResult("Anonymous authentication is enabled for the kube-apiserver.", rule.NewTarget())), nil | |
default: | |
return rule.Result(r, rule.PassedCheckResult("Anonymous authentication is disabled for the kube-apiserver.", rule.NewTarget())), nil |
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 is an implementation of the Rule 2000 of the Security Hardened Shoot Cluster Ruleset. It retrieves metadata about the shoot cluster and evaluates the EnableAnonymousAuthentication flag (if present) of the Kube API Server component.
Which issue(s) this PR fixes:
Part of #304
Special notes for your reviewer:
Release note: