Simplifying AWS Security: IAM, Groups, Roles, and Policies Explained
IAM, Groups ,Roles and Policies are essential concepts in AWS (Amazon Web Services) for securely managing access to AWS resources. Let's take a closer look at each of these concepts.
What is IAM?
IAM (Identity and Access Management) in AWS is a service that helps you control who (users, groups, or services) can access what (AWS resources) and how (permissions). It's used to securely manage access to AWS services and resources. Let's elaborate on the definition with an example:
Example: Consider a company named XYZ that uses AWS services and has a team of 20 people. In this company, the IT or cloud administrators will create a root account for the company and then create IAM accounts for individuals who need access to AWS services.
You might wonder, why not just use the root account for everyone? Giving root access to employees can be risky. If an employee is new to AWS or cloud services, they may accidentally delete important resources like EC2 instances or S3 buckets, leading to the loss of critical company or client-related information. To prevent such issues, IAM accounts are created for employees who need access to AWS services.
IAM accounts are created by the IT or cloud team using the root user account. They create IAM user accounts, providing details such as the AWS root account ID, username, and password using this they can login to AWS account. In the IAM account creation console, there's an option to "Provide user access to the AWS Management Console." By checking this option, administrators can choose to create a custom password for the IAM user or auto-generate one. Additionally, there's an option to require users to create a new password upon login, which is useful for enhancing security. After logging in, users see the AWS console with the provided or restricted services and permissions.
IAM users cannot perform all actions like the root user they can only perform actions allowed by the permissions granted to them. They can view only the assigned services and permissions and cannot modify or delete them. This is a brief overview of IAM and how it is used to create and manage user access to AWS services.
Now, let's discuss groups:
In the previous example of company XYZ, where there were 20 employees, IAM user accounts were created for each individual. However, as the company grows and new employees join, managing IAM accounts and granting permissions individually can become cumbersome.
To simplify this process, AWS IAM offers a feature called groups. With groups, users can be categorized based on their roles or departments. For example, the 20 employees could be split into groups such as developers, QA team, etc., with 10 employees in each group.
When a new employee joins, an IAM user account is created for them, and they are added to the appropriate group. Permissions can then be granted to the group, making it easier to manage access. If new permissions need to be granted, they can be assigned to the group, and all users in that group will inherit those permissions. This reduces the administrative burden of managing individual user permissions and helps ensure consistent access management practices across the organization.
Now, let's discuss Roles:
Roles in IAM are similar to users but are meant for AWS resources rather than individual users. They are used to grant permissions to entities that need to access AWS resources without using long-term credentials.
Why use Roles? Roles are used to delegate access to AWS resources securely. They are often used by services like EC2 instances, Lambda functions, or AWS CLI to access other AWS resources without needing access keys.
Now, let's discuss Policies:
Policies in IAM are JSON documents that define permissions. They can be attached to users, groups, or roles to specify what actions are allowed or denied on which resources.
Why use Policies? Policies are used to define fine-grained permissions. They allow you to specify who has access to your AWS resources and what actions they can perform.
Uses of Policies:
Define permissions for users, groups, or roles
Control access to AWS resources
Ensure security and compliance with organizational policies.
Let see an example on policies ,IT/cloud administrators create IAM policies to define permissions.
Example: IAM policy for the "Developers" group
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:StartInstances",
"ec2:StopInstances"
],
"Resource": "*"
}
]
}
This policy allows members of the "Developers" group to describe, start, and stop EC2 instances.
In above example, IAM is used to manage access to AWS resources for XYZ company's employees. IAM users are grouped based on their roles, and policies are used to define permissions. Roles are used for granting permissions to AWS services or applications. This setup helps XYZ company ensure that only authorized individuals and services can access their AWS resources.
I am also learning and improving my knowledge of AWS. I hope this explanation has given you a clear idea about IAM and Groups in AWS.If you feel that anything in this explanation is incorrect or needs further clarification, please feel free to mention it in the comments. I am always open to feedback and eager to learn.
Subscribe to my newsletter
Read articles from Raja Kalyanapu directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Raja Kalyanapu
Raja Kalyanapu
I am a recent graduate with a Master's degree in Electrical and Computer Engineering from the University of Alabama at Birmingham. I am passionate about cloud computing, DevOps, and data analysis, and have honed my skills in Python, SQL, AWS, and data visualization. Currently, I am focused on leveling up my Java skills with CI/CD and Kubernetes, and am actively seeking full-time opportunities in the tech industry. In my free time, I enjoy exploring new technologies and sharing my insights on AWS, DevOps, and more.