Docker Ports in AWS EC2

Is it safe to open following ports in AWS EC2 for outside world when docker is installed

  • UDP port 6783
  • TCP port 6783
  • TCP port 2375

No, definitely not, unless you want your machine to be trivially rooted. I wouldn’t even open up that port internally. Having it open allows any comer, over unauthenticated HTTP, to get unrestricted root access to the host filesystem.