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

[8.x](backport #2540) Handle password policy not found error #2542

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Sep 18, 2024

Summary of your changes

There is a bug on aws (based on After reading aws/aws-cli#7265 and aws/aws-cli#8402 reading), which in case of a user deleting the password policy, an NoSuchEntityException will be thrown - while that isn't true because password policies have default values in place.

The impact of such a bug to us is that we receive the API error, log the error and doesn't evaluate the policy on OPA layer, missing this finding on such case.

This PR handles the error, and in case of NoSuchEntityException, creates an empty password policy, which will then fail on the OPA layer.

it's important to notice, tho that an empty password policy doesn't represent reality, because there is a password policy in place, it just isn't returned

Screenshot/Data

Manual Test of the aws bug
image

Proof that we have a failing finding if the password policy is deleted
image

Related Issues

Checklist

* Handle password policy not found error

* Clean up the code

* Add header

* Fix imports

(cherry picked from commit 1001477)
@mergify mergify bot requested a review from a team as a code owner September 18, 2024 13:30
@mergify mergify bot added the backport label Sep 18, 2024
Copy link
Author

mergify bot commented Sep 23, 2024

This pull request has not been merged yet. Could you please review and merge it @romulets? 🙏

@romulets romulets enabled auto-merge (squash) September 23, 2024 13:17
@romulets romulets merged commit b174814 into 8.x Sep 23, 2024
11 checks passed
@romulets romulets deleted the mergify/bp/8.x/pr-2540 branch September 23, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant