> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/cloud-scanning/cloud-resource-attributes/aws/ec2-securitygroup.md).

# EC2 SecurityGroup

## Resource Type

`AWS.EC2.SecurityGroup`

## Resource ID Format

For EC2 Security Groups, the resource ID is the ARN.

`arn:aws:ec2:us-west-2:123456789012:security-group/sg-1`

## Background

This resource represents a snapshot of an AWS EC2 VPC SecurityGroup.

## Fields

| Field                 | Type     | Description                                                               |
| --------------------- | -------- | ------------------------------------------------------------------------- |
| `Description`         | `String` | The description of the security group.                                    |
| `IpPermissions`       | `List`   | Inbound IP permissions                                                    |
| `IpPermissionsEgress` | `List`   | Outbound (egress) IP permissions                                          |
| `OwnerId`             | `String` | The Amazon Web Services account ID of the owner of the network interface. |
| `VpcId`               | `String` | The ID of the VPC.                                                        |

## Example

```javascript
{
    "AccountId": "123456789012",
    "Arn": "arn:aws:ec2:ap-northeast-2:123456789012:security-group/sg-1",
    "Description": "default VPC security group",
    "Id": "sg-1",
    "IpPermissions": [
        {
            "FromPort": null,
            "IpProtocol": "-1",
            "IpRanges": null,
            "Ipv6Ranges": null,
            "PrefixListIds": null,
            "ToPort": null,
            "UserIdGroupPairs": [
                {
                    "Description": null,
                    "GroupId": "sg-1",
                    "GroupName": null,
                    "PeeringStatus": null,
                    "UserId": "123456789012",
                    "VpcId": null,
                    "VpcPeeringConnectionId": null
                }
            ]
        }
    ],
    "IpPermissionsEgress": [
        {
            "FromPort": null,
            "IpProtocol": "-1",
            "IpRanges": [
                {
                    "CidrIp": "0.0.0.0/0",
                    "Description": null
                }
            ],
            "Ipv6Ranges": null,
            "PrefixListIds": null,
            "ToPort": null,
            "UserIdGroupPairs": null
        }
    ],
    "Name": "default",
    "OwnerId": "123456789012",
    "Region": "ap-northeast-2",
    "ResourceId": "arn:aws:ec2:ap-northeast-2:123456789012:security-group/sg-1",
    "ResourceType": "AWS.EC2.SecurityGroup",
    "Tags": null,
    "TimeCreated": null,
    "VpcId": "vpc-1"
}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.panther.com/cloud-scanning/cloud-resource-attributes/aws/ec2-securitygroup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
