Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict access by IP address #88

Open
vitobotta opened this issue Jan 18, 2023 · 6 comments
Open

Restrict access by IP address #88

vitobotta opened this issue Jan 18, 2023 · 6 comments

Comments

@vitobotta
Copy link

HI, how can I restrict access to a container's port to a specific IP only? For example I want to be able to access Nginx Proxy Manager only from my home IP. Thanks!

@xavier-hernandez
Copy link

ufw route allow proto tcp from HOME_IP_HERE to any port XX

@shinebayar-g
Copy link

ufw route allow from <source> to <container> port <container_port> proto tcp
# example
ufw route allow from 192.168.3.0/24 to 172.17.0.4 port 8080 proto tcp

@vitobotta
Copy link
Author

I changed approach actually. For Nginx Proxy Manager and Portainer I am now using Cloudflare Zero Trust Access, and have changed the script slightly to always allow traffic from Cloudflare IP ranges, see https://bin.botta.me/Z0ZC7b.sh

I haven't whitelisted anything at all with ufw-docker. Do you see any issues with this approach?

@dyanakiev
Copy link

@vitobotta hey, the link has expired

@vitobotta
Copy link
Author

vitobotta commented Feb 3, 2023

Oops. This one doesn't have an expiration https://bin.botta.me/am9mxb.sh

@devnoname120
Copy link

@vitobotta hey, the link has expired

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants