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

checkov skips scaning files if it cannot parse file #3065

Closed
harishachappa opened this issue Jun 6, 2022 · 3 comments
Closed

checkov skips scaning files if it cannot parse file #3065

harishachappa opened this issue Jun 6, 2022 · 3 comments
Labels

Comments

@harishachappa
Copy link

Describe the issue
Checkov skips terraform file when it can't parse a file. When you are using checkov in gitlab ci pipeline with junitxml output, it will be better to include such erros in 'Errors' list instead of ignoring them.

Examples

resource "aws_alb" "alb" {
  name                             = "foobar-nlb"
  load_balancer_type               = "network"
  enable_cross_zone_load_balancing = true

  tags = "${merge("${var.custom_tags}", tomap({
     Name = "foobar-nlb"
  )}"
}

Version (please complete the following information):

  • 2.0.1162
@nimrodkor nimrodkor added outputs good first issue Good for newcomers and removed skips labels Jun 7, 2022
@nimrodkor
Copy link
Contributor

Hey @harishachappa !
I'm not sure about the behavior here - not everyone would like to fail the entire scan on malformed files. The current behavior takes that into account, however, we've recently added the option to fail on parsing errors - #3027 .
So IMO, it would be best to add right before this line, if this option is set, an error per parsing error the report already has:

test_suite = TestSuite(name=f"{self.check_type} scan", test_cases=test_cases, properties=properties)

We're open to contributions here!

@stale
Copy link

stale bot commented Dec 4, 2022

Thanks for contributing to Checkov! We've automatically marked this issue as stale to keep our issues list tidy, because it has not had any activity for 6 months. It will be closed in 14 days if no further activity occurs. Commenting on this issue will remove the stale tag. If you want to talk through the issue or help us understand the priority and context, feel free to add a comment or join us in the Checkov slack channel at https://slack.bridgecrew.io
Thanks!

@stale stale bot added the stale label Dec 4, 2022
@stale
Copy link

stale bot commented Dec 18, 2022

Closing issue due to inactivity. If you feel this is in error, please re-open, or reach out to the community via slack: https://slack.bridgecrew.io Thanks!

@stale stale bot closed this as completed Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants