aws-observability / aws-otel-test-framework

AWS Distro for OpenTelemetry Test Framework
https://aws-otel.github.io/
Apache License 2.0
30 stars 62 forks source link

Security group inbound rules are too lax #221

Open mx-psi opened 3 years ago

mx-psi commented 3 years ago

The current security group setup under the terraform/setup folder has inbound rules with a CIDR group 0.0.0.0/0. This is not allowed under certain security group policies because it allows an arbitrary computer to connect to the instance, and it is sometimes considered a bad security practice.

It would be useful to either change the default behavior or have an option to make these rules more restrictive. In particular, I believe the minimal inbound rules would need to be to

  1. allow other instances within the same security group to connect to each other and
  2. allow the IP from the machine who is doing the setup to connect via SSH, so that Terraform can provision the machines correctly.
wyTrivail commented 3 years ago

@mx-psi Thank you for raising this concern and the suggestion! Yes it's indeed a security problem which i have also been considering to limit the access of those ports.

I briefly looped through the ports, below are the details of what we can do.

I'm marking this issue as an enhancement so that we can track it.

mx-psi commented 3 years ago

Glad to see that this is being considered, and thank you very much for providing the uses of the different ports, this is helpful to double check that I was doing the correct thing here :)

port 22/5985: probably fine to leave it public as we keep ssh key locally

I agree there is no security concern here, but for us it would still be helpful to have some sort of option to provide an IP: if you set a rule with a 0.0.0.0/0 CIDR block in our AWS environments it will get automaticallly deleted (likely related to AWS Firewall Manager), so you have to set it up manually afterwards.

wyTrivail commented 3 years ago

@mx-psi Thx for pointing that out!

Yes, we can add an option to configure the allowed ips for ports(22, 5985, 80, 8080) so that the people configure their own machine ip or gateway ips. We probably need to support a ip range because most of the company's gateway is a range of ip.