# Authorization Models in IAM

Role based

Attributed based&#x20;

AWS Identity and Access Management (IAM) supports different **authorization models** to control how users and services access AWS resources. SecureCart follows AWS best practices by implementing **role-based access control (RBAC), attribute-based access control (ABAC), and permission boundaries** to enforce **least privilege access** across multiple accounts.

✔ **Why SecureCart Needs IAM Authorization Models?**

* **Ensures fine-grained access control across AWS environments.**
* **Implements scalable access management using roles and policies.**
* **Prevents privilege escalation and enforces security compliance.**
* **Simplifies permissions management across multiple AWS accounts.**

***

### **🔹 Step 1: Understanding IAM Authorization Models**

✔ **AWS provides multiple authorization models for managing access control. SecureCart selects the right model based on security and scalability needs.**

| **Authorization Model**                   | **Purpose**                                                                      | **Key AWS Components**                               | **SecureCart Implementation**                                                                                |
| ----------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **Role-Based Access Control (RBAC)**      | Grants access based on job roles and responsibilities.                           | IAM Roles, IAM Groups, IAM Policies                  | **SecureCart assigns IAM roles to Developers, Admins, and Security teams with predefined permission sets.**  |
| **Attribute-Based Access Control (ABAC)** | Grants access based on user attributes (e.g., department, project, environment). | IAM Policies with Tags, IAM Roles, AWS Organizations | **SecureCart tags IAM roles with attributes like `environment=prod` to restrict access dynamically.**        |
| **Permission Boundaries**                 | Defines the maximum permissions an IAM identity can have.                        | IAM Policies, IAM Roles                              | **SecureCart enforces permission boundaries to ensure developers cannot grant themselves admin privileges.** |
| **Service Control Policies (SCPs)**       | Restricts permissions across AWS accounts in an organization.                    | AWS Organizations, SCPs                              | **SecureCart applies SCPs to prevent root user access and restrict actions in production accounts.**         |

✅ **Best Practices:**\
✔ **Use RBAC for standard role-based permissions (e.g., Developer, Security Analyst).**\
✔ **Leverage ABAC to dynamically assign permissions based on user attributes.**\
✔ **Apply permission boundaries to prevent excessive privilege assignments.**\
✔ **Use SCPs in AWS Organizations to enforce security policies across accounts.**

***

### **🔹 Step 2: Implementing Role-Based Access Control (RBAC) in SecureCart**

✔ **SecureCart grants access based on job roles using IAM roles and permission sets.**

| **Role**             | **Permissions**                                   | **SecureCart Implementation**                                                                             |
| -------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| **Developer**        | Read/write access to non-production environments. | **SecureCart developers assume an IAM role with `ReadOnlyAccess` to Production and `FullAccess` to Dev.** |
| **Security Analyst** | Full access to AWS security services.             | **SecureCart security teams have IAM roles with full access to AWS Security Hub, GuardDuty, and IAM.**    |
| **Admin**            | Full access to all AWS services.                  | **SecureCart’s Cloud Administrators have elevated privileges through IAM roles.**                         |

✅ **Best Practices:**\
✔ **Use IAM roles instead of IAM users to grant permissions.**\
✔ **Apply least privilege by assigning only necessary permissions.**\
✔ **Use permission sets in IAM Identity Center for cross-account RBAC.**\
✔ **Monitor IAM role usage using AWS CloudTrail.**

***

### **🔹 Step 3: Implementing Attribute-Based Access Control (ABAC) in SecureCart**

✔ **SecureCart uses IAM policies with tags to enforce dynamic access control.**

| **ABAC Strategy**                                              | **Purpose**                                | **SecureCart Implementation**                                                                            |
| -------------------------------------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| **Tag IAM roles with `environment=prod` or `environment=dev`** | Restricts access based on the environment. | **SecureCart allows only developers with `environment=dev` tags to deploy to Dev accounts.**             |
| **Use `department` tags to enforce permissions**               | Assigns permissions based on department.   | **SecureCart assigns IAM roles dynamically based on `department=engineering` or `department=security`.** |
| **Combine ABAC with RBAC for granular control**                | Provides flexible access management.       | **SecureCart combines role-based IAM policies with ABAC to fine-tune permissions.**                      |

✅ **Best Practices:**\
✔ **Use tags to manage permissions dynamically across multiple AWS accounts.**\
✔ **Combine ABAC with RBAC to provide fine-grained access control.**\
✔ **Restrict access based on attributes like `project`, `department`, or `environment`.**\
✔ **Use IAM Access Analyzer to detect unintended public access.**

***

### **🔹 Step 4: Enforcing Permission Boundaries for SecureCart’s IAM Roles**

✔ **SecureCart prevents privilege escalation using permission boundaries.**

| **Permission Boundary Strategy**              | **Purpose**                                                        | **SecureCart Implementation**                                                                                |
| --------------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| **Limit IAM Role Creation Privileges**        | Prevents users from creating overly permissive roles.              | **SecureCart enforces a permission boundary that prevents developers from assigning `AdministratorAccess`.** |
| **Restrict Actions for Temporary Roles**      | Ensures temporary credentials don’t exceed predefined permissions. | **SecureCart applies permission boundaries to AWS STS session policies.**                                    |
| **Apply Boundaries for Cross-Account Access** | Controls max permissions for assumed roles.                        | **SecureCart enforces permission boundaries to limit DevOps cross-account access.**                          |

✅ **Best Practices:**\
✔ **Use permission boundaries to prevent users from escalating their own privileges.**\
✔ **Combine permission boundaries with SCPs for multi-account governance.**\
✔ **Restrict temporary session permissions using session policies.**\
✔ **Monitor permission boundary violations using AWS IAM Access Analyzer.**

***

### **🔹 Step 5: Enforcing Multi-Account Governance with SCPs**

✔ **SecureCart applies SCPs to enforce security controls across all AWS accounts.**

| **SCP Strategy**                                   | **Purpose**                                           | **SecureCart Implementation**                                            |
| -------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------ |
| **Prevent IAM User Creation in Workload Accounts** | Ensures only IAM Identity Center (SSO) is used.       | **SecureCart blocks IAM user creation in non-management accounts.**      |
| **Restrict Unapproved AWS Regions**                | Ensures resources are deployed in approved locations. | **SecureCart limits deployments to `us-east-1` and `eu-west-1`.**        |
| **Deny CloudTrail Log Deletion**                   | Protects security logs from unauthorized changes.     | **SecureCart prevents security logs from being deleted in any account.** |

✅ **Best Practices:**\
✔ **Apply SCPs at the Organizational Unit (OU) level for centralized policy enforcement.**\
✔ **Use SCPs to restrict critical actions like disabling CloudTrail and IAM changes.**\
✔ **Regularly review and update SCPs to align with security best practices.**\
✔ **Ensure SCPs do not override necessary permissions for required workflows.**

***

### **🔹 Step 6: Monitoring & Auditing IAM Authorization Models**

✔ **SecureCart ensures access security through continuous monitoring and auditing.**

| **AWS Monitoring Tool**     | **Purpose**                                                     | **SecureCart Implementation**                                           |
| --------------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- |
| **AWS IAM Access Analyzer** | Detects unintended public access and cross-account permissions. | **SecureCart scans IAM policies for overly permissive configurations.** |
| **AWS CloudTrail**          | Logs all IAM role assumptions and API calls.                    | **SecureCart tracks IAM role usage across accounts.**                   |
| **AWS Config**              | Monitors compliance with IAM best practices.                    | **SecureCart flags non-compliant IAM policy changes.**                  |
| **AWS Security Hub**        | Aggregates security findings across multiple accounts.          | **SecureCart centralizes security monitoring for IAM-related threats.** |

✅ **Best Practices:**\
✔ **Use IAM Access Analyzer to detect unintended public and cross-account access.**\
✔ **Monitor CloudTrail logs to track IAM role assumptions and API calls.**\
✔ **Enable AWS Config to detect unauthorized IAM policy modifications.**\
✔ **Use AWS Security Hub to centralize IAM security alerts.**

***

### **🚀 Summary**

✔ **Use RBAC to assign permissions based on roles and job functions.**\
✔ **Leverage ABAC to grant dynamic permissions based on user attributes and tags.**\
✔ **Apply permission boundaries to prevent privilege escalation.**\
✔ **Use SCPs to enforce security guardrails across AWS accounts.**\
✔ **Continuously monitor IAM authorization models using AWS IAM Access Analyzer, CloudTrail, and AWS Config.**
