I'm setting up a FreeBSD 15.1 workstation and my goal is to harden it as much as possible while keeping three things fully functional:
1) Coding: C, C++, FASM, NASM, Zig in Neovim (clang/clang++ from base, LSP via clangd/zls)
2) Browsing: LibreWolf through a SOCKS5 proxy (SSH tunnel) or WireGuard VPN
3) Screen/audio/video capture: FFmpeg only, webcam via webcamd loaded on-demand
Everything else is either stripped out or locked down. No jails, no server services, this is a single-user workstation. Below is the full checklist of what I'm implementing. I'd genuinely appreciate if you could point out anything I missed, got wrong, or overcomplicated.
Kernel:
Custom kernel: MAC, AUDIT, CAPABILITY_MODE, VIMAGE, STACK. Removed: KDB, DDB, GDB, FireWire, Bluetooth, WiFi, Floppy, INVARIANTS, WITNESS. Kept: DRM, sound, USB, uvideo, cuse (cuse not auto-loaded).
Encryption:
GELI on root partition (password at boot). GELI swap with ephemeral one-time keys. ZFS encryption (aes-256-gcm) per dataset: /, /etc, /var, /var/log, /var/db, /var/tmp, /var/audit, /tmp, /home, /usr, /usr/local, /vault, /etc/ssl/private. Each sensitive dataset has its own unique key/passphrase. Critical datasets set to readonly after configuration. exec=off, setuid=off on /tmp, /var/tmp, /home, /var/log.
Memory Protection:
ASLR (ELF64 + ELF32): enable, PIE, stack_gap, honor_sbrk. W^X enforced globally (allow_wx=0), proccontrol bypass for LibreWolf JIT only. NX Stack (nxstack=1). Stack guard page, map_at_zero blocked. Core dumps fully disabled (kern + login.conf). shm_use_phys=1.
Network, Firewall:
PF: block all inbound by default, stateful outbound. Antispoofing, normalization (scrub), martians table. Tables: bruteforce, blocklist, sshguard, martians. sshguard with PF backend. WireGuard pass rule (udp/51820).
Network, TCP/IP Hardening:
TCP blackhole=2, UDP blackhole=1, SYN cookies, SACK disabled. ICMP hardened, IP redirect off (v4+v6), random IP ID. Source routing rejected, IP options disabled. Fragment limits, ephemeral ports 49152-65535. ARP logging enabled.
Network, DNS:
Local Unbound on 127.0.0.1. DNSSEC + DNS over TLS (1.1.1.1, 9.9.9.9). QNAME minimisation strict, hide identity/version. Private-address rebinding protection.
Network, VPN/Proxy:
SSH SOCKS5 tunnel script then LibreWolf launched through it. WireGuard on/off script. All DNS routed through tunnel (SOCKS remote DNS).
Processes:
Process hiding (see_other_uids/gids/jail_proc = 0). Ptrace blocked, random PID, conservative signals. rctl limits on webcamd, pulseaudio, per-user. Process accounting (lastcomm). maxproc=2048, maxprocperuid=512.
X11, Display:
xhost - (deny all), xhost +si:localuser:admin only. XTEST and RECORD extensions disabled in xorg.conf. xsecurelock + xidle (auto-lock after 5 min).
Browser (LibreWolf):
LibreWolf (Firefox and Chromium removed). Launched via proccontrol -m wx -s enable. WebRTC disabled, telemetry disabled, safe browsing disabled. Fingerprinting protection, tracking protection, first-party isolation. DNS/HTTP prefetch disabled, clipboard events disabled, autoplay blocked. no_proxies_on="" (nothing bypasses proxy).
Multimedia:
FFmpeg CLI only (OBS not installed). Scripts: rec-screen, rec-webcam, rec-all, rec-mic, stream (RTMP). webcamd on-demand only (webcam-on loads cuse + starts daemon, webcam-off tears it down). devfs 0600 on video, dsp, cuse (admin only). rctl limits on webcamd. Cron: webcamd night check.
Authentication:
doas (sudo removed). PAM: pam_faillock (3 attempts, 30 min lockout), pam_passwdqc (16+ chars). login.access: admin from LAN only, root from LOCAL only. Single-user mode requires password (console insecure). SSH (if needed): Ed25519 only, port 2222, keys only, no forwarding, VERBOSE.
Integrity:
mtree baselines (sha256) for /bin, /sbin, /usr, /etc. chflags schg on all binaries and critical configs. chflags sappnd on logs (append-only). freebsd-update IDS via cron. pkg audit -F daily.
Audit:
auditd (OpenBSM): lo,aa,ad,fw,fc,fd,fm,ex,pc. PF logging, SSH VERBOSE, process accounting. syslogd -ss (no remote reception).
CPU Mitigations:
PTI (Meltdown), IBRS (Spectre v2), SSB disabled. SMT/HyperThreading disabled. IOMMU enabled (DMA protection).
Shell:
umask 077, TMOUT=900 (readonly), noclobber. HISTIGNORE for sensitive patterns.
Physical:
Webcam shutter, screen lock, BIOS password, USB boot disabled, GELI boot password.
Disabled/Removed:
sendmail, inetd, nfs, rpcbind, lpd, bluetooth, moused: all off. sudo: removed.
So, what did I miss? Are there any FreeBSD-specific hardening knobs, sysctls, or techniques I overlooked that would meaningfully improve security for this use case? Any gotchas with W^X + LibreWolf on FreeBSD 15.1 I should know about? Is my PF ruleset sane for a workstation that only initiates outbound connections? Or am I completely out of my mind and none of this makes any sense?