Brain Structural Validation / Validate Markdown Structure & Links (push) Successful in 7s
- Formalize tripartite project organization (guides/, plans/, discussions/) - Localize homelab architectural discussions and restructure dynu-monitor into a trade-off discussion and active Rust daemon plan - Author core operational runbooks: onboarding services, managing secrets/Authelia users, and server maintenance - Rewrite projects/homelab/README with 4-tier architecture, Gitea forge links, open discussions, and active WIP tracking - Standardize subproject nesting under nixos/ and update AGENTS.md conventions
3.6 KiB
3.6 KiB
type, status, project, tags
| type | status | project | tags | ||||
|---|---|---|---|---|---|---|---|
| plan | active | homelab |
|
🛡️ Custom API Security Hardening & Threat Analysis
🎯 Objective
Address identified attack surfaces and implement defense-in-depth hardening across custom microservices and APIs in the homelab ecosystem, specifically the Learning Hub API (learning.roadtotech.me) and the Minecraft Identity Manager Web Admin (minecraft.roadtotech.me).
🔍 Identified Attack Surfaces & Risk Assessment
1. Learning Hub API (homelab-dashboard/learning)
- Endpoint:
https://learning.roadtotech.me/learning-hub:8000 - Risks:
- Unauthenticated Mutating Routes:
POST /api/courses,PUT /api/courses/{id}, andDELETE /api/courses/{id}inapp/routes.pydo not enforce authentication, allowing anyone on the Internet to alter the Turso cloud database. - Overly Permissive CORS:
allow_origins=["*"]allows arbitrary web origins to send requests. - Rate Limiting / DoS: No request throttling or quota enforcement on database writes.
- Unauthenticated Mutating Routes:
2. Minecraft Identity Manager Web Admin (homelab-minecraft/web)
- Endpoint:
https://minecraft.roadtotech.me/minecraft-web-admin:8000 - Risks:
- Fallback JWT Secret: In
docker-compose.yml,JWT_SECRETdefaults to a known hardcoded string ifMINECRAFT_JWT_SECRETis unset, which could permit offline JWT forgery. - Direct SQLite File Concurrency: Web admin shares read/write access to AuthMe's
./data/plugins/AuthMe/authme.dbwhile PaperMC is running. - Password Reset Flooding: Unauthenticated
/api/auth/reset-requestendpoint could be spammed by automated bots without rate limiting.
- Fallback JWT Secret: In
📋 Security Hardening Action Items & Roadmap
Priority 1: High Impact (Authentication & Secret Integrity)
- Enforce Authelia SSO or API Key on Learning Hub API
- Option A: Attach
traefik.http.routers.learning.middlewares=authelia-auth@dockerinhomelab-dashboard/docker-compose.yml. - Option B: Add API Token / Bearer Header dependency for mutating routes in
app/routes.py.
- Option A: Attach
- Fail-Fast on Insecure JWT Secret in Minecraft Web Admin
- Ensure
MINECRAFT_JWT_SECRETis supplied exclusively via SOPS template (/run/secrets/rendered/traefik-deployments.env). - Add startup validation in
web/main.pyto abort immediately ifJWT_SECRETequals the default fallback string.
- Ensure
Priority 2: Medium Impact (Rate Limiting & Ingress Filtering)
- Attach Traefik Rate Limiting Middlewares
- Add
traefik.http.middlewares.learning-ratelimit.ratelimit.average=50to prevent database exhaustion. - Add
traefik.http.middlewares.minecraft-ratelimit.ratelimit.average=30to protect login and reset request endpoints.
- Add
- Restrict CORS in Learning Hub API
- Restrict
allow_originsinapp/main.pyto["https://dashboard.roadtotech.me", "https://learning.roadtotech.me"].
- Restrict
🔒 Implemented Security Hardening History
- Socket Proxy Read-Only Enforcement (
2026-09-04)- Configured
POST=0andDELETE=0ontecnativa/docker-socket-proxyinCore/docker-compose.ymlto prevent arbitrary container creation/destruction fromsocket-net.
- Configured
- Git Tracking Hygiene & Secrets Removal (
2026-09-04)- Removed and ignored
config/authelia/users.ymlfrom~/Core. - Ignored compiled
homelab-dashboard/config/services.yaml. - Verified all database files (
*.db,*.sqlite3),.envfiles, and SSL keys are covered by.gitignore.
- Removed and ignored
- Let's Encrypt DNS-01 Wildcard SSL (
2026-09-04)- Fixed Traefik CLI flags and provisioned valid wildcard certs for
roadtotech.meand*.roadtotech.me.
- Fixed Traefik CLI flags and provisioned valid wildcard certs for