An internet-facing IPv4 ALB in the same VPC accepts HTTPS on 443 and forwards HTTP to private IPv4 EC2 targets on 8080. Health checks use a separate TCP port, 8081. Routes and NACLs permit the required traffic.
Only sg-alb is associated with the ALB and only sg-web with the targets. Both security groups currently have empty ingress and egress rules. No other resource uses sg-alb, and targets have no public IP addresses.
Allow application traffic and health checks from the ALB while rejecting new application connections to the targets from other instances in the same VPC.
Choose TWO rules to configure together.
Allow target ingress on 8080 and 8081 from sg-alb; allow public ingress on 443 and egress to sg-web on 8080 and 8081 at the ALB. Distinguish listener, target and health-check ports.
Detailed explanation
Permit ALB application traffic and health checks without allowing new connections from clients in another security group.
This includes every routable IPv4 source, including other instances in the VPC. Private addressing alone does not restrict the source.
Permit the public HTTPS entry point and outbound traffic to the actual application and health-check ports.
Targets use 8080 and 8081. Confusing the frontend listener with backend ports prevents forwarding and health checks.
A NACL cannot reference a security group as its source and cannot override empty security-group ingress rules.
Check official documentation
Compare the following points with the official documentation.
Compare official documentation with security-group associations, the ALB 443 listener, target 8080 and health-check 8081. In an authorized environment verify ALB responses and target health, then compare rejected new connections to target 8080 from a same-VPC client in another security group. Also inspect routes and NACLs.
Official references
- Official documentation 1
- Official documentation 2
- Official documentation 3
- Official documentation 4
- Official documentation 5
What to confirm
ALB requests and health checks on 8081 succeed, while new connections to target 8080 from a same-VPC client in another security group are rejected. Private addressing does not make a 0.0.0.0/0 ingress rule an adequate source restriction.
Key points
- Application Load Balancer
- Security group reference
- 0.0.0.0/0
Notes
- Environment: Official AWS documentation review; optional configuration and behavior checks in an authorized test environment.
- Confirm current AWS service behavior in the official documentation.
Foundation review
Distinguish frontend and backend ports
Listener 443, application 8080 and health-check 8081 are separate connections. Permit actual destination ports on ALB egress and target ingress. Security groups are stateful, so replies to permitted connections are not equivalent to new inbound connections.
Check which resources share the referenced group
A source security-group reference includes resources associated with that group. Reserving sg-alb for the ALB avoids widening the permitted sources. Multiple associated security groups combine their Allow rules, so check other broad rules too.
Separate private placement from source restrictions
0.0.0.0/0 includes all IPv4 addresses, including routed clients in the same VPC. Lack of a public IP does not prevent direct VPC access. A NACL Allow cannot override a security-group rejection.