Security group outbound rules with Elastic Container Service

0

Hi, i've got an ECS Fargate service with tasks on personal VPC behind an App load balancer. All works great but i'm not confident with the security group outbound rules i set and i don't know which range of TCP ports need to be really open. At the moment all TCP ports are open on outbounds rules and if i change this, deployment doesn't work. I want to know which ports are really needed to make my ECR image to be automatically deployed on tasks.
I spend a little bit of time searching on the internet but responses don't work for me. I read some persons with 32000-65000+ tcp ports open but seems a litlle bit the same as all TCP ports for me.

I try this setup : HTTP 80 (LB) , TCP 3001 (my app), and the TCP range 51678 - 51680 for the ECS agent container (i found this on the doc) but doesn't work and tasks are not deployed. With all tcp port open and http 80, image is deployed nicely.

I'm really not an expert but a real rookie, and i'm pretty sure openning all outbound TCP ports in my security group is not a good idea. Is it really a security problem ?
Any advices will be really helpfull. Thank you !

Jean B
已提問 10 個月前檢視次數 850 次
1 個回答
3
已接受的答案

Hi

I think you need to allow outgoing traffic on port 443 and 53 (both TCP and UDP) for ECS to be able to pull images from ECR. Maybe this guide can help?

profile picture
專家
已回答 10 個月前
profile pictureAWS
專家
已審閱 10 個月前
profile picture
專家
已審閱 10 個月前
  • Really thank you for your quick help, it works perfectly ! Bravo !

  • 443 is https and 53 is dns. Both need to be open.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南