Why do I need Ephemeral ports open for http 80 (website to work)?

1

Why do I need Ephemeral ports open for http 80 (website to work)?

Can someone please help me understand if I am creating a NACL why do I need Ephemeral ports on the outgoing for a http request to work?

profile picture
已提问 1 年前690 查看次数
4 回答
0

NACLs are stateless, the response is not implicitly allowed therefore you need to explicitly allow the Ephemeral ports. On the other hand Security groups are stateful, you only would need to allow inbound access, return response would be allowed implicitly.

profile pictureAWS
专家
已回答 1 年前
0

yea.. I am understand that that I have port 80 up inbound and also outbound..... just dont understand why I need the ephemeral ports open for http.. I would think if I have port 80 allow on the in and out it would work

profile picture
已回答 1 年前
0

For http the Request traffic is on port 80. Response traffic isn't on port 80, it's on one of the ephemeral ports. So for inbound connections your NACL needs to allow port 80 inbound but NOT outbound! Just the ephemeral ports outbound.

专家
已回答 1 年前
0

Let's say I connect to your webserver, which is listening on port 80.

The TCP connection originates from a socket on my device, which is bound to an ephemeral port. It'll connect, say, TCP port 54785 on my Mac to port 80 on your webserver.

Stateful firewalls understand that the traffic sent from port 80 on your webserver to port 54785 on my machine represents a connection / conversation, so they don't need explicit rules to permit the traffic.

NACLs on the other hand are completely stateless, and have no concept of what has happened at any other point in time, much like an AWS service team building a way to run containers, oblivious of the countless other services that do the same thing. As a result, the traffic from port 80 to the ephemeral ports has to be explicitly permitted.

All of that said, the default best practice guidance on NACLs is "avoid them if at all possible." They're annoying to troubleshoot, and easy to forget they're there...

profile picture
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则