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

return in finally can swallow exceptions #5520

Open
iritkatriel opened this issue Oct 24, 2024 · 1 comment
Open

return in finally can swallow exceptions #5520

iritkatriel opened this issue Oct 24, 2024 · 1 comment
Labels
bug provider/aws Issues/PRs related with the AWS provider python Pull requests that update Python code severity/low Bug won't result in any noticeable breakdown of the execution.

Comments

@iritkatriel
Copy link

iritkatriel commented Oct 24, 2024

Steps to Reproduce

Inspection of source code

Expected behavior

Avoid return in finally.

Actual Result with Screenshots or Logs

There are several places in your code (listed below) where there is a return statement in a finally block, which would swallow any in-flight exception.

This means that if an unhandled exception (including a BaseException such as KeyboardInterrupt) is raised from the try body, or any exception is raised from one of the except: clauses, it will not propagate on as expected.

See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.

return stored_password_policy

How did you install Prowler?

NA

Environment Resource

NA

OS used

NA

Prowler version

master branch

Pip version

NA

Context

No response

@iritkatriel iritkatriel added bug status/needs-triage Issue pending triage labels Oct 24, 2024
@MrCloudSec
Copy link
Member

Hi @iritkatriel, I will review this logic internally with the team and I will come back with a solution. Thanks for letting us know!

@MrCloudSec MrCloudSec added severity/low Bug won't result in any noticeable breakdown of the execution. provider/aws Issues/PRs related with the AWS provider python Pull requests that update Python code and removed status/needs-triage Issue pending triage labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug provider/aws Issues/PRs related with the AWS provider python Pull requests that update Python code severity/low Bug won't result in any noticeable breakdown of the execution.
Projects
None yet
Development

No branches or pull requests

2 participants