Hey all!
I’m fairly new to Home Assistant and have just created a few dashboards to be able to view my router statistics and be able to restart them via REST if need be. Love being able to do this seamlessly from one place.
It got me thinking however, that I can only really access the dashboard when I’m on my internal network. I know that there is a paid Home Assistant cloud that would enable me to view my dashboards and such publicly and securely, but I was wondering if this community has set it up themselves for free and securely.
Would anyone be able to guide me in the right direction?
Surprised no one mentioned the native option of paying for the native Nabu Casa tunnel, you also get some other benefits. It is by far the easiest option but not free. It does however support Home Assistant development.
Personally I just expose my instance behind Opnsense with an SSL cert, and some web application firewall rules using nginx but that is a more technical configuration.
I like Nabu Casa because it’s easy, it works, and it supports the HA devs.
Supporting the HA Devs is the only reason I didn’t set up a reverse proxy myself.
You can use Tailscale and Zerotier to access your local HomeAssistant from any devices connected with your Tailscale/Zerotier account.
But if you want to expose your HomeAssistant to public using a custom domain name, one way to do that is by using Cloudflare Tunnel: https://www.makeuseof.com/use-cloudflare-tunnel-expose-local-servers-internet/
I’m thinking to expose HA via a cloudflare tunnel; but I’m concerned as to what security implications this may have. I’m not sure what, if any, security issues the HA login page may have. I can easily put everything through a reverse proxy, which I already have set up for other reasons. I may migrate all my externally exposed webpages via cloudflare.
Have any lemmings used cloudflare for this? what is your experience with it?
Security is a rabbit hole and you can go very deep depending on your risk model (an ordinary middle class people has different cybersecurity risk than, say, a CEO of a major bank). Let’s say you are an ordinary lemming that don’t have to be worry about being specifically targeted by a hacker group or a nation state, you just don’t want some botnets get into your network and take over your IoT stuff, I think the following is reasonable enough:
- by deploying your HA instance using docker or VM, if it somehow got compromized by an automated botnets / malware, the infection will be contained and you can easily wipe it off and start again. Real hackers might be able to escape the sandbox but run of the mills botnets that always scan the internet for exploits usually don’t.
- setup OTP: https://www.home-assistant.io/docs/authentication/multi-factor-auth/
- you can max out security level of HA login page (or the entire HA) using cloudflare’s firewall rule: https://developers.cloudflare.com/firewall/cf-dashboard/create-edit-delete-rules/ . This should stop most bots from trying to bruteforce your login page.
- assuming you’re using cloudflare tunnel, you aren’t actually exposing your entire machine to the internet, but just the homeassistant port. That being said, it’ll be nice if you take some precaution and disable root ssh login and perhaps disallow password login too, just for peace of mind.
My HomeAssistant is on a dedicated system right now, so if it’s lost, I can reinstall without too much trouble. I have it backed up to my google drive, and I’m planning on setting up some local backups… so the config will almost certainly not be lost. I have to make it a bit more robust to make sure we have backups of the zwave controller config and security keys and everything for the S2 devices, and whatnot…
I’m wondering if HA supports login via device certificate, it may be more secure than a password, even with OTP, and after a rough initial setup for the users, it should be seamless for them to use it, regardless of if they’re local or remote. I also want to get it set up to integrate with Google’s assistant, mainly for nest home mini’s we have placed around the house. I’m not a fan of paying for that privilege, so I’m still examining my options.
Any input you may have on this from a security standpoint would be appreciated. For context, I’m an IT admin by day (system and network mainly), I have some experience with security, but when it comes to pretty much anything that requires metasploit or anything more complicated, I’m generally out of my league. Working with systems, firewalls, tunnels, forwarding, ports, protocols, etc. that’s all my jam. I’m good with doing what’s needed. I have a homelab and a farm of virtual machines to do my bidding day-to-day. So I’m not stranger to complexity; as long as it’s logical to add complexity to the system, then I won’t shy away from whatever needs to be done to accomplish the task.
If you want some peace of mind, there is nothing wrong to keep your home assistant instance locked up behind your lan. You can still access it externally using a VPN, or zerotier/tailscale. If you need notification support, just configure sms or email notification so HomeAssistant can still send you alert via SMS or email.
If you’re ok with not being able to use HomeAssistant mobile app, then you can add some extra security by putting your home assistant instance behind an authenticating proxy. This means your home assistant will be protected by two login pages when you attempt to access it from outside your network.
Some authenticating proxy options are Cloudflare Access or OAuth2 Proxy.
If you’re already using Cloudflare, then using Cloudflare Access might be no brainer. If you’re already have experience with setting up your own OIDC providers using keycloak, auth0, okta, or Google oauth2 provider, then putting your home assistant instance behind OAuth2 Proxy might be a good option. Those auth providers usually have stricter login pages and you usually can add even stricter rules to the login page (e.g. disallow login from certain countries, rate limit, add captcha in addition to 2fa, etc). How strict your extra login security will be is entirely up to you.
For Google assistant integration, you’ll need to enable the API in your GCP account as mentioned in this page. But it does require your home assistant url to be publicly routable from GCP servers so Google assistant can reach it, which means you can’t put your instance behind an authenticating proxy or keep it behind your lan. You might still be able to whitelist certain path from the authenticating proxy (e.g. the
/api/google_assistant
endpoint), but I haven’t tried it yet.
Currently using CloudFlare for two different homes. One is on cloudflared add-on, with Nginx Proxy Manager as the reverse proxy.
The other, CloudFlare tunnel hosted on a docker container in the same network, with Nginx Proxy Manager as well to unify ports for some services.
Both setups been working well so far, ignoring the concerns that the HA frontend may have potential security issues.
Would using Tailscale be similar to a VPN where I’d have to establish a VPN connection and have all my traffic directed to Tailscale?
Tailscale is a virtual lan network. When you enable tailscale, you’ll have an additional network and ip address in your connected devices. It’s not actually redirecting all your traffics there, unless you specifically configure it to do so (if you do so, you can designated a device as an “exit node” for your outbound traffic).
Install the Wireguard (and the DuckDNS) add-on(s). It allows you to reach your HA instance from everywhere as long as it’s connected to the internet. Make sure to ‘autorun’ the add-ons after a system restart.
Tailscale is an easy and secure way of getting access to your local network.
For years, I used Wireguard as my only way to access it remotely. Worked well but always annoying toggling that on/off since all my traffic went over WG and some apps (bank, Pokemon Go, Netflix) didn’t like that my source IP was a VPS.
I set up Authelia a year or two ago and now have HA exposed behind that with 2FA. I don’t know if the HA app will work with that, but I use the PWA and it works great.
Haven’t had any intrusions (yet?) and my HA is “always on” so long as my Authelia session is valid. Other apps are also behind Authelia, so signing into one signs me into all.
Worked well but always annoying toggling that on/off since all my traffic went over WG and some apps (bank, Pokemon Go, Netflix) didn’t like that my source IP was a VPS.
For the record, with wireguard you can configure
AllowedIPs
on the client such that internet traffic isn’t routed through the tunnel. Basically, don’t use the wildcard 0.0.0.0/0 and instead set the wireguard network and the LAN subnet that Home Assistant is on if you need to access other devices.Yep, and I eventually set up a separate WG profile that had just my LAN route and set the DNS to my PiHole.
The full route was more useful most of the time so I still tended to use that more often. Cell signal at the office was nonexistent toward the middle of the building (where the bathrooms are) and the guest WiFi blocked “time waster” sites like Reddit.
I’m actually not a Home Assistant User, but if I understand the issue correctly something like that can usually be solved by setting up your own VPN on your modem/router. If you choose the right options and a good password it should even be secure :)
the problem with VPN and HA is that if you want to use your phone as a presence sensor, you need to keep your phone connected to your VPN at all times or the HA app won’t be able to update your sensors.
deleted by creator
I’m not a fan of VPNs for cases like this, but that is a personal preference. I’m using a TLS client certificate with my nginx as load balancer which works very well for me. I have installed that certificate on every PC and my Android device. Let’s Encrypt also works, but for every self hosted service a client certificate is required
deleted by creator
Only one response in here for using Nginx, and there should be more. The Nginx SSL proxy works with the DuckDNS add-on to manage your IP address and and keep your LetsEncrypt certificates up to date.
If you own a domain and want to do that, you can use the Nginx Proxy Manager, which can also manage LetsEncrypt certs. It’s a bit more complex to set up.
Combined with the OTP authentication built-into Home Assistant, it’s a pretty good option. The risk is that Home Assistant itself is your edge, and it’s always possible there’s something to exploit on the front-end.
Running cloudflare zt tunnel, just need to set the containers IP as static and allow it as a trusted proxy. No issues here
I just use Open VPN to log in to my home network when away. It was really easy to set it up on my OpenWRT router.
deleted by creator