Skip to main content

AwsEC2GetPublicSGRules

This Script is part of the AWS - EC2 Pack.#

Find Security Group rules which allows ::/0 (IPv4) or 0.0.0.0/0.

Script Data#


NameDescription
Script Typepython3
TagsAmazon Web Services
Cortex XSOAR Version5.0.0

Used In#


This script is used in the following playbooks and scripts.

  • Prisma Cloud Remediation - AWS Security Groups Allows Internet Traffic To TCP Port

Inputs#


Argument NameDescription
groupIdSecurity Group ID (sg-xxxxxxxxx)
ipPermissionsJSON string of the ipPermissions. IpPermissions should have one or more rules which are composed of IpProtocol, FromPort, ToPort, or IpRanges. Refer to aws-ec2-describe-security-groups (https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-security-groups.html\) for example/reference.
protocolProtocol to check. TCP/UDP/All(-1)
fromPortLower bound port range to be checked. If fromPort and toPort are not specified, all ports will be included.
toPortUpper bound port range to be checked. If fromPort and toPort are not specified, all ports will be included.
regionSecurity group region
includeIPv6Include IPv6 in the result. By default, IPv6 is not included

Outputs#


PathDescriptionType
AWS.EC2.SecurityGroup.PublicRulesList public Security Group rulesUnknown
AWS.EC2.SecurityGroup.PublicRules.groupIdSecurity Group IDString
AWS.EC2.SecurityGroup.PublicRules.ipProtocolIP Protocol (TCP/UDP/-1)String
AWS.EC2.SecurityGroup.PublicRules.fromPortSecurity Group rule's lower bound port rangeNumber
AWS.EC2.SecurityGroup.PublicRules.toPortSecurity Group rule's upper bound port rangeNumber
AWS.EC2.SecurityGroup.PublicRules.cidrIpSecurity Group rule's CIDR rangeString
AWS.EC2.SecurityGroup.PublicRules.regionRegion of the security groupString