Security group for public ALB when it is a target for private NLB

0

What should be my security group rule when Internet-facing ALB is introduced as a target to private NLB?

This documentation (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/application-load-balancer-target.html) states that the security group should allow traffic from Client's computer. In my case, the client will be APIGW + VPC Link

APIGW -> VPC Link -> Private NLB -> Public ALB

2개 답변
1

You should set your ALB's security group inbound rules to accept HTTP/S traffic only from the security group that is associated to the NLB.

This way the ALB will only accept inbound traffic from the NLB regardless the source IP (it will take care to allow both the health checks originated from the NLB network interfaces IP and the traffic originated by the clients that the NLB preserves.

AWS
답변함 한 달 전
profile pictureAWS
전문가
검토됨 한 달 전
0

This article should help: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-update-security-groups.html.

I would do as follows:

Security group for public ALB: Inbound :NLB client IP, 443, VPC Cidr of the NLB Outbound: instances behind ALB

profile picture
전문가
답변함 한 달 전
profile picture
전문가
검토됨 한 달 전
  • Doesn't the NLB preserve the source IP?

  • It does but I think it depends on how you then register the target: https://repost.aws/knowledge-center/elb-capture-client-ip-addresses.

    For Network Load Balancers, register your targets by instance ID to capture client IP addresses without additional web server configuration. For instructions, see Target group attributes instead of the following resolutions.

    For Network Load Balancers when you can register only IP addresses as targets, activate proxy protocol version 2 on the load balancer. For instructions, see Enable proxy protocol instead of the following resolutions.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