Maybe I’m using the wrong terms, but what I’m wondering is if people are running services at home that they’ve made accessible from the internet. I.e. not open to the public, only so that they can use their own services from anywhere.
I’m paranoid a f when it comes to our home server, and even as a fairly experienced Linux user and programmer I don’t trust myself when it comes to computer security. However, it would be very convenient if my wife and I could access our self-hosted services when away from home. Or perhaps even make an album public and share a link with a few friends (e.g. Nextcloud, but I haven’t set that up yet).
Currently all our services run in docker containers, with separate user accounts, but I wouldn’t trust that to be 100% safe. Is there some kind of idiot proof way to expose one of the services to the internet without risking the integrity of the whole server in case it somehow gets compromised?
How are the rest of you reasoning about security? Renting a VPS for anything exposed? Using some kind of VPN to connect your phones to home network? Would you trust something like Nextcloud over HTTPS to never get hacked?
Exposed is the right term. Other than my Wireguard VPN port, everything I have exposed is HTTPS behind Authelia MFA and SWAG.
I’m tempted to switch Wireguard for Tailscale, as the level of logging with WG has always bothered me. Maybe one day.
None. If anything, I’d probably set up a VPN. But there’s nothing so deathly important on my home network that I would need it while away from home. If I wanted to expose services, I’d use a reverse proxy and increase separation between services.
Port 443 through Traefik and a port for Plex.
This is the way I do it. Id like to run plex through traefik as well but it gets angry.
I did for a while, but it never felt right.
I’m also lazy a f, so I purchased a new router that comes with WireGuard VPN and that works well enough with our iPhones.
Removed by mod
ssh to a few specific ip ranges, WireGuard to the world on a port I randomly picked
I don’t technically open any ports to the public. I have a site-to-site wireguard tunnel to a hosted server. The hosted server is running a hypervisor with two virtual switches. One switch is my external switch and only my Wireguard server is using it. The other is an internal switch where I place other VMs for separate things. A container host, a terminal server with xrdp, a monitoring server with netdata, stuff like that. All technically, but unnecessarily, accessed through nginx proxy manager.
Because it’s site2site with my home equipment on the Wireguard server, i can still connect to my home network where i host a number of separate services like HomeAssistant from outside the home network.
I don’t use tailscale, but Wireguard vanilla is super easy to work with. I also have fail2ban pretty much everywhere I can install it because it takes up practically zero resources.
I’ve got a few layers of security for my homelab setup that make me feel pretty comfortable against random attacks.
Cloudflare is used to manage my domains and act as an external proxy to obscure my IP address, I’ve only forwarded ports 80 and 443 to Traefik my containerized reverse proxy, Authelia to add 2FA to services that I feel should have extra protection and my homelab nodes are on a separate vlan that is configured to drop all attempts to initiate communication outside of that vlan. I also use the ubiquity intrusion detection and prevention features on my firewall to attempt to stop any know malicious activity.
A majority of these configurations are overkill for a homelab, but were fun to implement. If you use a reverse proxy and keep your software up to date you will likely be fine unless you are specifically targeted by skilled hackers. Any random scans, or shotgun style attacks tend to target unpatched vulnerabilities.
I have https open along with a non-standard port for ssh. Just for fun, I have the standard ssh port open, but redirecting to a Raspberry Pi running a honeypot. It’s fun to mess with foreign bots trying to access my network.
Do you see much activity there?
I know that they say that security through obscurity doesn’t work, but to me (a novice) it sounds like a good idea to route the default port to a dummy server.
I do see a decent amount of activity on it. Full disclaimer, I am not a security expert. I know just enough to be dangerous. But, I see at least a few connection attempts from different IPs about every day. The top 3 countries of origin are China, Russia, and Brazil (based on the reverse DNS, but it’s possible some are using VPNs to hide their origin). My impression is they’re all bots that just go through a list of IP addresses, attempting to connect to the standard ssh port, then guessing the username and password. What I’ve found is they usually go through a list of likely ssh ports until one of them connects. Having the default port open to only the honeypot means they usually establish the connection, then leave it at that, so my real ssh port never gets hit. I kinda think of it like scambaiting, where I’m just wasting time they might otherwise spend trying to break into someone else’s real ssh server.
https, wireguard and mumble.
Just set up shodan monitoring, use burpsuite or owasp zap, and check your pcap files for accidental plaintext.
Also ssllabs has a nice website checker.
And get a NGFW
Everything except https and wireguard went above my head. Do you have some sort of guide/writeup that you can point to for integrating all this?
Shodan is a internet scanning website, it can monitor your IP for new ports open and some basic vulnerability stuff.
Burpsuite is a tool to capture network traffic, they are saying they use it to confirm all their services use end to end encryption for communication.
NGFW is next gen firewall and it’s just a firewall that’s able to do more than your basic in/out rules.
If you’re gonna post that here, at least flag the post as NGFW.
I have one for OpenVPN and that’s it.
I think many of us are using reverse proxies, and opening port 443 (https) and maybe port 80 (http).
Port forwarding can be a recipe for disaster. I’d much rather make use of reverse proxying.
I forward 443 to my reverse proxy.
@housepanther @effingjoe Unless you’re running a router/firewall on the edge that can act as a reverse proxy, you kind of need to port forward to a reverse proxy if you’re behind NAT.
You could use a VPS as a proxy and set up a VPN tunnel between the home server and the VPS to avoid port forwarding altogether. I do this for my mastodon and lemmy instances. My home server is of course behind NAT but there’s no need for any kind of port forwarding. I should know because I have none configured.
At that point why don’t you just run it in the vps and save the hop.
For lots of things I self host that I wanna expose, I’ll just open a random port like 6952 and then reverse proxy w/ nginx on my web server. Not sure how secure it is, but it works
Ports are probed and scanned constantly so a random port doesn’t make so much difference. I would use a strict firewall with the server IP whitelisted.
Ever since I moved to a ridiculously high port I haven’t had any access attempts on my server. 6952 won’t do shit, but if you’re between 40000 and 65000 you probably won’t get anything.
That’s security through obscurity and one should never rely on this strategy alone
If it’s your only form of security then it’s bad. But if it’s on combination with other measures then it’s a good thing.
I wouldn’t let anyone who hits my ip/port directly into my openvpn. But not having china and russia bomboarding me with requests is nice.
Can they see what you are hosting on that port, though? Like say I want to open ssh to my server from the internet (I don’t do this and I wouldn’t unless it was temporary), but I don’t want to open it on port 22 because that’s too obvious. Are there bots that just try every protocol until they find one that your server responds to? Or is there a way to dig up information on what is being exposed behind that port?
nmap will try. https://nmap.org/book/man-version-detection.html
Ya my paranoia only allows me to expose Wireguard to access everything. I sleep better at night knowing that’s the only thing exposed. Too many instances of major companies getting hacked who have dedicated security teams to manage that. I am one person, learning to manage my own stuff in my free time.
I use Remote Desktop, BitTorrent, and play games, so I need some things open for that. I used to be super paranoid about hackers and viruses and shit like that, but it’s not like those things are looking for regular, everyday users and even if they did get in my system, I don’t keep anything important on my computer so I can just wipe it all out and reinstall everything.
I’m hosting an email server on a VPS that has fail2ban in it. A lot of ports are open but only wireguard and knockd are listening.
For remote server management, I would use wireguard for regular ssh access, but when I need to configure the wireguard I can just disable/reenable the wireguard-only ssh firewall rule using port knocking, there is also the option of using the serial console on the VPS web ui but it is slower.
Honestly, I’m not sure myself if my public facing services face a DoS attack. Well, there’s always an option of using Cloudflare. With that being said though, I think in your case you should just use a free “VPN” like Tailscale or ZeroTier.
Can you eli5 both of those? Tailscale and zerotier…
I am unsure if I can ELI5 those without also ELI5-ing about Computer Network, VPN and Firewall.
They are VPNs. Like a regular network, they connect your devices through their network. They may put Firewall rules to allow you to talk to X networks (any specified networks). That also means the VPN may not allow you to connect to the internet through their network. Now the difference between ZeroTier and Tailscale and other VPNs for accessing the internet is that ZeroTier and Tailscale only permit your traffic to your other devices that are bound to your account and not to the internet (your other internet data won’t go through zerotier/tailscale). This configuration is great because you have a virtual and secluded network that you can connect to from anywhere via the internet using ZeroTier/Tailscale networks (with your virtually local IP on ZeroTier/Tailscale).
I have ports open for Wireguard and Plex. So far, no issues that I’m aware of. Time will tell