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(terraform_plan): Run provider checks against all providers in plan #7061

Merged
merged 2 commits into from
Mar 24, 2025

Conversation

alanszlosek
Copy link
Contributor

@alanszlosek alanszlosek commented Mar 19, 2025

User description

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

Description

I noticed that plan scanning only runs provider checks against first provider listed in the plan. After looking at the code I could see that subsequent provider blocks were being merged into the same provider_map.

Fixes #7060

Checklist:

  • 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

Generated description

Below is a concise technical summary of the changes proposed in this PR:

TopicDetails
Plan Parser Update Modifies the Terraform plan parser to handle multiple provider configurations
Modified files (1)
  • checkov/terraform/plan_parser.py
Latest Contributors(2)
UserCommitDate
bo156feat-terraform_plan-Su...October 20, 2024
maxamelfeat-terraform_plan-ad...September 04, 2024
Test Coverage Adds test resources and cases for multiple provider configurations
Modified files (3)
  • tests/terraform/parser/test_plan_parser.py
  • tests/terraform/parser/resources/plan_multiple_providers/multiple_providers.tf
  • tests/terraform/parser/resources/plan_multiple_providers/tfplan.json
Latest Contributors(2)
UserCommitDate
bo156feat-terraform_plan-Su...October 20, 2024
maxamelfeat-terraform_plan-ad...September 04, 2024
This pull request is reviewed by Baz. Join @alanszlosek and the rest of your team on (Baz).

Copy link
Collaborator

@tsmithv11 tsmithv11 left a comment

Choose a reason for hiding this comment

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

Nicely done. Thanks! 🚀

@tsmithv11 tsmithv11 merged commit 2568933 into bridgecrewio:main Mar 24, 2025
43 of 44 checks passed
Saarett pushed a commit that referenced this pull request Mar 24, 2025
#7061)

fix(terraform): plan scanning only runs provider checks against first provider

Co-authored-by: Taylor <[email protected]>
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.

Terraform Plan scanning only runs provider checks against first provider
3 participants