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(aws): exclude member accounts in IAM Root Credentials check #5813

Conversation

MrCloudSec
Copy link
Member

@MrCloudSec MrCloudSec commented Nov 18, 2024

Context

The recently added check iam_root_credentials_management_enabled uses the ListOrganizationsFeatures API to verify if centralized root credentials management is enabled. However, this API is restricted to the management account or delegated administrators. AWS Support confirmed that member accounts cannot access this information, resulting in the AccountNotManagementOrDelegatedAdministratorException error.

Description

The check now skips findings for member accounts, as they are unable to retrieve the required data due to API restrictions. This ensures accurate results without unnecessary findings for member accounts.

Checklist

License

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

@MrCloudSec MrCloudSec requested review from a team as code owners November 18, 2024 18:28
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label Nov 18, 2024
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.87%. Comparing base (572d5a1) to head (50e7597).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
prowler/providers/aws/services/iam/iam_service.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5813      +/-   ##
==========================================
- Coverage   89.91%   89.87%   -0.04%     
==========================================
  Files        1133     1133              
  Lines       35308    35313       +5     
==========================================
- Hits        31747    31739       -8     
- Misses       3561     3574      +13     

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


🚨 Try these New Features:

@jfagoagas jfagoagas self-requested a review November 19, 2024 14:05
@jfagoagas jfagoagas merged commit a5f5967 into master Nov 19, 2024
9 of 11 checks passed
@jfagoagas jfagoagas deleted the PRWLR-5403-handle-check-iam-root-credentials-management-enabled-for-member-accounts branch November 19, 2024 14:06
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.

2 participants