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): add terraform plan vertices to terraform graph if not exist #5230

Merged
merged 6 commits into from
Jun 21, 2023

Conversation

YaaraVerner
Copy link
Contributor

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

Description

added all resources that weren't found in the terraform folder (when deep-analysis enabled) to the terraform graph before scanning it in order to run graph checks over all existing resources in terraform plan files

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

Copy link
Contributor

@achiar99 achiar99 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

@gruebel gruebel left a comment

Choose a reason for hiding this comment

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

nice work 🍻

Comment on lines 36 to 40
def __get_tf_vertex_idx_from_tf_plan_vertex(v):
v = self._address_to_tf_idx_and_vertex_map.get(v.attributes.get('__address__'))
if not v:
return None
return v[1]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this needs to be a nested method, just move it to the same level as the others.

@YaaraVerner YaaraVerner temporarily deployed to scan-security June 21, 2023 07:55 — with GitHub Actions Inactive
@YaaraVerner YaaraVerner temporarily deployed to scan-security June 21, 2023 08:47 — with GitHub Actions Inactive
@YaaraVerner YaaraVerner merged commit f1dc835 into main Jun 21, 2023
@YaaraVerner YaaraVerner deleted the fix-in-deep-analysis branch June 21, 2023 08:58
praveen-panw pushed a commit to praveen-panw/bc_checkov that referenced this pull request Jun 21, 2023
…f not exist (bridgecrewio#5230)

* add tf plan vertices to tf graph if not exist

* move method to class level

* fix typing

* add comment for the missing resource

* add typing

* fix typing
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.

4 participants