Skip to content
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

.featureGates.RotateKubeletServerCertificate dropped from kubelet config in k8s 1.28 #3506

Closed
errm opened this issue Oct 4, 2023 · 2 comments
Labels
area/settings Issues related to our settings handling status/needs-info Further information is requested type/support User support related issues.

Comments

@errm
Copy link
Contributor

errm commented Oct 4, 2023

Image I'm using:

bottlerocket-aws-k8s-1.28-x86_64-v1.15.0-c9af43ad

What I expected to happen:

I am benchmarking against CIS guidelines using kube-bench

Test 3.2.11 starts to fail when I upgrade to k8s 1.28.

This control is checking for the presence of .featureGates.RotateKubeletServerCertificate in the kubelet config.

What actually happened:

Images for kubernetes 1.27 and below included the following in packages/kubernetes-1.x/kubelet-config

 featureGates:
   RotateKubeletServerCertificate: true

This seems to have been removed from the kubernetes-1.28 package without any comment or information in the relevant commit bf9e579

I want to understand if this was an intentional change?

There seems to be some test code here https://github.com/bottlerocket-os/bottlerocket/blob/develop/sources/bloodhound/README.md that should run this check... but I can't tell if it is run as part of the build process ...

How to reproduce the problem:

Run kube-bench against a bottlerocket - k8s 1.28 image.

@errm errm added status/needs-triage Pending triage or re-evaluation type/bug Something isn't working labels Oct 4, 2023
@stmcginnis
Copy link
Contributor

Hi @errm - sorry, that should maybe have been called out more clearly than just passing comments.

This feature gate is actually enabled by default since Kubernetes 1.12. So there wasn't really a reason to ever have it present in the config file with any of the versions Bottlerocket supports.

The reference you found in Bloodhound may actually be very interesting to you if you are trying to run the CIS Benchmarks. I'm sure you've seen a few other things that are just a little bit different in Bottlerocket that causes problems trying to use some of the tools designed for general purpose OSs. Bloodhound is an internal tool that was added and exposed through apiclient for running the Bottlerocket or Kubernetes CIS benchmarks. They provide either a nicely formatted human-readable format or a JSON formatted report that can be convenient for piping in to other programmatic reporting tools.

You can get a little more background context with the Bottlerocket CIS report and Kubernetes CIS report PRs.

Just let me know if you have any questions.

@stmcginnis stmcginnis added status/needs-info Further information is requested type/support User support related issues. area/settings Issues related to our settings handling and removed type/bug Something isn't working status/needs-triage Pending triage or re-evaluation labels Oct 4, 2023
@errm
Copy link
Contributor Author

errm commented Oct 4, 2023

This feature gate is actually enabled by default since Kubernetes 1.12. So there wasn't really a reason to ever have it present in the config file with any of the versions Bottlerocket supports.

Yes thanks - that was my suspicion

I was a bit confused though because this config seems to have appeared in bottlerocket for k8s 1.23 - then went away again now for 1.28 - and that didn't seem like it lined up with this feature gate becoming a default.

I think the correct thing in my case is probably to make a PR to kube-bench so it can understand this default correctly, just like bloodhound does here https://github.com/bottlerocket-os/bottlerocket/blob/develop/sources/bloodhound/src/bin/kubernetes-checks/checks.rs#L596-L599

@errm errm closed this as completed Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/settings Issues related to our settings handling status/needs-info Further information is requested type/support User support related issues.
Projects
None yet
Development

No branches or pull requests

2 participants