Home Lab Security: Locking Down Your Smart Home

Read full text Summarise with VIRAT
Authors: Daniel Rosehill, Gemini 3.1 (Flash), Chatterbox TTS
Cited by: 0

Summary

No summary yet. VIRAT can read this paper and write a plain-language summary of its aim, methods, key findings and limitations.

Summarise with VIRAT Free to try with your Science Catalogs account.

Abstract

Episode summary: We explore the concept of blast radius in self-hosted environments, specifically focusing on securing home automation setups like Home Assistant. Learn how to move beyond simple perimeter defenses like Cloudflare Tunnels and implement true isolation using Linux kernel features. We discuss practical steps for sandboxing containers, managing network segmentation, and applying the principle of least privilege to prevent lateral movement attacks. Show Notes The "It Just Works" Tax of Self-Hosting For many self-hosting enthusiasts, the thrill of setting up a Home Assistant instance or a media server often comes with an unspoken trade-off: security complexity. A common setup involves running services in Docker containers, exposed via a Cloudflare Tunnel for remote access. While this eliminates open ports on the router, it creates a dangerous false sense of security. If an attacker compromises a single container—perhaps through a zero-day in a custom integration or a phishing attack—they gain a foothold inside the network. The critical question then becomes: what else can they reach? This is the blast radius problem. In a typical home lab, services like Home Assistant, MQTT brokers, databases, and media servers often run on the same host or a cluster of Raspberry Pis, frequently sharing a default Docker network. If one container is breached, an attacker can often scan the entire internal subnet, see other containers, and pivot to more critical targets like a NAS or a work laptop. The convenience of a single `docker-compose.yaml` file can inadvertently create a flat network where a compromised light switch app has a direct path to sensitive data. **Isolating the Kernel: Namespaces and Cgroups** To contain this blast radius, we must move beyond perimeter security and embrace isolation at the Linux kernel level. Docker is essentially a wrapper around two key kernel features: namespaces and cgroups. Namespaces provide visibility isolation. The PID namespace ensures a process in one container cannot see processes in others or on the host. The Mount namespace prevents a container from seeing the host's root filesystem—unless you've made the critical mistake of mounting the Docker socket (`/var/run/docker.sock`) into a container. Doing so hands an attacker the "God Mode" API for your server, allowing them to spawn new containers with root access to the entire hard drive. Similarly, the Network namespace creates a virtual network stack for each container, though by default, Docker places them all on a single bridge, allowing lateral movement. Cgroups, specifically cgroups v2 in modern kernels, handle resource isolation. They prevent a compromised container from consuming all available CPU or RAM, which could crash the host. By setting hard limits, you ensure that even if a container starts a crypto-miner after being hacked, it only gets a fraction of resources, keeping the rest of the system alive and accessible for remediation. **Mandatory Access Control: Seccomp and AppArmor** Beyond hiding processes and limiting resources, we must restrict what a container is actually allowed to do with the kernel. This is where Mandatory Access Control (MAC) comes in. Seccomp (Secure Computing mode) acts as a firewall for kernel system calls. A typical Linux kernel has over 300 system calls, but most applications only need 40–50. Docker's default seccomp profile blocks about 44 dangerous calls, but it leaves over 200 exposed. By creating a custom profile that blocks unnecessary calls, you can neutralize many kernel exploits before they even execute. AppArmor and SELinux offer complementary protection through path-based permissions. An AppArmor profile can restrict a process to reading only specific folders and prevent it from executing scripts in `/tmp`. This is crucial for stopping attackers who download malicious scripts to temporary directories after gaining initial access. **Architectural Patterns for Home Automation** For home automation specifically, the challenge is that services need to communicate—Home Assistant must talk to an MQTT broker, which in turn talks to Zigbee devices. The solution involves a combination of network segmentation and identity-first access. Instead of a single "home-automation" Docker network, create separate networks: a frontend network for the UI, a backend network for databases, and a dedicated network for MQTT traffic. This limits which containers can talk to each other directly. More importantly, apply the principle of least privilege at the data layer. MQTT brokers should use per-client credentials and Access Control Lists (ACLs). Instead of giving Home Assistant a root account on the broker, create a user that can only publish to `lights` topics and subscribe to `sensors` topics. If Home Assistant is compromised, the attacker cannot send factory reset commands to smart locks if the broker's ACLs forbid that user from accessing the locks topic. **Open Questions and Future Directions** While these measures significantly reduce risk, they introduce complexity. Setting up custom seccomp profiles or fine-grained ACLs requires effort, and there's always a balance between security and convenience. Tools like Podman, which is daemonless and handles user namespaces more securely by default, may offer a smoother path for some users. Ultimately, securing a home lab isn't about achieving perfect isolation—it's about making lateral movement so difficult that an attacker moves on to easier targets. By leveraging Linux kernel features and thoughtful architecture, self-hosters can enjoy the convenience of smart homes without turning them into surveillance tools for bad actors. Listen online: https://myweirdprompts.com/episode/home-lab-security-locking-down-smart-home

Fields of Study & Subjects

Security and Verification in Computing Network Security and Intrusion Detection IoT-based Smart Home Systems

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
28 March 2026
Language
EN