Files
nix-config/hosts/idols-aquamarine
ryan4yin | 二花 21d64e7add security: hardening pass 1 (AppArmor, firewall default, loopback metrics, k3s perms, SSH X11) (#266)
* security: make firewall secure-by-default, disable explicitly on servers

Flip the base firewall default to ON so new hosts are protected by default. Servers keep the firewall off (trusted internal LAN, WAN protected at the router) via explicit overrides in modules/nixos/server/{server,server-aarch64}.nix. Behavior-preserving for all 18 current hosts; adds a security-firewall eval test guarding the per-host state.

* test: fix security-firewall eval test to scalar per-host values

* security: enable AppArmor (complain) on all Linux hosts

* security: bind aquamarine metrics exporters to loopback

* security: restrict k3s kubeconfig file mode to 600

* security: disable SSH X11 forwarding on servers, keep on desktops

* security: add conservative systemd hardening to aquamarine services

* docs(apparmor): correct FHS-alias comment (nixpkgs has no broad FHS layer)

nixpkgs only creates /run/current-system, /usr/bin/env and /bin/sh; it does not
provide a broad FHS->store alias tree, so FHS-oriented abstractions are incomplete
on NixOS. They are safe only because the profiles run in complain mode.

* fix(aquamarine): scrape same-host exporters over loopback

The v2ray/postgres/sftpgo exporters were bound to 127.0.0.1 but VictoriaMetrics
scraped them via the host's routable IP, so those scrapes refused connections.
Point the three same-host scrape targets at 127.0.0.1 (VM runs on the same host).
node-exporter keeps the host IP since it binds 0.0.0.0.

* Revert "security: add conservative systemd hardening to aquamarine services"

This reverts commit f9cf99dadb.
2026-08-27 00:13:01 +08:00
..
2026-03-19 22:25:48 +08:00
2026-06-01 10:02:49 +08:00
2024-07-31 17:09:20 +08:00
2026-06-01 10:02:49 +08:00
2026-06-01 10:02:49 +08:00

Idols - Aquamarine

Storage, operation and maintenance related services are running on this host:

  1. Storage such as git server, file server/browser, torrent downloader,, etc.
  2. Backup or sync my personal data to cloud or NAS.
    • For safety, those data should be encrypted before sending to the cloud or my NAS.
  3. Collect and monitor the metrics/logs of my homelab.

Features

Services:

  1. prometheus + alertmanager + grafana + loki: Monitor the metrics/logs of my homelab.
  2. restic: Backup my personal data to cloud or NAS.
  3. synthing: Sync file between android/macbook/PC and NAS.
  4. gitea: Self-hosted git service.
  5. sftpgo: SFTP server.
  6. transmission & AriaNg: Torrent downloader and HTTP downloader
  7. alist/filebrower: File browser for local/SMB/Cloud

All the services assumes a reverse proxy to be setup in the front, they are all listening on localhost, and a caddy service is listening on the local network interface and proxy the requests to the services.