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(query): update ebs not optimized queries #5020

Merged
merged 4 commits into from
Mar 25, 2022

Conversation

lipeavelar
Copy link
Contributor

Closes #4968

Proposed Changes

  • Add a list of optimized queries by default on common.json;
  • Add a function on common.rego to check if instance type is listed on
    optimized by default instance's list;
  • Add this check to ebs optimizes rules on terraform, ansible and cloud
    formation;
  • Add new test files to validate cases where instance type is optimized
    by default;
  • Fix some minor errors;

For this fix is important to note there is an explanation which
documentation was used to decide what is default value for instance
type.

Signed-off-by: Felipe Avelar [email protected]

I submit this contribution under the Apache-2.0 license.

- Add a list of optimized queries by default on `common.json`;
- Add a function on `common.rego` to check if instance type is listed on
optimized by default instance's list;
- Add this check to ebs optimizes rules on terraform, ansible and cloud
formation;
- Add new test files to validate cases where instance type is optimized
by default;
- Fix some minor errors;

For this fix is important to note there is an explanation which
documentation was used to decide what is default value for instance
type.

Signed-off-by: Felipe Avelar <[email protected]>
@kicsbot
Copy link
Contributor

kicsbot commented Mar 19, 2022

Scan submitted to Checkmarx

@kicsbot
Copy link
Contributor

kicsbot commented Mar 19, 2022

Logo
Checkmarx SAST - Scan Summary & Details

Cx-SAST Summary

Total of 5 vulnerabilities
High 0 High
Medium 0 Medium
Low 5 Low
Info 0 Info

Violation Summary

No policy violation found

Signed-off-by: Felipe Avelar <[email protected]>
@rafaela-soares rafaela-soares added query New query feature community Community contribution labels Mar 21, 2022
Copy link
Contributor

@rafaela-soares rafaela-soares left a comment

Choose a reason for hiding this comment

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

Hello, @lipeavelar! So glad to see you here ❤️ We miss you a lot!

Thank you so much for continuing to contribute! I hope you are doing well!

Copy link
Contributor

@rafaela-soares rafaela-soares left a comment

Choose a reason for hiding this comment

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

@lipeavelar , sorry for noticing just now, but I think we should check if the field ebs optimized is set to false when there is no instance type with ebs optimized by default.

As mentioned in the documentation, "There is no need to enable EBS optimization and no effect if you disable EBS optimization".

I left some suggestions. The sample applies to the Terraform query.

Copy link
Contributor

@rafaela-soares rafaela-soares left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@rafaela-soares rafaela-soares merged commit d6dee9e into Checkmarx:master Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution query New query feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(query): EC2 Not EBS Optimized False Positive
3 participants