This is the case:
- Instance
Xis able to connect to instanceYon TCP port27017(allowed by EC2 security group) Xhas mongo shellYhas MongoDB running, accepting connection fromXon port27017- From
X, use mongo shell to connect to DB instance onY - From this mongo shell session on
X, query fromYand insert toY. All is successful. - Change security group of
Y: remove the rule of port27017mentioned in #1 Xcan still query from/insert to DB hosted onY. This is not expected.- Exit mongo shell session on
X - Try step 4 again and failed. This is normal and expected.
Expectation is that EC2 network firewall will terminate connections that violate the rules (the security group policies).
Could you please explain how #7 above happens? And how can that be avoided (so X cannot do anything to Y at that time)?
Thank you.