This rule ensures that you do not allow wildcard actions for services in IAM customer managed policies.
Rule | IAM customer managed policies that you create should not allow wildcard actions for services |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ Low |
Rule Description
The rule states that any customer managed policies created in IAM should not allow wildcard actions for services, as part of the AWS Foundational Security Best Practices. This ensures that IAM policies have a more granular and controlled approach, reducing the risk of unauthorized or unintended actions.
Troubleshooting Steps
If a customer managed policy allows wildcard actions for services, it's necessary to review and update the policy to remove the wildcard or replace it with specific actions. Here are the troubleshooting steps to follow:
Identify the policy: Determine which customer managed policy allows wildcard actions for services. This can be done by reviewing the list of policies in the AWS Management Console or using the AWS CLI.
Analyze the policy: Review the policy to understand which services are affected by the wildcard actions. Identify the potential risks and unauthorized actions that can be performed due to the wildcard usage.
Update the policy: Modify the policy to remove the wildcard actions or replace them with specific actions that are necessary for the intended use case. Be mindful to only allow the required actions and limit unnecessary permissions.
Test the updated policy: Validate the updated policy by applying it to the appropriate IAM users, groups, or roles. Test the user's ability to perform the required actions without any unnecessary additional permissions.
Monitor and review: Regularly monitor and review the policies to ensure any changes or updates are properly implemented and adhere to the security best practices. This will help maintain a secure and controlled IAM environment.
Necessary Codes
In case you need to update a customer managed policy using the AWS CLI, you can use the following command as a reference:
aws iam update-policy --policy-arn <policy-arn> --policy-document file://path/to/policy.json
Replace
<policy-arn>
with the ARN (Amazon Resource Name) of the policy you want to update, and path/to/policy.json
with the file path of the updated policy document.Make sure to update the policy document to remove the wildcard actions or adjust them to specific actions as required.
Step-by-Step Guide for Remediation
Follow these step-by-step instructions to remediate a customer managed policy that allows wildcard actions for services:
Identify the policy:
Analyze the policy:
Update the policy:
Test the updated policy:
Monitor and review:
By following these steps, you can remediate customer managed policies in IAM that allow wildcard actions for services, aligning with the AWS Foundational Security Best Practices and ensuring a more secure IAM environment.