> 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-default-security-group-does-not-restrict-all-traffic.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS Default Security Group does not restrict all traffic

### Synopsis

| Field               | Value                                                    |
| ------------------- | -------------------------------------------------------- |
| Rule Type           | Detection                                                |
| Finding Type        | AWS Default Security Group does not restrict all traffic |
| Finding ID          | 60000022                                                 |
| Generates a Finding | This detection rule also generates a finding             |
| Severity            | Informational                                            |
| Category            | CONFIGURATION                                            |
| Cloud Providers     | AWS                                                      |
| Platform Module     | CSPM                                                     |
| Asset Types         | EC2\_SECURITY\_GROUP                                     |
| ATT\&CK Tactic      | TA0112 (TA0112)                                          |
| ATT\&CK Technique   | T1686.001 (T1686.001)                                    |

### Description

Default AWS security groups permitting unrestricted inbound and outbound traffic pose a significant security risk. Unrestricted access allows unauthorized network connections, potentially leading to data breaches and system compromises.

The default security group's permissive configuration, allowing all outbound and denying all inbound traffic by default, creates a misconfiguration. Without explicit rules, attackers could potentially exploit this to gain unauthorized access to instances associated with the default security group. Outbound traffic, while seemingly less risky, can facilitate data exfiltration or command-and-control communication for malicious actors.

The impact of this misconfiguration could be severe, ranging from unauthorized data access and modification to complete system takeover. Restricting traffic through security groups is crucial for implementing the principle of least privilege and limiting the potential attack surface. This best practice ensures only necessary traffic is allowed, minimizing the impact of any potential compromise.

To mitigate this risk, remove all inbound and outbound rules from default security groups. Never attach the default security group to any instances or resources. Instead, create separate, custom security groups with explicitly defined rules for inbound and outbound traffic, allowing only necessary connections. Regularly review and update security group rules to maintain a secure configuration.

### Remediation

**Manual steps:**

EC2 Security Group - Manual remediation steps:

Before making any changes, please check the impact on your applications/services.

For Resources associated with the alerted security group:

1. Identify AWS resources that exist within the default security group
2. Create a set of least privilege security groups for those resources
3. Place the resources in those security groups
4. Remove the associated resources from the default security group

For alerted Security Groups:

1. Log in to the AWS console
2. In the console, select the specific region from the 'Region' drop-down on the top right corner, for which the alert is generated
3. Navigate to the 'VPC' service
4. For each region, Click on 'Security Groups' specific to the alert
5. On section 'Inbound rules', Click on 'Edit Inbound Rules' and remove the existing rule, click on 'Save'
6. On section 'Outbound rules', Click on 'Edit Outbound Rules' and remove the existing rule, click on 'Save'


---

# 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-default-security-group-does-not-restrict-all-traffic.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.
