Blog | G5 Cyber Security

Fix AWS IAM Permissions

TL;DR

You can’t access something in AWS because of an IAM permission issue. This guide shows you how to find the problem and fix it.

1. Understand the Error Message

The first step is to carefully read the error message. It usually tells you:

Example error message:

User arn:aws:iam::123456789012:user/MyUser is not authorized to perform: ec2:RunInstances on resource: *

2. Identify the IAM User, Group or Role

Figure out who is having the problem:

Check the AWS Management Console’s IAM section to see which user, group or role you are logged in as.

3. Check Attached Policies

IAM permissions come from policies. These policies are attached to users, groups, or roles.

  1. Go to the IAM section of the AWS Management Console.
  2. Select Users/Groups/Roles depending on who has the issue.
  3. Choose the relevant user, group or role.
  4. Go to the “Permissions” tab. This shows all attached policies.

Look for policies that should grant access to the service you’re using.

4. Review Policy Statements

Policies are made up of statements. Each statement defines what actions are allowed or denied on which resources.

  1. Click on a policy to view its JSON definition.
  2. Examine the “Statement” section. Look for statements that cover the action you’re trying to perform.

Example Policy Statement (allowing EC2 instance launches):

{
  "Effect": "Allow",
  "Action": [
    "ec2:RunInstances"
  ],
  "Resource": "*"
}

5. Common Policy Issues and Fixes

6. Test Your Changes

After making changes to policies:

  1. Wait a few minutes for the changes to propagate (it can take up to 10-15 minutes).
  2. Try the action again that was failing.

If it still fails, double-check your policy statements and ensure there are no conflicting rules.

7. Use AWS IAM Policy Simulator

The IAM Policy Simulator is a powerful tool for testing permissions without actually making changes to your policies. It lets you simulate the actions of a user, group or role and see which permissions are granted or denied.

Exit mobile version