3
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 04 Jul 2023
3 points (100.0% liked)
homeassistant
11921 readers
36 users here now
Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io
founded 1 year ago
MODERATORS
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:
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.