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

fix(query): Extend image_without_digest k8s rule to cover further resource kinds #4892

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

Churro
Copy link
Contributor

@Churro Churro commented Feb 27, 2022

Proposed Changes

  • Extend the rule to cover additional resource kinds, e.g., Deployment, DaemonSet, etc.
  • Remove MissingAttribute check for image + adapt the testcase
    • For a container to be deployable, specifying an image is indispensible (see type Container struct here).
    • Trying to deploy a pod without an image attribute yields an error: The Pod "private-image-test-1.2" is invalid: spec.containers[0].image: Required value
    • Note: image can be empty (= null) though, e.g., if command is also used
  • More comprehensive metadata description

I submit this contribution under the Apache-2.0 license.

@kicsbot
Copy link
Contributor

kicsbot commented Feb 27, 2022

Scan submitted to Checkmarx

Copy link
Contributor

@rafaela-soares rafaela-soares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thank you so much for improving the k8s queries, @Churro 🚀 Impressive work!

@cx-joao-reigota cx-joao-reigota merged commit bb99588 into Checkmarx:master Mar 9, 2022
@rafaela-soares rafaela-soares added the community Community contribution label Mar 16, 2022
@rafaela-soares rafaela-soares added the query New query feature label Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution query New query feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants