DEV Community

Cover image for AWS Identity Access and Management
Hafsa Javed
Hafsa Javed

Posted on

AWS Identity Access and Management

If you’re in tech, you’ve probably heard the word cloud. Cloud is a super cool tool to know about because its potential and infrastructure give you freedom and services to use in whatever tech stuff you do. Whether you're hosting a website that scales effortlessly to handle millions of users, analyzing massive datasets for insights in minutes, or building AI-powered applications with cutting-edge tools, the cloud makes it all possible. This potential of the cloud is due to its robust infrastructure, and the management of all this infrastructure is handled by Identity and Access Management.

AWS Identity and Access Management (IAM) is one of the most fascinating concepts in the cloud ecosystem. As the foundation of cloud security, IAM plays a pivotal role in managing and securing access to resources. In this discussion, we’ll explore what IAM is, the challenges that led to its development, how it has transformed our approach to cloud security, and its versatile applications. Whether you’re a beginner stepping into the cloud or a seasoned developer, IAM is a must-know concept that continues to shape the way we interact with cloud technologies.

Overview of topics in article

What is IAM, Anyway?

Imagine this: You're playing an epic fantasy role-playing game (RPG).

In this RPG, each character has its own strengths and weaknesses. Warriors are tanky fighters, strong in melee combat but can't cast spells. Sorcerers can cast magical spells from a distance, but they’re not the toughest. And then there are the Rogues, who rely on stealth and agility to outsmart their enemies.

Each character has access to a different set of skills (permissions) based on their abilities and level. For example, a level 1 player might only have access to a basic map, while a level 10 player gets to roam through advanced, high-level areas.

But sometimes, a warrior might find a magical ring that grants them temporary spell-casting abilities, but only if the game rules allow it. And just like in real life, the game admins (game masters) can change the rules whenever they want.

Mapping This to AWS IAM

Mapping RPG to AWS

Now, picture the AWS Cloud Infrastructure as your game world. Instead of knights and sorcerers, you have Users, Roles, and Policies. Here’s how the game works in AWS:

Mapping RPG to AWS

  • Users = the characters, each with their own access level.
  • Roles = think of them as magical artifacts that grant temporary powers. A role lets users or applications do things they wouldn’t normally be able to, like accessing a secret vault (a resource in AWS).
  • Policies = the game’s rules. They tell each character exactly what they can and can't do.
  • Admins = the game masters. They can break the rules and do whatever they want.

So, IAM in AWS is like the game master of a huge RPG—ensuring that each player only gets access to the areas they’re authorized to explore.

Expanding on further IAM Concepts

  • Federated Players (Federation)

    Imagine players joining the game from other allied kingdoms (external systems). These players already have identities in their own kingdom but need temporary access to this game. This is equivalent to Identity Federation in IAM, where users from external identity providers (like Google or Active Directory) access AWS resources without needing new IAM users.

  • Magic Scrolls (Access Keys)

    In the game, certain magical scrolls grant players the ability to open locked doors or access hidden areas without physically being present. These scrolls represent IAM access keys, enabling programmatic access to resources via AWS APIs. However, if a scroll falls into the wrong hands, it can be disastrous, just like access keys need to be protected to avoid unauthorized access.

  • Character Progression (Permission Boundaries)

    Players may be given new abilities as they progress, but their powers are always limited by specific rules to ensure fairness. This mirrors permission boundaries in IAM, which are the maximum permissions a user or role can have, no matter what additional policies are attached.

  • Sidekicks and Helpers (Service-linked Roles)

    Some players have sidekicks—loyal companions that perform specific tasks like carrying items or helping in battles. These are like service-linked roles in IAM, which AWS services create and manage to perform actions on your behalf, ensuring precise permissions for that service.

  • Borrowed Gear (Resource-based Policies)

    Players can sometimes borrow gear from other guilds, but they need the guild’s approval to use it. This represents resource-based policies, where the permission to access a resource is defined on the resource itself rather than the character (user).

  • Stealth Missions (Session Policies)

    During stealth missions, players might be granted temporary powers or abilities that disappear once the mission is complete. This is like session policies, where temporary policies are attached to a role or user for specific tasks during a session.

  • Guild Hierarchies (IAM Groups)

    Larger guilds often have hierarchies—some players can make strategic decisions, while others carry out instructions. This is akin to managing IAM groups and applying permissions at the group level to control access based on roles in the guild.

  • Restricted Zones (Conditions)

    Players might only enter specific game zones at night or during special events. These restrictions align with IAM condition keys, which allow fine-grained access control based on factors like time, IP address, or device type.

  • Special Passes (MFA - Multi-Factor Authentication)

    Certain high-value zones require players to use special passes and prove their identity twice, like solving a puzzle before entering. This is equivalent to Multi-Factor Authentication (MFA) in IAM, adding an extra layer of security for sensitive actions.

  • Forgotten Players (Inactive Users)

    Some players stop participating in the game for a long time. Their profiles are archived but can be reactivated if needed. In IAM, this is like identifying and cleaning up inactive users to maintain security hygiene.

  • Game Logs (CloudTrail and IAM Access Analyzer)

    The game keeps logs of every player’s actions—who entered which zone, used which weapon, or interacted with NPCs. This represents CloudTrail, which logs API activity, and IAM Access Analyzer, which identifies overly permissive access to help tighten policies.

  • Character Trading (Cross-account Roles)

    Players from one guild may temporarily join another guild for joint missions, bringing their gear and abilities. This corresponds to cross-account roles, where users from one AWS account can assume a role in another account for collaborative tasks.

  • Banishing Players (IAM Deny Policies)

    In certain situations, a player may be explicitly banned from using particular abilities or zones, even if their role allows it. This represents explicit deny policies in IAM, which override all other permissions, ensuring restricted access.


