Introduction

As I continue building my cloud security skillset, I’ve been exploring foundational AWS services that underpin effective security architecture. One of the most critical services is AWS IAM (Identity and Access Management), which controls who can access your AWS resources and what specific actions they can perform.

In this blog post, I’ll share my experience implementing a secure access control solution using AWS IAM. I created customized policies, configured user groups, and established permission boundaries to enforce the principle of least privilege, demonstrating how IAM serves as the cornerstone of AWS security.

AWS EC2 Instances Showing Development And Production Environments With Different Security Tags Jose Felix Cruz
AWS EC2 Instances Showing Development And Production Environments With Different Security Tags Jose Felix Cruz

Project Overview

Time Investment: Approximately 4 hours (including research, setup, policy creation, testing and validation)

AWS Services Used:

  • AWS Identity and Access Management (IAM)
  • Amazon EC2 (for permission testing)

Key Concepts Learned:

  • JSON policy structure and syntax
  • Resource tagging for dynamic permissions
  • IAM user and group management
  • Policy testing and simulation
  • Least privilege implementation

Why AWS IAM is Foundational to Cloud Security

Before diving into implementation, here’s why IAM is considered the cornerstone of AWS security:

  • Fine-Grained Access Control: Define precise permissions for each user or system
  • Identity Federation: Integrate with existing identity providers for centralized authentication
  • Temporary Credentials: Issue short-lived credentials for enhanced security
  • Multi-Factor Authentication: Enforce additional verification layers
  • Zero Trust Foundation: Build security from identity rather than network perimeter

Step 1: Understanding Resource Organization with Tags

Tags are a powerful way to organize AWS resources and apply permissions dynamically. For this project:

  1. Created EC2 instances tagged with “Env” to distinguish environments
  2. Set “Env” tag values as “production” and “development”
  3. Planned permission scheme based on these resource designations
Amazon EC2 Instances With Environment Tags For Access Control Jose Felix Cruz
Amazon EC2 Instances With Environment Tags For Access Control Jose Felix Cruz

This tagging strategy enables attribute-based access control (ABAC), where permissions automatically apply to resources based on their tags rather than requiring explicit resource IDs in policies.

Security Impact: Resource tagging creates a scalable permission system that continues to work as your infrastructure grows, without needing constant policy updates for new resources.

Step 2: Creating IAM Policies

The central component of this project was crafting a custom IAM policy that implemented least privilege access. I created a JSON policy that:

  1. Allows full EC2 permissions on resources tagged “Env=development”
  2. Permits viewing (describing) information for all EC2 instances
  3. Explicitly denies the ability to create or delete tags on any instances
AWS IAM Policy Editor Showing JSON Policy With Tag-Based Conditions - Jose Felix Cruz
AWS IAM Policy Editor Showing JSON Policy With Tag Based Conditions Jose Felix Cruz

Understanding how these policy statements interact was crucial:

  • The first statement grants broad permissions but only for development resources
  • The second statement allows read-only access to all instances for visibility
  • The third statement creates an explicit deny for tag manipulation, which always takes precedence

Policy Structure Insight: AWS policies evaluate multiple statements to determine access, with explicit deny statements always overriding allow statements.

Here’s the complete policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "ec2:*",
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "ec2:ResourceTag/Env": "development"
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": [
                "ec2:Describe*"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Deny",
            "Action": [
                "ec2:CreateTags",
                "ec2:DeleteTags"
            ],
            "Resource": "*"
        }
    ]
}

Step 3: Setting Up Account Alias

To improve usability, I created a custom AWS account alias:

  1. Created the account alias “josefelix-alias-company”
  2. Verified the new sign-in URL: https://josefelix-alias-company.signin.aws.amazon.com/console
  3. Documented the improved user experience for team members
AWS IAM Account Alias Creation Screen With Custom Sign-In URL - Jose Felix Cruz
AWS IAM Account Alias Creation Screen With Custom Sign In URL Jose Felix Cruz

Security Impact: While primarily a usability feature, customized sign-in URLs help users identify the correct account, reducing the chance of accessing the wrong environment.

Step 4: Creating IAM Users and User Groups

Rather than assigning policies directly to individual users, I followed security best practices by:

  1. Creating a development user group for team members
  2. Attaching the custom policy to the group
  3. Adding users to the group to automatically inherit permissions
  4. Setting up temporary credentials with password rotation requirements
AWS IAM User Creation Process With Secure Password Policies - Jose Felix Cruz
AWS IAM User Creation Process With Secure Password Policies Jose Felix Cruz
AWS IAM User Group Creation With Policy Attachment - Jose Felix Cruz
AWS IAM User Group Creation With Policy Attachment Jose Felix Cruz

Security Impact: Group-based permission assignment significantly reduces administrative overhead and ensures consistent permissions across similar users, minimizing the risk of permission discrepancies.

Step 5: Testing IAM Policies

To verify my policy implementation, I conducted testing:

  1. Attempted to stop a production instance (Result: Access Denied)
  2. Attempted to stop a development instance (Result: Successfully Stopped)
  3. Attempted to modify tags on either instance (Result: Access Denied)
  4. Verified ability to view all instance details (Result: Successfully Listed)
