-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(kubernetes): [CKV_K8S_140] Update ApiServerTlsCertAndKey.py to check RHS values #3506
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.
nice catch 🚀
checkov/kubernetes/checks/resource/k8s/ApiServerTlsCertAndKey.py
Outdated
Show resolved
Hide resolved
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.
nice, looks good 🚀 can you also add one failing test, where one of the flags is used, but without a value?
Added a new fail check for the update |
Hey, @gruebel could help me identify why the code fails in a few tests? I will rectify them accordingly! |
quite easy, if you add a new test case it also needs to be added to the actual test file. Additionally the object names should be unique, so we can be sure, the correct ones are failing/passing. |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
The earlier code was only checking if the
-tls-cert-file
and--tls-private-key-file
parameters are present but was not checking if the values are provided on the RHS.Fixes
Optimised
CKV_K8S_140
to check for the values and non-empty values on the RHS of the parameters.Checklist: