Home · Volume 6 · Chapter 03

📖 Chapter 03 — Security Hardening

The layers that protect against attackers. Defense in depth.

v0.1 · draft Vol 6 · Ch 03
~15 min

Learning Objectives

Introduction

Security is not a switch; it's a gradient. The home NAS with no security is at one end; the home NAS with every hardening measure is at the other. The right place to be is somewhere in the middle: the practical security that protects against realistic threats without consuming your life.

This chapter covers the layers: the network, the OS, the apps, the credentials, the monitoring. Each layer adds protection; no single layer is enough. Defense in depth.

The threat model

Before you can protect against attackers, you need to know who they are and what they want. The threat model for a home NAS:

For most home users, the realistic threat is the first and fourth. The defenses below are designed to defeat them. The targeted attacker is harder to defend against but also less common.

Defense in depth

Defense in depth means: no single layer is the only defense. If one layer fails, the next layer catches. For the home NAS, the layers are:

  1. Network: don't expose services to the internet. Use Tailscale for remote access.
  2. Firewall: block everything by default, allow only what's needed.
  3. OS: keep the OS updated, use SSH keys not passwords, disable unnecessary services.
  4. Apps: use strong authentication, MFA where possible, follow security advisories.
  5. Credentials: unique passwords for every service, a password manager, MFA on critical accounts.
  6. Monitoring: know when something is wrong, alert on suspicious activity.
  7. Backups: even if the attacker gets in, the data is recoverable.

Each layer is a partial defense. Together, they make the system robust against realistic threats.

Network layer

The most important security measure: don't expose services to the public internet. From Volume 1, Chapter 8: Tailscale is the right way to access the NAS remotely. The NAS doesn't need to be reachable from the open internet.

Specifically:

If a service needs to be public (a public website, a service for a non-technical friend), use Cloudflare Tunnel or Cloudflare Access, which put Cloudflare between the public internet and your NAS.

Firewall

TrueNAS Scale has a built-in firewall. Configure it:

The firewall is a safety net: if a service accidentally opens a public port, the firewall blocks the traffic.

OS layer

For TrueNAS:

For Linux VMs and containers:

App layer

For each app, the security basics:

The password manager

The single most important security tool: a password manager. The family uses Vaultwarden (from Volume 1, Chapter 8 and Volume 2, Chapter 6). For the home lab, use Vaultwarden for everything:

Never reuse passwords. If one service is compromised, the attacker doesn't get access to anything else.

MFA: multi-factor authentication

MFA adds a second factor to login: something you know (password) and something you have (phone, hardware key). For critical services, MFA is non-negotiable:

For other services, enable MFA when available. The friction is real (a few seconds per login); the protection is significant.

The "what if MFA fails" backup

MFA has a downside: if you lose the device, you can't log in. The mitigations:

For the TrueNAS admin account, store a backup of the TOTP seed in a secure location (a sealed envelope in a safe, a separate password manager). The cost of being locked out is high.

The "audit trail" pattern

For critical systems, enable audit logging:

When something goes wrong ("someone deleted a file they shouldn't have"), the audit log answers the question: who, when, what.

The "incident response" plan

For when the worst happens (a compromised account, a ransomware attack, a stolen device), have a plan:

  1. Detect: the monitoring alert fires.
  2. Contain: disable the compromised account, change passwords, revoke API tokens.
  3. Eradicate: identify the root cause. How did the attacker get in?
  4. Recover: restore from backup if needed. Re-enable the affected service.
  5. Post-mortem: document what happened, what worked, what didn't, what to change.

The plan is in the runbook (Chapter 7). The discipline: know what to do before the incident. The day of the incident is not the day to figure it out.

What NOT to do

Engineering Note

Security is a habit, not a project. The system isn't "secure" once and forever. New vulnerabilities are discovered. New apps are added. New users come and go. The discipline: review the security posture quarterly. Update the apps. Audit the users. Check the firewall rules. The 30 minutes a quarter is what keeps the system secure over years.

Summary

Defense in depth: network, firewall, OS, apps, credentials, monitoring, backups. Don't expose services to the public internet (Tailscale or Cloudflare Tunnel). Use SSH keys, MFA, and a password manager. Enable audit logging. Have an incident response plan. Review quarterly. Security is a habit, not a project. The 30 minutes a quarter keeps the system secure over years.

Checklist

Looking Ahead

Chapter 04 is capacity planning. Predicting when you'll need more space, more performance, more RAM. The math, the signs, the timing. The chapter that turns "I'm out of space" from a surprise into a planned upgrade.

Ch 03 · v0.1 · drafted from the original ChatGPT conversation, July 2026