AWS IAM Access Denied Error When Stopping Production EC2 Instance - Jose Felix Cruz
AWS IAM Access Denied Error When Stopping Production EC2 Instance Jose Felix Cruz

This error message confirms our policy is working correctly – the user can’t stop the production instance because it doesn’t have the “Env=development” tag.

AWS EC2 Instance Successfully Stopping With Development Tags - Jose Felix Cruz
AWS EC2 Instance Successfully Stopping With Development Tags Jose Felix Cruz

This confirmation message shows the policy correctly allows operations on development instances.

Testing Insight: Policy testing should verify both what actions are allowed AND what actions are explicitly denied to ensure complete coverage.

Step 6: Using the IAM Policy Simulator

For more advanced testing without affecting production resources, I utilized the IAM Policy Simulator:

  1. Set up a simulation for the development user group
  2. Tested StopInstances and DeleteTags actions
  3. Initially saw both actions denied
  4. Adjusted simulation to specify an EC2 instance with the development tag
  5. Confirmed StopInstances was allowed but DeleteTags remained denied
AWS IAM Policy Simulator Testing EC2 Permissions - Jose Felix Cruz
AWS IAM Policy Simulator Testing EC2 Permissions Jose Felix Cruz
AWS IAM Policy Simulator Showing Tag Based Permission Evaluation - Jose Felix Cruz
AWS IAM Policy Simulator Showing Tag Based Permission Evaluation Jose Felix Cruz

The Policy Simulator proved invaluable for testing complex permission scenarios without risking production impact.

Security Insight: Regular permission validation with the Policy Simulator should be part of security maintenance to ensure policies continue to enforce intended access controls.

Step 7: Documenting Security Controls

The final step involved documenting the implemented security controls:

  1. Created a permissions reference sheet for administrators
  2. Documented the tag-based permission structure
  3. Established procedures for adding new users to appropriate groups
  4. Created a process for periodically reviewing permissions

Documentation ensures security controls remain understandable and manageable over time.

Business Applications of This Approach

The techniques demonstrated in this project apply to various business scenarios:

Development Team Management

  • Separate environments for development, testing, and production
  • Prevent developer access to production data or systems
  • Allow self-service for development resources
  • Implement controlled promotion processes

Contractor Access

  • Grant temporary access with specific time limits
  • Restrict contractors to only the resources they need
  • Prevent modification of security controls
  • Enable easy access revocation

Compliance Requirements

  • Implement separation of duties for regulated industries
  • Create audit trails for access changes
  • Enforce principle of least privilege
  • Document access controls for compliance auditors

Challenges and Solutions

Challenge 1: Understanding JSON Policy Structure

The policy language can be complex, with various elements like Effect, Action, Resource, and Condition working together.

Solution: I studied AWS documentation and broke down example policies to understand each component. Building policies incrementally helped me validate each part before adding complexity.

Challenge 2: Testing Multi-Level Permissions

Verifying that combinations of Allow and Deny statements work correctly requires systematic testing.

Solution: I developed a test plan that checked each permission boundary and used the Policy Simulator to validate complex scenarios.

Key Takeaways and Best Practices

  1. Use Tag-Based Access Control: Tags provide flexible, scalable permission management without hardcoding resource IDs.
  2. Implement Least Privilege: Start with minimal permissions and add only what’s required.
  3. Prefer Groups Over Individual Permissions: Assign permissions to groups rather than individual users for consistency.
  4. Test Before Implementing: Use the Policy Simulator to verify policies before applying them to production.
  5. Document Your Permission Structure: Maintain clear documentation of your permission model for onboarding and auditing.

Cost Management Tip: IAM itself is free, but the resources you control with IAM may have costs associated with them. Always be aware of what resources users have permission to create or modify.

Applying These Concepts to Security Architecture

This IAM implementation demonstrates several security architecture principles:

  • Defense in Depth: Multiple permission layers protect critical resources
  • Principle of Least Privilege: Users receive only the permissions they need
  • Separation of Duties: Different access levels prevent single-person control
  • Operational Security: Processes ensure permissions remain current and appropriate

Each of these principles contributes to a robust security posture that protects AWS environments from both accidental and intentional harmful actions.

What’s Next?

Building on this IAM foundation, my upcoming security projects will explore:

  • Encrypting sensitive data with AWS KMS
  • Implementing automated threat detection with GuardDuty
  • Managing secrets securely with AWS Secrets Manager
  • Building security monitoring systems

Each of these projects will leverage the secure access foundation established through IAM to ensure only authorized users can access sensitive security functions.

Conclusion

Implementing secure access control with AWS IAM was a valuable learning experience that demonstrated the importance of identity-based security in cloud environments. The ability to create fine-grained, tag-based permissions and apply them consistently through groups forms the foundation of AWS security architecture.

As a US Navy veteran transitioning into Cloud Security, I found this project particularly relevant because it mirrors military security principles: carefully controlled access, need-to-know permissions, and layered protection mechanisms. These universal security concepts translate perfectly to cloud environments.

Have you implemented IAM in your AWS environment? What challenges did you encounter with permission management? Let me know in the comments below!

Stay tuned for my upcoming projects as I continue building expertise in AWS security services.

Additional Resources

Last Update: May 11, 2025