Why restrict outbound traffic in security groups as well as inbound?
BeginnerScenarioSecurity: Firewalls, SGs, NACLs & VPN
Answer
Situation read → Default SGs allow all outbound, which helps attackers after a compromise.
What I'd do →
- Remove the default allow-all egress rule on sensitive tiers
- Allow only the required destinations, for example 443 to the NAT, 5432 to the database SG
- Use VPC endpoints and prefix lists for AWS services
- Test that the app still works, and watch flow logs for REJECT lines that reveal missing rules
Why → Egress filtering stops data exfiltration and reverse shells after an app compromise.
Interview tip → Say it's high value but expensive in effort, so apply it first to data and PCI tiers.
More on Security: Firewalls, SGs, NACLs & VPN
Security group versus NACL: explain the differences.BeginnerHow do you let only your office IP SSH into a server?BeginnerWhat does it mean that a security group can reference another security group?BeginnerStateful versus stateless firewalls: what is the practical difference?BeginnerWhat is a WAF and where do you place it?BeginnerWhat is the difference between a site-to-site VPN and a client VPN?Beginner