Why do we configure a security group?

We configure a security group to act as a virtual firewall that controls all inbound and outbound traffic to your AWS resources, such as an EC2 instance.
Without configuring a security group, your server is either completely cut off from the world (unable to receive traffic) or dangerously exposed to malicious scans and cyberattacks.
Please login to ask, answer, share, like, and vote.