AWS ec2 medium security documentation change
Summary
Added PowerShell V5 examples for configuring security group egress rules
Security assessment
The change documents egress rule configuration which is fundamental to network security. It shows proper syntax for restricting outbound access (e.g., specific IP ranges), helping prevent over-permissive rules. However, there's no indication this addresses a specific vulnerability.
Diff
diff --git a/ec2/latest/devguide/example_ec2_AuthorizeSecurityGroupEgress_section.md b/ec2/latest/devguide/example_ec2_AuthorizeSecurityGroupEgress_section.md index 56750b30b..bfcaf6d90 100644 --- a//ec2/latest/devguide/example_ec2_AuthorizeSecurityGroupEgress_section.md +++ b//ec2/latest/devguide/example_ec2_AuthorizeSecurityGroupEgress_section.md @@ -120,0 +121,37 @@ PowerShell + + +**Tools for PowerShell V5** + + +**Example 1: This example defines an egress rule for the specified security group for EC2-VPC. The rule grants access to the specified IP address range on TCP port 80. The syntax used by this example requires PowerShell version 3 or higher.** + + + $ip = @{ IpProtocol="tcp"; FromPort="80"; ToPort="80"; IpRanges="203.0.113.0/24" } + Grant-EC2SecurityGroupEgress -GroupId sg-12345678 -IpPermission $ip + + +**Example 2: With PowerShell version 2, you must use New-Object to create the IpPermission object.** + + + $ip = New-Object Amazon.EC2.Model.IpPermission + $ip.IpProtocol = "tcp" + $ip.FromPort = 80 + $ip.ToPort = 80 + $ip.IpRanges.Add("203.0.113.0/24") + + Grant-EC2SecurityGroupEgress -GroupId sg-12345678 -IpPermission $ip + + +**Example 3: This example grants access to the specified source security group on TCP port 80.** + + + $ug = New-Object Amazon.EC2.Model.UserIdGroupPair + $ug.GroupId = "sg-1a2b3c4d" + $ug.UserId = "123456789012" + + Grant-EC2SecurityGroupEgress -GroupId sg-12345678 -IpPermission @( @{ IpProtocol="tcp"; FromPort="80"; ToPort="80"; UserIdGroupPairs=$ug } ) + + + * For API details, see [AuthorizeSecurityGroupEgress](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + +