-
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
feat(terraform): include pods of kubernetes_deployment in kubernetes_pod checks (1/4) #3691
Conversation
1c62bcf
to
d233a08
Compare
1a5d768
to
cc144bf
Compare
cc144bf
to
135cbff
Compare
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.
great work again. I have specific change suggestion, which you probably need to add to all the adjusted checks, also in the other PRs.
checkov/terraform/checks/resource/kubernetes/AllowPrivilegeEscalation.py
Outdated
Show resolved
Hide resolved
135cbff
to
70b8df1
Compare
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, thanks 🍹
evaluated_keys_path = "spec" | ||
|
||
template = spec.get("template") | ||
if template and isinstance(template, list): |
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.
if template and isinstance(template, list): | |
if template and isinstance(template, list) and len(template) == 1: |
if template and isinstance(template, list): | ||
template = template[0] | ||
template_spec = template.get("spec") | ||
if template_spec and isinstance(template_spec, list): |
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.
if template_spec and isinstance(template_spec, list): | |
if template_spec and isinstance(template_spec, list) and len(template_spec) == 1: |
evaluated_keys_path = "spec" | ||
|
||
template = spec.get("template") | ||
if template and isinstance(template, list): |
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.
if template and isinstance(template, list): | |
if template and isinstance(template, list) and len(template) == 1: |
if template and isinstance(template, list): | ||
template = template[0] | ||
template_spec = template.get("spec") | ||
if template_spec and isinstance(template_spec, list): |
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.
if template_spec and isinstance(template_spec, list): | |
if template_spec and isinstance(template_spec, list) and len(template_spec) == 1: |
evaluated_keys_path = "spec" | ||
|
||
template = spec.get("template") | ||
if template and isinstance(template, list): |
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.
if template and isinstance(template, list): | |
if template and isinstance(template, list) and len(template) == 1: |
if template and isinstance(template, list): | ||
template = template[0] | ||
template_spec = template.get("spec") | ||
if template_spec and isinstance(template_spec, list): |
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.
if template_spec and isinstance(template_spec, list): | |
if template_spec and isinstance(template_spec, list) and len(template_spec) == 1: |
evaluated_keys_path = "spec" | ||
|
||
template = spec.get("template") | ||
if template and isinstance(template, list): |
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.
if template and isinstance(template, list): | |
if template and isinstance(template, list) and len(template) == 1: |
if template and isinstance(template, list): | ||
template = template[0] | ||
template_spec = template.get("spec") | ||
if template_spec and isinstance(template_spec, list): |
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.
if template_spec and isinstance(template_spec, list): | |
if template_spec and isinstance(template_spec, list) and and len(template_spec) == 1: |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
This PR includes pods defined via
kubernetes_deployment
in pod checks . PR 1 of 4.Fixes #3690
New/Edited policies (Delete if not relevant)
Add resource: kubernetes_deployment, kubernetes_deployment_v1
Add resource: kubernetes_deployment, kubernetes_deployment_v1
Add resource: kubernetes_deployment, kubernetes_deployment_v1
Add resource: kubernetes_deployment, kubernetes_deployment_v1
Add resource: kubernetes_deployment, kubernetes_deployment_v1
Add resource: kubernetes_deployment, kubernetes_deployment_v1
Checklist: