Skip to content

Fix false positive root MFA when org centralized root access is enabled#1723

Open
raajheshkannaa wants to merge 2 commits intonccgroup:masterfrom
raajheshkannaa:bugfix/1710-root-mfa-centralized-access
Open

Fix false positive root MFA when org centralized root access is enabled#1723
raajheshkannaa wants to merge 2 commits intonccgroup:masterfrom
raajheshkannaa:bugfix/1710-root-mfa-centralized-access

Conversation

@raajheshkannaa
Copy link
Copy Markdown

Summary

Fixes #1710

When AWS Organizations centralized root access management is enabled and root credentials are removed from member accounts, ScoutSuite incorrectly flags "Root Account without MFA". This happens because the credential report shows mfa_active as false for the root user, but MFA cannot and need not be configured when root credentials have been centrally removed.

Changes:

  • Added get_organizations_root_credentials_managed() to the IAM facade, which calls iam:ListOrganizationsFeatures to check if RootCredentialsManagement is enabled. Fails gracefully (returns False) when the account is not in an org or lacks the required permission.
  • In credentialreports.py, the result is used to set a root_credentials_managed_centrally flag on the root credential report entry.
  • Both iam-root-account-no-mfa.json and iam-root-account-no-hardware-mfa.json rules now include a condition to skip accounts where this flag is true.
  • Updated test fixture iam-root.json with the new field and a test case for the centralized root access scenario.

Test plan

  • Run ScoutSuite against an AWS account without Organizations or centralized root access. Verify root MFA finding still fires when MFA is not enabled.
  • Run ScoutSuite against an AWS Organizations member account with centralized root access enabled and root credentials removed. Verify root MFA finding does NOT fire.
  • Run ScoutSuite against an account where iam:ListOrganizationsFeatures is not permitted. Verify the API call fails silently and root MFA finding behaves as before (no regression).
  • Run python -m pytest tests/test_rules_processingengine.py to validate the rule engine test with updated fixtures.

…is enabled

When AWS Organizations centralized root access management is enabled and
root credentials are removed from member accounts, ScoutSuite incorrectly
flags "Root Account without MFA" because the credential report shows
mfa_active as false. MFA cannot and need not be configured when root
credentials have been centrally removed.

This fix calls iam:ListOrganizationsFeatures to detect whether
RootCredentialsManagement is enabled for the organization, and sets a
root_credentials_managed_centrally flag on the root credential report
entry. Both MFA finding rules now include a condition to skip accounts
where this flag is true.

The API call fails gracefully (returns False) when the account is not
in an org or lacks iam:ListOrganizationsFeatures permission.

Fixes nccgroup#1710
- Set mfa_active to "false" in centralized root test entry so the
  rule engine actually reaches the root_credentials_managed_centrally
  condition (previously "not_supported" short-circuited the check)
- Add warning log when Organizations API call fails for debugging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive for AWS "Root Account without MFA"

1 participant