I’m running a dockerized Flask web server on an AWS EC2 instance and encountering issues with security group configurations. My goal is to restrict access to only my device/network, but I’m facing difficulties.
Current situation:
-
When inbound rule is set to 0.0.0.0/0, I can access the endpoint from anywhere and SSH into the instance.
-
I want to restrict access to only my device/network.
Only allowing 0.0.0.0/0 works, but this is not secure.
Questions:
-
How can I correctly configure the security group to allow access only from my specific IP/network?
-
Why aren’t the methods I’ve tried working?
-
Is there a way to troubleshoot this issue or verify if my IP is correct?
What I’ve tried (none of these work):
-
Using my device’s IPv4 address in CIDR format as the inbound rule
-
Using my public IP address in CIDR format
-
Using the “My IP” option in the security group configuration menu
With these configurations, I can’t access:
-
The Flask web server endpoint
-
The EC2 instance via SSH
Any help or guidance would be greatly appreciated. Thanks!