What is Security Group in AWS
Security Groups are the fundamental of network security in AWS
They control how traffic is allowed into or out of our EC2 Instances
Security groups only contain allow rules
Security groups rules can reference by IP or by security group
They regulate:
- Access to Ports
- Authorized IP ranges – IPv4 and IPv6
- Control of inbound network (from other to the instance)
- Control of outbound network (from the instance to other)
Good to know
- Can be attached to multiple instances (And one instance can attach multiple Security groups too)
- Locked down to a region / VPC combination
- It’s good to maintain one separate security group for SSH access
- If your application is not accessible (time out), then it’s a security group issue
- If your application gives a “connection refused“ error, then it’s an application error or it’s not launched
- All inbound traffic are blocked by default
- All outbound traffic are authorized by default
- You can setup inbound traffic from other instances by their security groups, so you do not need to worry about their IP change