> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-ec2-instance-iam-role-not-enabled.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS EC2 Instance IAM Role not enabled

### Synopsis

| Field               | Value                                        |
| ------------------- | -------------------------------------------- |
| Rule Type           | Detection                                    |
| Finding Type        | AWS EC2 Instance IAM Role not enabled        |
| Finding ID          | 60000185                                     |
| Generates a Finding | This detection rule also generates a finding |
| Severity            | Informational                                |
| Category            | CONFIGURATION                                |
| Cloud Providers     | AWS                                          |
| Platform Module     | CSPM                                         |
| Asset Types         | EC2\_INSTANCE                                |
| ATT\&CK Tactic      | TA0006 (TA0006)                              |
| ATT\&CK Technique   | T1552 (T1552)                                |

### Description

EC2 instances lacking associated IAM roles present a significant security risk, allowing instances to operate with potentially excessive privileges or without proper authentication. This misconfiguration exposes sensitive data and resources to unauthorized access.

IAM roles provide a secure mechanism for granting EC2 instances access to AWS services. Without a properly configured IAM role, instances may rely on less secure methods like hardcoded credentials, increasing the risk of compromised access keys and subsequent data breaches. Attackers could exploit this lack of role-based access control to gain unauthorized access to the instance and its associated resources.

The impact of this misconfiguration could be severe, ranging from data exfiltration and unauthorized modification of resources to complete system compromise. Implementing IAM roles ensures that instances only have the necessary permissions, adhering to the principle of least privilege and reducing the potential impact of a compromise.

To mitigate this, ensure each EC2 instance has a dedicated IAM role attached. Regularly review and update these roles to maintain the principle of least privilege. Restrict permissions granted to the role to only those strictly required for the instance's functionality. Monitor access logs for suspicious activity.

### Remediation

**Manual steps:**

EC2 Instance - Manual remediation steps:

The most common setup is the AWS default that allows for EC2 access to AWS Services. For most, this is a great way to realize flexible, yet secure, EC2 access enabled for your instances. Select this when you launch EC2 instances to automatically inherit these permissions.

IAM

1. Go to the AWS console IAM dashboard.
2. In the navigation pane, choose Roles, Create new role.
3. Under 'Choose the service that will use this role' select EC2, then 'Next:Permissions.'
4. On the Attach permissions policies page, select an AWS managed policy that grants your instance access to the resources that they need, then 'Next:Tags.'
5. Add tags (optional), the select 'Next:Review.'
6. On the Create role and Review page, type a name for the role and choose Create role.

EC2

1. Go to the AWS console EC2 dashboard.
2. Select Running Instances.
3. Check the instance you want to modify.
4. From the Actions pull down menu, select Modify IAM role under Security.
5. On the Modify IAM role page, under the IAM role pull down menu, choose the role created in the IAM steps above.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-ec2-instance-iam-role-not-enabled.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
