Skip to main content

AWSRemediateSG

This Script is part of the Cloud Security Policy Management Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.10.0 and later.

Duplicates security groups and modifies rules to remove public exposure for the specified port. The updated security groups can then be used to remediate public exposure of an AWS resource by replacing the existing list.

Script Data#


NameDescription
Script Typepython3
Cortex XSOAR Version6.10.0

Dependencies#


This script uses the following commands and scripts.

  • AWS
  • aws-ec2-security-group-create
  • aws-ec2-security-group-egress-authorize
  • aws-ec2-security-group-egress-revoke
  • aws-ec2-security-group-ingress-authorize
  • aws-ec2-security-groups-describe
  • aws-ec2-tags-create

Inputs#


Argument NameDescription
account_idThe AWS account ID.
resource_idThe EC2 resource ID to remediate security groups for.
sg_listA comma-separated list of security group IDs to recreate.
portTCP/UDP port to be restricted.
protocolThe protocol of the port to be restricted.
regionThe region where the EC2 instance resides.
tagsThe tags to apply to the recreated security groups. Use the format key=abc,value=123;key=fed,value=456, with tags separated by a semicolon (;).
integration_instanceThe AWS integration instance to use.

Outputs#


PathDescriptionType
AWSPublicExposure.SGReplacements.ReplacementSet.new-sgID of the newly created security group with restricted permissions.String
AWSPublicExposure.SGReplacements.ReplacementSet.old-sgID of the original security group before remediation.String
AWSPublicExposure.SGReplacements.ResourceIDThe EC2 resource ID to remediate security groups for.String
AWSPublicExposure.SGReplacements.UpdatedSGListList of Security Groups to associate to the EC2 resource after remediation.String
AWSPublicExposure.SGReplacements.RemediationRequiredIndicates whether any of the provided security groups contained rules requiring remediation.Boolean