Skip to content

Security Group

#15 · Level 1 · Core services · Networking basics

A Security Group is each server’s own firewall, deciding which traffic can come in and go out. It is attached directly to a resource such as an EC2 instance, not to a subnet. You can only write allow rules in it — anything not allowed is blocked automatically. A Security Group is stateful, which means that if a request is allowed in, its response can go back out automatically. You can attach more than one Security Group to a resource.

The guard at a flat’s door, who has a list of people allowed in. If your name is on the list, you can enter; if not, you can’t.

If everyone could come in from every direction, attackers could easily get in. Only the doors you need should be open.

A web server’s Security Group opens only the door for viewing the website. A database’s Security Group lets in only the web server, and nobody else.

Network Security Group (NSG)

Network ACL · Amazon VPC · Amazon EC2

For details and the latest information, see the official documentation: