0
0
AWScloud~10 mins

Inbound and outbound rules in AWS - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Inbound and outbound rules
Start: Define Security Group
Set Inbound Rules
Traffic Arrives
Check Inbound Rules
Allow Traffic
Set Outbound Rules
Traffic Leaves
Check Outbound Rules
Allow Traffic
This flow shows how inbound and outbound rules in a security group control incoming and outgoing traffic by allowing or blocking it based on defined rules.
Execution Sample
AWS
SecurityGroup:
  InboundRules:
    - Protocol: TCP
      Port: 80
      Source: 0.0.0.0/0
  OutboundRules:
    - Protocol: TCP
      Port: 443
      Destination: 0.0.0.0/0
Defines a security group allowing inbound HTTP traffic on port 80 from anywhere and outbound HTTPS traffic on port 443 to anywhere.
Process Table
StepTraffic DirectionProtocolPortSource/DestinationRule CheckResult
1InboundTCP800.0.0.0/0Matches inbound ruleAllowed
2InboundTCP220.0.0.0/0No matching inbound ruleDenied
3OutboundTCP4430.0.0.0/0Matches outbound ruleAllowed
4OutboundTCP250.0.0.0/0No matching outbound ruleDenied
5InboundUDP530.0.0.0/0No matching inbound ruleDenied
💡 Traffic is allowed only if it matches a rule; otherwise, it is denied by default.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5
Traffic AllowedNoneYes (Inbound TCP 80)No (Inbound TCP 22)Yes (Outbound TCP 443)No (Outbound TCP 25)No (Inbound UDP 53)
Key Moments - 3 Insights
Why is inbound TCP traffic on port 22 denied even though the source is 0.0.0.0/0?
Because there is no inbound rule allowing TCP traffic on port 22, so the default action is to deny it, as shown in execution_table row 2.
Why is outbound TCP traffic on port 25 denied despite the destination being 0.0.0.0/0?
Because the outbound rules only allow TCP traffic on port 443, so port 25 traffic is denied by default, as shown in execution_table row 4.
What happens if inbound UDP traffic on port 53 arrives?
It is denied because no inbound rule allows UDP on port 53, as shown in execution_table row 5.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the result for inbound TCP traffic on port 80?
ABlocked by outbound rules
BAllowed
CDenied
DNo rule applied
💡 Hint
Check execution_table row 1 under 'Result' column.
At which step does the traffic get denied because no matching outbound rule exists?
AStep 4
BStep 2
CStep 1
DStep 3
💡 Hint
Look at execution_table rows with 'Outbound' direction and 'Denied' result.
If we add an inbound rule allowing UDP on port 53, how would the result at step 5 change?
AIt would be blocked by outbound rules
BIt would remain Denied
CIt would become Allowed
DIt would cause an error
💡 Hint
Refer to variable_tracker and execution_table row 5 about UDP port 53 traffic.
Concept Snapshot
Inbound and outbound rules control traffic flow in security groups.
Inbound rules filter incoming traffic; outbound rules filter outgoing traffic.
Traffic is allowed only if it matches a rule; otherwise, it is denied by default.
Rules specify protocol, port, and source/destination IP ranges.
Properly setting rules secures your cloud resources from unwanted access.
Full Transcript
Inbound and outbound rules in AWS security groups control which network traffic is allowed to enter or leave your resources. Inbound rules specify what incoming traffic is permitted based on protocol, port, and source IP. Outbound rules specify what outgoing traffic is allowed based on protocol, port, and destination IP. Traffic that does not match any rule is denied by default. For example, if you allow inbound TCP traffic on port 80 from anywhere, HTTP requests can reach your server. If you allow outbound TCP traffic on port 443, your server can make HTTPS requests. Traffic on ports or protocols not allowed by rules is blocked. This ensures your cloud resources are protected from unauthorized access while allowing necessary communication.