-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aws): add new check iam_root_credentials_management_enabled
- Loading branch information
1 parent
78b518e
commit 6904594
Showing
20 changed files
with
522 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
33 changes: 33 additions & 0 deletions
33
...root_credentials_management_enabled/iam_root_credentials_management_enabled.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"Provider": "aws", | ||
"CheckID": "iam_root_credentials_management_enabled", | ||
"CheckTitle": "Ensure centralized root credentials management is enabled", | ||
"CheckType": [], | ||
"ServiceName": "iam", | ||
"SubServiceName": "", | ||
"ResourceIdTemplate": "arn:partition:service:region:account-id:resource-id", | ||
"Severity": "high", | ||
"ResourceType": "Other", | ||
"Description": "Checks if centralized management of root credentials for member accounts in AWS Organizations is enabled. This ensures that root credentials are managed centrally, reducing the risk of unauthorized access or mismanagement.", | ||
"Risk": "Without centralized root credentials management, member accounts retain full control over their root user credentials, increasing the risk of credential misuse, mismanagement, or compromise.", | ||
"RelatedUrl": "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#id_root-user-access-management", | ||
"Remediation": { | ||
"Code": { | ||
"CLI": "aws iam enable-organizations-root-credentials-management", | ||
"NativeIaC": "", | ||
"Other": "", | ||
"Terraform": "" | ||
}, | ||
"Recommendation": { | ||
"Text": "Enable centralized management of root access for member accounts using the CLI or IAM console.", | ||
"Url": "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-enable-root-access.html" | ||
} | ||
}, | ||
"Categories": [], | ||
"DependsOn": [], | ||
"RelatedTo": [ | ||
"iam_root_hardware_mfa_enabled", | ||
"iam_root_mfa_enabled" | ||
], | ||
"Notes": "" | ||
} |
27 changes: 27 additions & 0 deletions
27
...es/iam/iam_root_credentials_management_enabled/iam_root_credentials_management_enabled.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from prowler.lib.check.models import Check, Check_Report_AWS | ||
from prowler.providers.aws.services.iam.iam_client import iam_client | ||
from prowler.providers.aws.services.organizations.organizations_client import ( | ||
organizations_client, | ||
) | ||
|
||
|
||
class iam_root_credentials_management_enabled(Check): | ||
def execute(self) -> Check_Report_AWS: | ||
findings = [] | ||
if ( | ||
organizations_client.organization | ||
and organizations_client.organization.status == "ACTIVE" | ||
): | ||
report = Check_Report_AWS(self.metadata()) | ||
report.region = iam_client.region | ||
report.resource_arn = iam_client.audited_account_arn | ||
report.resource_id = iam_client.audited_account | ||
if "RootCredentialsManagement" in iam_client.organization_features: | ||
report.status = "PASS" | ||
report.status_extended = "Root credentials management is enabled." | ||
else: | ||
report.status = "FAIL" | ||
report.status_extended = "Root credentials management is not enabled." | ||
findings.append(report) | ||
|
||
return findings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.