aws solution architect professional certification – Free course part 1

AWS Identity and Access Management (IAM) is a web service provided by Amazon Web Services (AWS) that enables you to manage user identities and their access to AWS resources. IAM allows you to create and manage users, groups, and roles, and define fine-grained permissions and access policies for them. With IAM, you can control who can access your AWS resources and what actions they can perform. It provides centralized identity management and access control, making it an essential component for securing and managing your AWS infrastructure.

authentication and authorization play crucial roles in ensuring secure access to resources. Authentication is the initial process of verifying the identity of users or entities interacting with AWS services. When accessing AWS, users typically respond with their username, password, or a session token. This authentication step aims to answer the fundamental questions of “Who are you?” and “Can you verify who you say you are?”

Once authentication is successfully completed, the focus shifts to authorization. Authorization is the subsequent step that establishes the permissions and access rights of authenticated users. It occurs after authentication and is governed by rules and policies set within AWS. These rules and policies dictate what resources and actions a user is authorized to access and perform within the AWS environment.

To grant authorized access, AWS employs the use of tokens such as bearer tokens or JSON Web Tokens (JWT). These tokens serve as credentials that validate a user’s authorization to access AWS services. By leveraging these tokens, users can securely interact with AWS resources based on their designated level of access, ensuring the integrity and protection of sensitive data and services within the AWS ecosystem.

Terms in AWS IAM

  • Principal:
    • An application or person authenticating with AWS.
    • Can be AWS root account user, IAM user, or IAM role.
    • Takes action on AWS resources.
  • Resources:
    • Items worked with in an AWS account.
    • Examples: Lambda function, EC2 instance, S3 bucket.
  • Entities:
    • IAM user, federated user, or user from IdP.
    • Assumed IAM role in the AWS context.
    • Used for authentication in IAM.
  • Identities:
    • Users, groups, and roles in IAM.
    • Resources used to identify service users.

IAM provides multiple authentication methods for interacting with AWS services:

  • Username and password are used to access the AWS Management Console. This is the initial method to log in and manage AWS resources through a user-friendly interface.
  • Access key and secret access key are long-term security credentials associated with IAM users or the root user. These keys can be rotated periodically to enhance security. Users can have up to two access keys associated with their accounts at any given time.
  • Session tokens leverage assumed roles and the Security Token Service (STS). By using an assumed role, users or applications can obtain a temporary session token that grants them allocated access to AWS resources. Session tokens are particularly useful for temporary access scenarios.

It’s important to note that AWS Management Console credentials, such as username and password, are not suitable for programmatic access to AWS services or the underlying infrastructure. For programmatic access, users need to configure and use access keys or session tokens, which require proper authorization through IAM policies. IAM policies define the permissions and restrictions for programmatic and service access to ensure secure and controlled interactions with AWS resources.

IAM group

IAM groups in AWS provide a way to organize and manage users based on their permissions and access requirements. Users can belong to multiple groups, allowing for flexible and granular control over their privileges. Similarly, groups can have multiple users, making it efficient to assign common permissions to a group of users simultaneously. However, it’s important to note that groups cannot contain other groups, meaning nesting of groups is not supported within IAM. To assign users to groups, manual addition is required, ensuring administrators have control over user group memberships. Additionally, it’s worth mentioning that when creating users or roles, there is no default group automatically assigned for permission assignment. Administrators need to explicitly add users to appropriate groups to grant them the desired access and permissions within the AWS environment.

Creating IAM group using Boto 3

Using Boto to attaching Managed Policies to Groups

IAM groups in AWS provide a way to organize and manage users based on their permissions and access requirements. Users can belong to multiple groups, allowing for flexible and granular control over their privileges. Similarly, groups can have multiple users, making it efficient to assign common permissions to a group of users simultaneously. However, it’s important to note that groups cannot contain other groups, meaning nesting of groups is not supported within IAM. To assign users to groups, Boto3 can be used. Additionally, it’s worth mentioning that when creating users or roles, there is no default group automatically assigned for permission assignment. Administrators need to explicitly add users to appropriate groups to grant them the desired access and permissions within the AWS environment.

