A Security group acts as a virtual firewall for your EC2 Instances.
● It decides the type of port and kind of traffic to allow.
● Security groups are active at the instance level whereas Network ACLs are
active at the subnet level.
● Security Groups can only allow but can’t deny the rules.
● The Security group is considered stateful.
● By default, in the outbound rule all traffic is allowed and needs to define the
inbound rules.