Skip to content

fix(kubernetes): Don't require ImagePullPolicy when digest (#4776)#4781

Merged
gruebel merged 1 commit into
bridgecrewio:mainfrom
candrews:issue-4776
Apr 2, 2023
Merged

fix(kubernetes): Don't require ImagePullPolicy when digest (#4776)#4781
gruebel merged 1 commit into
bridgecrewio:mainfrom
candrews:issue-4776

Conversation

@candrews

Copy link
Copy Markdown
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Don't report BC_K8S_14/CKV_K8S_15 "Image Pull Policy should be Always" when the image has a digest.

Fixes #4776

New/Edited policies (Delete if not relevant)

BC_K8S_14/CKV_K8S_15 "Image Pull Policy should be Always" should not be reported when using a digest

Description

Per the documentation:

When the imagePullPolicy is set to Always, you ensure the latest version of the image is deployed every time the pod is started.

By specifying the digest, the same image is always used, so there is no concern about the latest version (since the the version cannot change), negating the need to always pull the image.

Fix

How does someone fix the issue in code and/or in runtime?

As documented.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

…#4776)

Don't report BC_K8S_14/CKV_K8S_15 "Image Pull Policy should be Always"
when the image has a digest.

Signed-off-by: Craig Andrews <candrews@integralblue.com>

@gruebel gruebel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks, looks good 💪

@gruebel gruebel changed the title fix(general): Don't require ImagePullPolicy when digest (#4776) fix(kubernetes): Don't require ImagePullPolicy when digest (#4776) Mar 30, 2023
@gruebel gruebel merged commit 8c54c43 into bridgecrewio:main Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BC_K8S_14/CKV_K8S_15 "Image Pull Policy should be Always" should not be reported when using a digest

3 participants