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(efs): check all public conditions #3872

Conversation

sergargar
Copy link
Member

Description

As in https://docs.aws.amazon.com/efs/latest/ug/access-control-block-public-access.html#what-is-a-public-policy, check all the possible conditions that could make an EFS volume public.

License

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

@sergargar sergargar requested a review from a team as a code owner April 29, 2024 16:37
@sergargar sergargar requested a review from a team as a code owner April 29, 2024 16:37
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label Apr 29, 2024
Copy link

codecov bot commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 86.39%. Comparing base (35c8ea5) to head (897f784).
Report is 11 commits behind head on master.

Files Patch % Lines
prowler/providers/aws/services/efs/lib/lib.py 88.88% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3872      +/-   ##
==========================================
+ Coverage   86.33%   86.39%   +0.05%     
==========================================
  Files         746      747       +1     
  Lines       23228    23246      +18     
==========================================
+ Hits        20055    20083      +28     
+ Misses       3173     3163      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

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

Great improvement @sergargar 👏

I left some comments about code organisation and some things missing in tests.

and conditions["Bool"].get("elasticfilesystem:AccessedViaMountTarget")
== "true"
):
return True
Copy link
Member

Choose a reason for hiding this comment

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

It'd be more readable to set a has_secure_conditions = False by default and the here

Suggested change
return True
has_secure_conditions = True

@sergargar sergargar added the backport-v3 Pending to port to Prowler v3 branch label Apr 30, 2024
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

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

Lovely!!! Thanks for taking care of this 🚀

@jfagoagas jfagoagas merged commit b54ecb5 into master Apr 30, 2024
11 checks passed
@jfagoagas jfagoagas deleted the 3865-bug-efs_not_publicly_accessible-does-not-consider-recommended-aws-condition-1 branch April 30, 2024 11:08
sergargar added a commit that referenced this pull request May 3, 2024
@sergargar sergargar added backport-v3 Pending to port to Prowler v3 branch and removed backport-v3 Pending to port to Prowler v3 branch labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: efs_not_publicly_accessible does not consider recommended AWS condition.
2 participants