-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Set eventRecordQPS to 0 #391
Conversation
See CIS Benchmark 4.2.9
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
I had mentioned in the original PR #347 (comment) whether or not doing this is actually reasonable, considering that setting this to 0 effectively disables rate limiting of events, can someone with some more knowledge on the subject comment? |
@stefansedich for reference and discussion, this is the relevant section in the CIS benchmark:
|
In my opinion, the tradeoff is between "you may lose security events" and "you may slow down your kubelet because of load", which I'd personally rate as respectively Very Bad and Bad. I think it makes sense to err on the side of caution and follow the CIS recommendation here, but I'll happily defer to people with more expertise 👍 |
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.
👍
Any update on this? :) |
Would also love to hear an update on this. |
Wondering about this too. Has anyone manually set it to 0 and experienced significant impact? |
I just wanted to highlight a section on one of the links shared in a comment above from @eldada which I think it's key to understand the implications of the value of this variable #391 (comment)
source: https://cloud.google.com/anthos/gke/docs/on-prem/concepts/cis-benchmarks |
This is still showing as an exception on our pen-tests. Could we please get an answer on whether setting eventRecordQPS to 0 will cause problems, or whether mitigation is planned in a future release? What is the advise from AWS? |
I notice that the The advice is referring to the deprecated command line option, where 0 is documented to use the default value of 5, whereas in the config file, a value of 0 is documented to disable rate limiting, which is precisely what this rule is supposed to prevent. https://github.com/kubernetes/kubernetes/blob/master/cmd/kubelet/app/options/options.go |
@@ -25,6 +25,7 @@ | |||
"hairpinMode": "hairpin-veth", | |||
"cgroupDriver": "cgroupfs", | |||
"cgroupRoot": "/", | |||
"eventRecordQPS": 0, |
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.
"eventRecordQPS": 0, |
Nope. This would be unlimited, which the CIS Benchmark warns against.
Unfortunately, the CIS Benchmark is terribly confused in what it does recommend, but that is its problem.
To understand the current snafu, start by looking at the source code that implemented the deprecated --event-qps
flag. It is this flag to which the CIS Benchmark recommendation originally applied, and for this flag a setting of 0 would be interpreted the same as if the flag were omitted, and the effective QPS would be 5, which is the default value for eventRecordQPS.
Then the flag was deprecated.
Unfortunately, setting eventRecordQPS=0 is explicitly disabling any rate limiting, whereas omitting eventRecordQPS will result in the default value 5.
@stefansedich https://github.com/awslabs/amazon-eks-ami/pull/391/files#r973550647 @technotaff-nbs My advice is to fix the CIS Benchmarks - which I am trying to do, by the way. |
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.
Do not set eventRecordQPS=0 (unlimited)
Let it default to 5 or tune it to a value appropriate to your cluster.
@joebowbeer thanks for clearing this up; I'm in agreement that the CIS spec needs updating and we shouldn't make this change. |
*Issue
#99
Description of changes:
See CIS Benchmark 4.2.9
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.