Why IAM? The need for control

History of IAM

The rise of cloud computing:

When AWS launched its first services, like S3 in 2006, cloud computing was in its infancy. Businesses were intrigued by the potential of on-demand resources and pay-as-you-go pricing. However, in the early days, access management was very basic. Everyone shared a single set of credentials for the AWS account, and this worked when organizations were small or used AWS for limited purposes.

But as cloud adoption grew, businesses started building complex architectures involving multiple services and teams. Developers needed access to compute resources like EC2 instances. Data analysts required access to S3 storage buckets. Admins needed the ability to manage billing and account settings. Sharing a single set of credentials was not only inefficient but also possed significant security risks:

  • Lack of granularity: Everyone had the same level of access, even if they didn’t need it.
  • High risk of leaks: A single compromised credential could expose the entire system.
  • Manual management headaches: Revoking access for a team member or limiting permissions meant changing passwords for the entire account.

The need for better credential management:

As businesses began to scale their operations in the cloud, it became clear that shared credentials were unsustainable. Organizations realized they needed to manage who could access their cloud resources and what actions they were allowed to perform. Long-term credential management became particularly problematic as teams relied on hardcoded credentials in scripts or applications, increasing the risk of exposure.

The Origins of IAM (2010):

When AWS launched Identity and Access Management (IAM) in 2010, it was designed to address the immediate challenges of managing cloud access securely and efficiently. Early IAM capabilities included:

  • Users: Individual identities within an AWS account.
  • Groups: Logical collections of users for permission assignment.
  • Roles: Temporary credentials for users, applications, or services.
  • Policies: JSON documents defining permissions for users, groups, and roles.

This framework solved many early problems by enabling:

  • Granular access control: Users were given specific permissions instead of blanket access.
  • Temporary credentials: Reducing the risk associated with hardcoding credentials.
  • Separation of duties: Different users and teams could perform tasks relevant to their roles.

However, IAM was designed for single-account environments, which became a limitation as organizations scaled.

The Shift to Multi-Account Architectures:

As businesses began to expand their use of AWS, multi-account strategies emerged as a best practice. These strategies:

  1. Isolated workloads and teams across accounts for security and compliance.
  2. Streamlined billing and project management.
  3. Allowed organizations to align accounts with business units or applications.

Managing access in a multi-account environment using IAM alone became complex:

  • Manual duplication: IAM users and roles needed to be replicated across accounts.
  • Policy consistency issues: Ensuring uniform permissions across accounts was error-prone.
  • Credential sprawl: Teams managing multiple accounts often had numerous credentials, increasing security risks.

The Emergence of AWS Organizations (2017):

AWS introduced AWS Organizations to simplify multi-account management. It allowed businesses to:

  1. Centrally manage accounts under an organization.
  2. Apply Service Control Policies (SCPs) for overarching governance.
  3. Simplify billing with consolidated payment options.

