You have a security group with the following inbound rule:
Type: SSH
Protocol: TCP
Port Range: 22
Source: 0.0.0.0/0
What is the effect of this rule?
Think about what 0.0.0.0/0 means in networking.
The source 0.0.0.0/0 means any IP address. So this rule allows SSH (port 22) from anywhere.
You want your EC2 instances in a private subnet to access the internet for software updates. Which outbound rule should you add to the security group?
Think about what outbound rules control and what is needed for internet access.
Outbound rules control traffic leaving the instance. Allowing all outbound traffic lets instances reach the internet for updates.
You want to allow HTTP access (port 80) only from your office IP 203.0.113.5. Which inbound rule configuration is correct?
Consider the CIDR notation for a single IP and the correct protocol for HTTP.
203.0.113.5/32 means only that single IP. HTTP uses TCP protocol on port 80.
Which of the following is the best practice for configuring outbound rules in AWS security groups?
Think about ease of management and common AWS defaults.
AWS security groups allow all outbound traffic by default. This is generally best unless you have strict security needs.
If a security group has inbound rules allowing HTTP (port 80) from anywhere but has no outbound rules configured, what will happen when an instance receives an HTTP request?
Remember how security groups handle stateful traffic.
Security groups are stateful. Responses to allowed inbound traffic are automatically permitted outbound regardless of outbound rules. The instance will receive the request and respond normally.