Replies: 1 comment 5 replies
-
I'm new to Docker and not a Python coder, but here's a good writeup from Docker themselves about the network security problem ... and how to (mostly) solve it specifying the loopback 127.0.0.1 interface: _Publishing container ports is insecure by default. Meaning, when you publish a container's ports it becomes available not only to the Docker host, but to the outside world as well. If you include the localhost IP address (127.0.0.1) with the publish flag, only the Docker host can access the published container port. $ docker run -p 127.0.0.1:8080:80 nginx_ I do understand why people want (and are comfortable) with the various Powerwall-Dashboard services being available from other machines, but this would be a nice option to have for those of us that don't want to expose the underlying services outside the local machine. Is this simply a matter of modifying the "ports" and/or "published" lines in powerwall.yml? |
Beta Was this translation helpful? Give feedback.
-
Per #357 , I have Powerwall-Dashboard setup on a public server. As typical, I'm running firewalld and the default policy is DROP ALL except for specified opened ports, such as ssh, http, https. So I dutifully opened up port 9000 for Grafana to public access.
But when I did an nmap, I also saw port 8086 (influxdb) and 8676 (weather) open ... again, this is on the public side. So after saying WTF, I went down a deep rabbit hole ... and it's a well known "problem/complaint" that docker effectively bypasses the firewalld rules.
While there is some IPTABLES "black magic" using DOCKER-USER to restrict this, I'm wondering if it would make sense for there to be an option such that influxdb/weather only binds to the localhost.
For instance, I noticed that influxdb.conf has this line at the top:
"bind-address = "127.0.0.1:8088"
but in the http section, it just has:
bind-address = ":8086"
Semi-similarly, weather.conf has:
PORT = 8676
I realize not much of a concern if you are running internally on your house LAN. I also understand why it's useful to directly query these (some examples in the README), but there should be some way of restricting access to these services.
So is it possible to address this security concern by only binding influxdb/weather to localhost, which should still (?) allow Powerwall-Dashboard (running on same machine) to internally query these?
Beta Was this translation helpful? Give feedback.
All reactions