# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
