bridgecrewio / checkov

Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
https://www.checkov.io/
Apache License 2.0
7.1k stars 1.12k forks source link

fix(terraform): Ignored `--external-modules-download-path` flag #6676

Open apgrucza opened 2 months ago

apgrucza commented 2 months ago

User description

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

[//]: # "

PR Title

We use the title to create changelog automatically and therefore only allow specific prefixes
- break:    to indicate a breaking change, this supersedes any of the other types
- feat:     to indicate new features or checks
- fix:      to indicate a bugfix or handling of edge cases of existing checks
- docs:     to indicate an update to our documentation
- chore:    to indicate adjustments to workflow files or dependency updates
- platform: to indicate a change needed for the platform
Each prefix should be accompanied by a scope that specifies the targeted framework. If uncertain, use 'general'.
#    
Allowed prefixs:
ansible|argo|arm|azure|bicep|bitbucket|circleci|cloudformation|dockerfile|github|gha|gitlab|helm|kubernetes|kustomize|openapi|sast|sca|secrets|serverless|terraform|general|graph|terraform_plan|terraform_json
#
ex.
feat(terraform): add CKV_AWS_123 to ensure that VPC Endpoint Service is configured for Manual Acceptance

"

Description

Fixes a bug where --external-modules-download-path is ignored.

Fixes #6675

Checklist:


Generated description

Dear maintainer, below is a concise technical summary of the changes proposed in this PR:

Fix the handling of the --external-modules-download-path flag in the RunnerRegistry class to ensure it is correctly passed and utilized during the enrichment of Terraform plan reports. Update the get_enriched_resources method to accept and use this flag. Add corresponding tests in test_runner_registry_plan_enrichment.py to verify the correct behavior of the flag.

<table><tr><th>Topic</th><th>Details</th><tr><td><a href=https://baz.co/changes/bridgecrewio/checkov/6676?tool=ast&topic=Test+Enhancements>Test Enhancements</a>
    </td><td>Add tests to verify the correct behavior of the <code>--external-modules-download-path</code> flag in the <code>test_runner_registry_plan_enrichment.py</code>.<details><summary>Modified files (1)</summary><ul><li>tests/common/runner_registry/test_runner_registry_plan_enrichment.py</li></ul></details><details><summary>Latest Contributors(2)</summary><table><tr><th>Email</th><th>Commit</th><th>Date</th></tr><tr><td>35402131+bo156@users.n...</td><td>feat-terraform-Remove-...</td><td>August 16, 2023</td></tr>
63583491+arielkru@user...feat-terraform-Impleme...December 01, 2022 Flag Handling Fix Fix the handling of the --external-modules-download-path flag in the RunnerRegistry class to ensure it is correctly passed and utilized during the enrichment of Terraform plan reports.
Modified files (1)
  • checkov/common/runners/runner_registry.py
Latest Contributors(2)
EmailCommitDate
anton.gruebel@gmail.comchore-update-cloudspla...September 18, 2024
47212872+EmmaVinen@use...feat-general-allow-too...September 11, 2024
This pull request is reviewed by Baz. Join @apgrucza and the rest of your team on (Baz).