I am still very much a novice in the self-hosting space, Linux etc. having fairly recently switched from using macOS as my daily driver and not tinkering much at all.
One of the things that often confuses me is networking and making sure my setup is secure. This is currently holding me back from hosting more stuff locally that I would require access to from outside my home, as I am afraid I am doing something that could severely compromise my data. It can sometimes be difficult to follow explanations from more advanced users due to the many different components of networking and security, and different layers of abstraction, which prevents me from following completely. I might understand one particular case, but then be unable to make connections to another one. So I would want to research this more intensively, and ideally I would end up being able to easily understand the data flows - the paths the data takes (e.g. I make a HTTPS request to some server from my laptop, how is that traffic routed correctly through my local area network and later the wide area network), in what forms (i.e. different protocols, encryption layers etc.).
In communities like this, I see there are a lot of very knowledgeable people who maybe could recommended any resources that cover this from the basics and onto more advanced stuff? Maybe a textbook from a university course on ICT that is considered particularly good? A YouTube channel with great explanations and visualizations? I am looking both at home LAN and internet in general. Enterprise level networks are not very interesting to me (at the moment).
Draw it out. anything in the path has the potential to be exploited.
Internet -> ISP router -> TCP port 8080 to Nginx Proxy Manager -> TCP 443 to Computer running docker -> Docker Container -> Service.
So, in the above, The entire world will have access to only your IP on port 8080. Nginx proxy manager will take the packet, read it, do what it needs to and forwards it to the destination. I'd say that Nginx proxy manager and the end service are at risk to be exploited. If they get in then They'd be isolated by Docker and they'd need a docker exploit to get out. However, they'll be in the docker container so they'll have access to whatever that container has access to, and unless you block outbound access from the container it's basically everything in your network.
I think what you're getting at is, if I have Nginx listening on port 443 and is open to the world, can they access my game server on port 1234 that is local only. The answer to this is no. They will not have access to the game server. They need to first hack Nginx, from the PC/Docker container they then need to have access to your game server on port 1234, and if there's nothing block them (by default I believe there is nothing stopping this) then they can hack your game server.
if you ping wifi.myisp.tld what is the IP address? is it private? what if you go to http://ip.add.re.ss it should be the same thing???
It sounds like it's private and only you have access. However, the ISP usually have their own way to get into these devices, or at least to push updates or config changes. So your only risk here is the ISP being hacked, then getting you from there. OR the actual device it self having a flaw in it and someone getting in that way. In either case, all the ISP customers will be at risk. You can still go in bridge mode to protect from this.
yes. Bridge mode means the ISP provider router is now only for translation (IE: from coaxial/DSL/Fibre to RJ45/cat cable). You plug the ISP device into the WAN port of your own device and now your device has the public IP address and that is what your trusting to protect you.
yeah, as long as the ISP router is plugged into the WAN port of your router and ONLY the WAN port, then you're safe from the ISP shenanigans.
The firewall/router will forward that packet to the IP and port. If there is no device on that IP the packet will be dropped inside your network and nothing will happen. If there is a computer there and the Computer firewall is blocking access to that port, the PC Firewall will either drop it or reply saying it's closed. This depends on how the PC firewall is configured. If the PC has the port open but there is no service, the PC should just drop the packet but it will still make it to the comptuer.
Yes and no. Something could start listening on that port and start replying, You'll have no idea if a service is listening on it unless your looking or it's too late.
Ignoring the fact that something COULD start listening on it, then no, there's no real concern but I'd never do this myself. It's like giving out a bad phone number as your number, IT's possible someone will be given this phone number and now you'll have problems.
that's fine, just keep everything in the path up to date. I have port 443 open pointing to nginx, from here I forward traffic to Home Assistant, NextCloud, Headscale, etc, etc. They're hosted in docker.
I have scripts that try to update everything every hour and I'm not really worried. I'd rather a update to a new version take down my services then trust myself to login every couple days and do it manually.
The IP address is outside my network. If I try to connect directly to the IP address, it fails the certifications, I get a list of domains that are connected to the cert and am allowed to "continue and accept the risk", landing at the same site.
OK, I will definitely look into this in the near future then.
There's a modem connected to the WAN port, and the router/hotspot is connected to the modem. But I guess that doesn't change anything?
I will definitely need to setup this myself then. Do you run this as cron jobs?
OK, that is basically how it is configured now. It is not randomized in the sense that it changes every time, but it is listening on a port that was randomly chosen, but it is static since configuration.
I do use a VPN (with port forwarding supported, but I have not activated it, which I know could affect performance, but I have not noticed anything here). Is the port opening on my router unnecessary in this case?
I don't like this. That's super weird and I would not trust it. I'm sure it's "fine" but I'd hard pass on that. Set up my own 100% for sure.
I don't understand. Can I get a pic (MS Paint or real or something) or some brand names or something? I understand if you don't want to show, I'm just not sure what you're saying.
My ISP gave me a white box, I plug a fibre cable from the street Plus power from the outlet into this box. Then I have a cat6 cable from this box (port 1 as per their instructions) into the WAN port of my firewall. My Firewall has a Public IP on it's WAN interface and I have 4 ports for LAN. The same firewall gives off wifi to the rest of my house.
Yeah, here's one of them for a VPS I rent: 30 * * * * root dnf clean all ; dnf -y update && needs-restarting -r || /usr/sbin/reboot
I actually run things in Kubernetes and use https://github.com/keel-hq/keel to keep my pods (containers) up to date.
The port opening on the router is unnecessary and could be a bad thing. If you're using a VPN with port forwarding I'd close the one on your router right now. The "open" port is open via the VPN connection so they do all the opening for you, you just need to make sure your PC is on the VPN.
Go to this site with out your VPN on, it will tell you if you're using your raw internet to download torrents: https://iknowwhatyoudownload.com/en/peer/
it sounds like you might be doing that, or at least have the ability for people to connect to you via your ISP (bad) and not over the VPN (good)
Yeah, good to have my suspicions confirmed. This setup is standard where I live now, and I don't think you can get around it. First I noticed this was a coupe of years back. I'll start finding a suitable router and set it up in bridge mode.
I have two small boxes in a cabinet - one is receiving a white cable that comes from outside my home, and outputs an optical signal that goes into the other box. This other box also gets a coax cable from outside my home, and outputs an ethernet connection that is connected to what my ISP calls a WiFi router. This has additional LAN ports as well.
I could not access this site now, however, I've checked this with the torrent address detection tool on ipleak.net many times before. I recently had an issue where my real IP would show for a second if I disconnected my VPN connection manually, but I solved this. My torrent client is bound to the interface created by the VPN client. At this point I am pretty sure it is fine. But I will close the ports again.
humm, I've never seen or heard of this. I've only ever been provided one box by my ISP. I have two guesses... Either you can replace your WiFi router with your own and everything will be okay or you'll have to add a 3rd that is your own and Plug it into the WiFi router and ask them to put it in bridge mode. My guess is they can help you a lot better then me guessing.
perfect. Then you can close the open port on your router for sure. My Torrent client (rutorrent) shows what IP and port I'm using at the bottom, these are my VPN IP and the port I opened with the VPN provider.
From what I've understood from previously looking up this with my ISP, is that I connect my own device to the WiFi router they gave me. In that case I have four boxes... :) But I will naturally double check this before going forward with it, and then I might also get some clarification on what the two different boxes in my cabinet are. Bridge mode can be activated through a switch in that online portal though.
I've closed them and everything still works the same way. So I guess the ports have just been open for anyone to say hello. A good example of one of the many areas where I get confused because I don't truly understand all this stuff very well. I learn more every day, and I've gotten plenty of tips in this thread, but it makes me a bit sad that self-hosting safely requires spending a lot of time learning about this stuff, and requires continued vigilance to keep things updated. This excludes a lot of people from enjoying the freedom that comes with data ownership and control. My issue is of course not with the self-hosted solutions - the developers have done excellent work to make these tools available to people including myself, who is not an IT professional. My issue is rather that the society at large has given the major tech players carte blanche to do whatever they want for such a long time, that true privacy is so distant for most people. Some good things going on in Europe to combat this (at least against corporate malpractices), but still not nearly good enough.
Thanks again for all your answers. I really appreciate you taking the time to educate me on this stuff. It's time for me to log off the computer now, and stare at a large screen in my living room instead. The season finale of Stargate SG-1 season 6 awaits :)
Oh, before I go, I just realized that the boxes in the cabinet also handles fiber TV signals.