-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-ecs-1: constrain ephemeral port range #1051
aws-ecs-1: constrain ephemeral port range #1051
Conversation
ECS documents a smaller ephemeral port range than is default on Bottlerocket. Constraining our range to the documented ECS range should avoid surprising customers who expect ECS's documented range and have configured their security groups accordingly.
|
||
# Constrain ephemeral ports to the range documented for ECS | ||
# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PortMapping.html | ||
net.ipv4.ip_local_port_range = 32768 60999 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't see 60999
referenced in the linked docs, is 60999
a value that was chosen over65535
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this without noticing it was different from the ECS documentation, but 60999 is the upper bound I see on Amazon Linux, Debian, and Ubuntu. I can add that to the comments if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this aligned with documented and current usages of the constrained port range: so yes, I'd prefer to see this as 65535
.
An example: the current port range used by the CDK is 32768-65535 (though this range might be opened up in the near future).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Discussed offline with @samuelkarp : common distributions are using the kernel's default of
60999
- digging into the kernel history on
60999
(and the move to61000
) show no concerns surrounding65535
nor60999
(other than for port assignment efficacy) - I'm on board with leaving this at
60999
👍
Issue number:
#815
Description of changes:
ECS documents a smaller ephemeral port range than is default on Bottlerocket. Constraining our range to the documented ECS range should avoid surprising customers who expect ECS's documented range and have configured their security groups accordingly.
Testing done:
docker run
locally and saw the correct ephemeral port range being used."portMappings": [{"containerPort": 80}]
and saw the correct ephemeral port range being used.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.