Snippet code to list policies

Having obtained the ARN for the desired managed policy, we can proceed to attach it to our group. The following code snippet demonstrates the process of attaching the IAM policy to the group. It is worth noting that once the policy is attached to the group, any users subsequently added to the group will automatically inherit the associated permissions granted by the policy.

Snippet code to attach policy to a group

List attached policies to group

IAM User

IAM users in AWS serve as credentialed entities for accessing and utilizing AWS services. Upon creating an AWS account, the root account user is automatically provisioned, granting full administrative privileges. However, newly created IAM users start with no permissions, lacking authorization to perform any actions on AWS resources. Access to resources is granted by administrators through various means such as inline policies, managed policies, or by adding users to specific groups with predefined permissions. It’s important to note that IAM users are restricted to associating with only one AWS account, ensuring clear separation and management of user identities within the AWS ecosystem.

AWS roles

AWS roles provide a flexible and secure way to manage access to services, applications, and AWS resources without the need to hardcode credentials like access keys and secret access key pairs. By leveraging roles, users can seamlessly switch between multiple AWS accounts, allowing for efficient management across different environments. Roles can be assumed by the main user in various accounts, ensuring consistent access control. Furthermore, multiple instances of the same service can assume roles, providing scalable and consistent permissions. Any changes made to role permissions take effect immediately, allowing for rapid adjustments as needed. To pass roles to EC2 instances, instance profiles are used, where each instance profile can contain only one role, as per the service’s limitations. One of the significant advantages of roles is the ability to grant limited access to third parties with their own AWS accounts, such as third-party partners or auditors who may require read-only access, enabling secure collaboration and audit capabilities.

Permissions boundaries

AWS Identity and Access Management (IAM) provides a robust set of features for managing user access to AWS resources. Among these features, permission boundaries stand out as an advanced capability that allows organizations to exercise fine-grained control over access permissions. In this article, we will explore the concept of AWS permission boundaries, understand their significance, and discuss their practical applications in controlling access to specific resources.

Advanced Feature of IAM:
Permission boundaries represent an advanced feature within the IAM framework. They offer a powerful mechanism to set maximum resource limits for AWS managed policies. By implementing permission boundaries, organizations can precisely define the scope of access privileges granted to users, groups, or roles, ensuring adherence to desired resource limitations.

Setting Maximum Resource Limits:
One of the key benefits of permission boundaries is the ability to establish and enforce maximum resource limits for AWS managed policies. This ensures that users are granted access only to specific resources within predefined boundaries. By setting limits, organizations can prevent users from accessing resources beyond what is necessary for their roles, mitigating the risk of accidental or unauthorized access to sensitive data or critical infrastructure.

Controlling Access to Specific Resources:
Permission boundaries offer granular control over access to AWS resources. They allow organizations to precisely define the level of access users have to individual resources or groups of resources. This level of control is particularly valuable in multi-tenant environments or organizations with complex resource hierarchies, where fine-tuning access permissions is essential to maintain security and compliance.

Enforcing Resource Limitations with Managed Policies:
A notable aspect of permission boundaries is their ability to work in conjunction with AWS managed policies. By attaching managed policies to users, groups, or roles, organizations can take advantage of the pre-configured permissions provided by AWS. However, permission boundaries impose resource limitations on these policies, ensuring that users operate within the authorized boundaries, even when using managed policies. This allows organizations to strike a balance between granting the necessary permissions and preventing excessive access to resources.

Practical Applications:
Permission boundaries find practical applications in various scenarios. For example, organizations can utilize permission boundaries to limit the access of third-party vendors or partners who require access to specific resources within their AWS accounts. Additionally, permission boundaries can help organizations control the blast radius of accidental actions by restricting users to only the necessary resources they need to perform their tasks. This not only enhances security but also reduces the potential impact of unintended actions.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top