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: none custom policies severity issues should be filtered out before sending them to registry #3606

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

wbeuil
Copy link
Contributor

@wbeuil wbeuil commented Aug 18, 2022

What does this PR do?

Related to this Tier 3 Zendesk ticket where if you tried to send to /iac-share-results endpoint issues with custom policies set to NONE in the Snyk UI, you were getting an error using the --report in the CLI. Whereas, without the --report flag, everything works fine.

Behind the user experience, the problem is that we got a weird bug where registry send back to the CLI a 400 introduced in this PR and we're now throwing an error back to the client due to a change of errors handling introduced here.

This PR is simply filtering NONE custom policies severity issues prior to sending them through the /iac-share-results endpoint.

How should this be manually tested?

Create a simple terraform file like this one:

resource "aws_s3_bucket" "this" {
  force_destroy = true
}

And then run this first command to check that it works fine without any custom policies:

$ snyk iac test <YOUR_TERRAFORM_FILE>

Go into Snyk UI and change one policies to NONE:

image

And rerun the above command, it should send only the other issues and not the one you changed in the UI.

What are the relevant tickets?

Zendesk ticket

@wbeuil wbeuil requested a review from YairZ101 August 18, 2022 18:38
@wbeuil wbeuil requested review from a team as code owners August 18, 2022 18:38
@github-actions
Copy link
Contributor

Warnings
⚠️

"fix: none custom policies severity issues should be filtered out before sending them to registry" is too long. Keep the first line of your commit message under 72 characters.

Generated by 🚫 dangerJS against 4acacd2

@wbeuil wbeuil requested a review from ipapast August 19, 2022 13:10
Copy link
Contributor

@ipapast ipapast left a comment

Choose a reason for hiding this comment

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

looks good, thank you!

@wbeuil wbeuil merged commit c3095cf into master Aug 22, 2022
@wbeuil wbeuil deleted the fix/none-custom-policies-filtering branch August 22, 2022 07:01
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