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

feat(dockerfile): add graph to Dockerfile #3948

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

gruebel
Copy link
Contributor

@gruebel gruebel commented Nov 27, 2022

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

Description

  • added a graph to Dockerfile with all official Docker instructions as resource_types without edges
  • added one regular graph check CKV2_DOCKER_1 which ensures that sudo isn't used

ex.

checkov -d [path to test files] --framework dockerfile -c CKV2_DOCKER_1 

       _               _              
   ___| |__   ___  ___| | _______   __
  / __| '_ \ / _ \/ __| |/ / _ \ \ / /
 | (__| | | |  __/ (__|   < (_) \ V / 
  \___|_| |_|\___|\___|_|\_\___/ \_/  
                                      
By bridgecrew.io | version: 2.2.99 

dockerfile scan results:

Passed checks: 1, Failed checks: 2, Skipped checks: 0

Check: CKV2_DOCKER_1: "Ensure that sudo isn't used"
        PASSED for resource: /Dockerfile.RUN
        File: /Dockerfile:5-5
Check: CKV2_DOCKER_1: "Ensure that sudo isn't used"
        FAILED for resource: /Dockerfile.RUN
        File: /Dockerfile:3-3

                3 | RUN sudo apt-get install git

Check: CKV2_DOCKER_1: "Ensure that sudo isn't used"
        FAILED for resource: /Dockerfile.RUN
        File: /Dockerfile:7-8

                7 | RUN apt-get update \
                8 |  && sudo apt-get install vim

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

@gruebel gruebel marked this pull request as draft November 27, 2022 22:49
@gruebel gruebel marked this pull request as ready for review November 28, 2022 23:01
Copy link
Collaborator

@rotemavni rotemavni left a comment

Choose a reason for hiding this comment

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

😲

Copy link
Contributor

@PelegLi PelegLi left a comment

Choose a reason for hiding this comment

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

🍹

@gruebel gruebel merged commit e3d01de into bridgecrewio:main Nov 30, 2022
@gruebel gruebel deleted the add-dockerfile-graph branch November 30, 2022 11:05
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.

3 participants