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(output): Handle case for None organizations metadata #3914

Merged
merged 5 commits into from May 6, 2024

Conversation

pedrooot
Copy link
Member

@pedrooot pedrooot commented May 3, 2024

Context

Fixes #3909
Fixes #3897

Description

Organizations metadata were None in some cases. This issue was generating empty Prowler outputs but in this pr the problem is solved.

Thanks @jfagoagas for the help!

License

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

@pedrooot pedrooot requested review from a team as code owners May 3, 2024 08:51
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label May 3, 2024
sergargar
sergargar previously approved these changes May 3, 2024
Copy link
Member

@sergargar sergargar left a comment

Choose a reason for hiding this comment

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

Great fix 👏🏼

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.

That's a great fix! Could you add a test to check this behaviour?

Also edit the check docstring to indicate that it returns an empty object if nothing returned froM AWS.

Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.31%. Comparing base (c67c23d) to head (6802c67).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3914      +/-   ##
==========================================
- Coverage   86.40%   86.31%   -0.10%     
==========================================
  Files         748      748              
  Lines       23295    23298       +3     
==========================================
- Hits        20128    20109      -19     
- Misses       3167     3189      +22     

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

sergargar
sergargar previously approved these changes May 3, 2024
@pedrooot pedrooot requested a review from jfagoagas May 6, 2024 06:06
@jfagoagas jfagoagas requested a review from sergargar May 6, 2024 08:37
@@ -5,7 +5,7 @@ def unroll_list(listed_items: list, separator: str = "|"):
if not unrolled_items:
unrolled_items = f"{item}"
else:
unrolled_items = f"{unrolled_items} {separator} {item}"
Copy link
Member

Choose a reason for hiding this comment

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

I think we want to leave this for the | but not for the ,, could you please adapt it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@sergargar sergargar requested a review from jfagoagas May 6, 2024 09:45
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.

🔝

@jfagoagas jfagoagas merged commit d4a079a into master May 6, 2024
10 of 11 checks passed
@jfagoagas jfagoagas deleted the account-tags-fix branch May 6, 2024 10:39
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]: empty json-ocsf output in 4.1.0 [Bug]: csv output is empty (only column names)
3 participants