While the setup of security groups is a pretty straightforward practice, I have difficulty applying using the right template when focusing on application security and managing connections between my EC2 instance, Load Balancer and RDS.
My fear is that I'm aware that certain applications should not have public access and should only be accessed by the applications that utilize them, but unsure of the best method to achieve that linking.
Should the Load Balancer be the source of the security group configurations and then the attached EC2 instance just reference the Load Balancer setup? Should RDS link to the EC2 security group or Load Balancer? Any guidance on what I should think about in terms of design and my current setup will be extremely helpful!
Load Balancer:
Type | Protocol | Port Range | Source
HTTP | TCP | 80 | *Public*
SSH | TCP | 22 | *Private IP*
HTTPS | TCP | 443 | *Public*
EC2 Instance:
Type | Protocol | Port Range | Source
HTTP | TCP | 80 | *Load Balancer Security Group*
SSH | TCP | 22 | *Load Balancer Security Group*
HTTPS | TCP | 443 | *Load Balancer Security Group*
RDS:
Type | Protocol | Port Range | Source
All TCP | TCP | 0 - 65535 | *EC2 Instance Security Group*
PostgreSQL | TCP | 5432 | *Public*
PostgreSQL | TCP | 5432 | *Public (IPv6)*
SSH | TCP | 22 | *Private IP*