However, Organizations didn’t solve the challenge of centralizing user access across accounts. IAM remained the default tool for access management within each account, leading to inefficiencies in environments with hundreds of accounts.

Why IAM Identity Center Was Needed:

The rise of cloud-native applications and the adoption of multi-account strategies highlighted gaps in IAM’s capabilities:

  1. Decentralized user management: Managing individual users and permissions across accounts was cumbersome.
  2. Identity federation limitations: Organizations needed seamless integration with external identity providers (like Microsoft Active Directory or Okta).
  3. Increased security risks: The complexity of managing roles and permissions increased the chances of misconfigurations, potentially exposing sensitive resources.
  4. Scalability issues: Enterprises required a solution that could scale efficiently across accounts, regions, and services.

IAM Identity Center (2022):

AWS introduced IAM Identity Center (formerly AWS Single Sign-On) as a unified solution to address these challenges. It provides:

  1. Centralized User Management:
    • Manage users and permissions across multiple AWS accounts from a single interface.
    • Integrate with external identity providers to manage authentication.
  2. Simplified Access Control:
    • Assign users or groups specific permissions in multiple AWS accounts simultaneously.
    • Use permission sets, which are predefined IAM policies that can be applied to multiple users and accounts.
  3. Enhanced Security Features:
    • Supports multi-factor authentication (MFA) for added security.
    • Minimizes the need for long-term credentials by using session-based authentication.
  4. Streamlined Workflows:
    • Allows users to log in once and access multiple accounts through a single portal.
    • Automates the provisioning and deprovisioning of users, reducing manual overhead.
  5. Fine-Grained Permissions:
    • Supports granular permissions down to specific resources or actions.

Transformative examples:

Before IAM, managing access in cloud environments was cumbersome and risky. Let’s look at how things have improved:

  1. Securing workloads: Previously, applications often relied on hardcoded credentials in their code to access resources like databases or S3 buckets. This was a major security vulnerability—if someone accessed the code, they had the credentials. Now, with IAM roles, workloads can securely access AWS resources using temporary credentials that are automatically rotated. This reduces the risk of leaks and simplifies credential management.
  2. Granular access control: In the past, giving someone access to AWS often meant giving them access to everything. Now, with IAM policies, you can specify exactly what a user or service can do. For instance, a data scientist can be allowed to access only the S3 buckets containing analytics data while being restricted from modifying or deleting resources.
  3. Streamlined access management: Imagine managing hundreds of AWS accounts across a large organization. Before IAM Identity Center, this would have required setting up separate credentials for each account, leading to inefficiencies and potential security gaps. Now, Identity Center allows users to authenticate once and access multiple accounts seamlessly, with permissions tailored to their roles.
  4. Temporary access for dynamic needs: Previously, temporary or time-limited access to AWS resources was nearly impossible to manage. Now, IAM roles allow developers or systems to assume temporary permissions for specific tasks. For example, a Lambda function can access an S3 bucket for just the duration of its execution. This level of control wasn’t feasible before IAM

Real-World Examples of How IAM is Used

Examples of companies using IAM

Case 1: Netflix (Streaming Platform)

"Netflix uses IAM to manage its large-scale distributed cloud environment. With IAM, Netflix ensures that its development teams can only access the resources they need, while sensitive data like user personal information or content remains secure. The use of IAM policies ensures that access is granular and tightly controlled, protecting both the company's and customers’ data."

Case 2: Airbnb (Hospitality Industry)

"Airbnb leverages IAM roles to manage access for their applications. For instance, certain microservices need to interact with databases or S3 buckets. Instead of hardcoding credentials, Airbnb uses IAM roles to grant these services temporary permissions. This minimizes security risks and ensures that access is only granted for the required tasks, making credentials more secure."

Case 3: NASA Jet Propulsion Laboratory (Research Organization)

"At NASA's Jet Propulsion Laboratory, IAM plays a critical role in securing sensitive data from Mars Rover missions. IAM policies ensure that only authorized systems and researchers can access and analyze the rover's data. By using roles and policies, NASA ensures that the data is protected and that only the right people can access the most sensitive parts of their mission data."

Conclusion: IAM is super cool, yayyy!

Conclusion that IAM is cool

If you want to learn more about IAM works in details, do check out the official documentation and user guide: https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html.

Top comments (0)