Complete the code to specify that the security group allows inbound HTTP traffic.
security_group = {
"IpPermissions": [
{
"IpProtocol": "tcp",
"FromPort": 80,
"ToPort": 80,
"IpRanges": [
{"CidrIp": "[1]"}
]
}
]
}The CIDR block 0.0.0.0/0 allows inbound HTTP traffic from any IP address.
Complete the code to allow outbound HTTPS traffic in the security group.
security_group = {
"IpPermissionsEgress": [
{
"IpProtocol": "tcp",
"FromPort": 443,
"ToPort": 443,
"IpRanges": [
{"CidrIp": "[1]"}
]
}
]
}The CIDR block 0.0.0.0/0 allows outbound HTTPS traffic to any IP address.
Fix the error in the security group rule that blocks all inbound traffic except SSH.
security_group = {
"IpPermissions": [
{
"IpProtocol": "tcp",
"FromPort": 22,
"ToPort": 22,
"IpRanges": [
{"CidrIp": "[1]"}
]
}
]
}Using 22.22.22.22/32 restricts SSH access to a single IP address, blocking all others.
Fill both blanks to create a security group rule that allows inbound TCP traffic on port 8080 only from a specific subnet.
security_group = {
"IpPermissions": [
{
"IpProtocol": "[1]",
"FromPort": [2],
"ToPort": 8080,
"IpRanges": [
{"CidrIp": "10.0.1.0/24"}
]
}
]
}The protocol must be tcp and the FromPort must be 8080 to allow traffic on port 8080.
Fill all three blanks to define a security group rule that allows outbound UDP traffic on port 53 to all IP addresses.
security_group = {
"IpPermissionsEgress": [
{
"IpProtocol": "[1]",
"FromPort": [2],
"ToPort": [3],
"IpRanges": [
{"CidrIp": "0.0.0.0/0"}
]
}
]
}UDP protocol is used for DNS queries on port 53. Both FromPort and ToPort must be 53.