βœ… Day 7 of My Cloud Journey ☁ – Introduction to IAM: Identity & Access Management πŸ”

Pratik DasPratik Das
3 min read

Welcome to Day 7 of my #30DaysOfCloud journey!
Today, I dove into IAM – Identity and Access Management, one of the most critical building blocks of cloud security in AWS.


πŸ” What is IAM?

IAM (Identity and Access Management) is an AWS service that helps securely manage access to AWS resources.
It lets you define:

  • Who can access your AWS resources (identities)

  • What actions they can perform

  • Which resources they can access

  • Under what conditions (e.g., from a certain IP, with MFA, etc.)

Think of IAM as your cloud’s security gatekeeper.


🧩 Key Components of IAM

1️⃣ IAM Users πŸ‘€

An IAM user represents a real person or service that interacts with AWS.

  • Has long-term credentials: Access Key ID + Secret

  • Can sign in to AWS Console or use CLI/API

  • Should be given only necessary permissions

2️⃣ IAM Groups πŸ‘₯

Groups let you organize users and assign policies in bulk.

  • Example: Group "Developers" has EC2 + S3 access

  • All users in that group inherit those permissions

πŸ” Helps with team management and security policies at scale.

3️⃣ IAM Roles 🎭

Roles allow temporary access to AWS resources.
They are not tied to specific users and are ideal for:

  • EC2 instances

  • Lambda functions

  • Cross-account access

  • Federated access (SSO, external identity providers)

πŸ“Œ Roles assume permissions temporarily and use security tokens.

4️⃣ IAM Policies πŸ“œ

Policies are JSON documents that define allowed/denied actions on AWS resources.

Example:

jsonCopyEdit{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:*",
      "Resource": "*"
    }
  ]
}
  • Managed policies: Provided by AWS

  • Custom policies: Created by you for fine-grained control

5️⃣ Multi-Factor Authentication (MFA) πŸ”

MFA adds an extra layer of protection to your AWS account.

  • Users must enter a one-time code from a device (e.g., Authy, Google Authenticator)

  • Highly recommended for admin accounts


πŸ›  Real-World Use Cases

Here’s how IAM fits into daily AWS work:

βœ… Give EC2 instances permission to access S3
βœ… Restrict developers to specific resources like DynamoDB
βœ… Rotate API keys securely
βœ… Set up cross-account roles for external collaboration
βœ… Apply Service Control Policies (SCPs) in organizations
βœ… Enforce MFA for privileged users


βš™ How IAM Works (Example Scenario)

Let’s say you want your EC2 instance to access a private S3 bucket without hardcoding credentials.

Steps:

  1. Create an IAM Role

  2. Attach S3 read/write permissions to the role

  3. Attach that role to your EC2 instance

  4. EC2 automatically uses temporary credentials

βœ… No hardcoded secrets
βœ… Secure, temporary, and scoped permissions


⚠️ Best Practices for IAM

πŸ”’ Follow Principle of Least Privilege
Give only the permissions required β€” nothing more.

πŸ”„ Rotate credentials regularly
🎭 Use roles instead of hardcoded access keys
πŸ“› Never share your root account credentials
πŸ” Enable MFA for all users, especially admins
πŸ§ͺ Test policies using the IAM Policy Simulator


πŸ” Bonus – IAM Policy Simulator

Try this out to test your IAM policies:

πŸ”— https://policysim.aws.amazon.com/


🌟 What’s Next?

Tomorrow, I’ll take this further:

  • Create IAM roles

  • Attach them to EC2

  • Use the AWS CLI to access S3 using role-based credentials

This hands-on will help reinforce the secure practices of role assumption and temporary access tokens.


πŸ”— Resources to Learn More


πŸ“£ Let's Connect

If you’re also learning Devops, AWS or cloud computing, follow along or reach out!
Let’s grow and share knowledge together. πŸš€

0
Subscribe to my newsletter

Read articles from Pratik Das directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pratik Das
Pratik Das