Commit Graph

66 Commits

Author SHA1 Message Date
Robert
5935747902 Security fixes 2026-05-04 23:20:57 -04:00
Robert
9ae0f6ad62 Submodule update 2026-05-04 23:20:03 -04:00
1673a56439 feat: add WireGuard VPN stack
- Add vpn stack to services.dockerStacks
- Open UDP port 51820 for WireGuard protocol
- Update compose submodule to include vpn stack
2026-05-04 22:49:06 +00:00
4cceab05d0 Merge pull request 'security: harden lazyworkhorse with firewall, fail2ban, SSH hardening' (#28) from feature/server-hardening-clean into master
Reviewed-on: #28
2026-05-03 09:11:56 +00:00
bcebf18676 fix: move filter into jail settings (NixOS submodule doesn't pass string filters) 2026-05-01 11:59:33 +00:00
0370d784a0 fix: http-botsearch logpath must be string, not list 2026-05-01 04:02:06 +00:00
260b2d2756 fix: restructure fail2ban jails per NixOS module - recidive in jails, settings attr, str bantime 2026-05-01 03:59:32 +00:00
2477acdfc7 fix: services.fail2ban top-level options - no findtime, maxretry lowercase 2026-05-01 03:57:21 +00:00
81c25d3f20 fix: use security.auditd instead of services.auditd 2026-05-01 03:55:09 +00:00
9b1f467db9 fix: remove invalid networking.firewall.defaultAllow option 2026-05-01 03:52:57 +00:00
65fa778b2b fix: add custom traefik fail2ban filters for http-auth and http-botsearch jails 2026-05-01 03:40:59 +00:00
5d3bbe99f3 chore: update compose submodule for traefik access logs 2026-05-01 03:33:34 +00:00
Robert
bcf5cadaa0 olllama template fix to remove currenttime 2026-04-30 21:54:47 -04:00
3e04ccc1e8 security: remove deployment commands from ai-worker sudo rules
ai-worker only needs security audit commands, not deployment access.

Removed:
- nh os switch
- nixos-rebuild switch

Kept:
- Firewall checks (iptables)
- Fail2ban status
- Log inspection (journalctl)
- SSH config (sshd -T)
- Docker service checks
- Network diagnostics
2026-04-30 17:46:39 +00:00
21bd4bb283 security: add restricted sudo for ai-worker with security audit commands
- Deployment: nh os switch, nixos-rebuild switch (flake path locked)
- Firewall checks: iptables -L, iptables -S
- Fail2ban: status, banned IPs
- Logs: journalctl for kernel and fail2ban
- SSH config: sshd -T for verification
- Docker: ps, inspect (service health)
- Network: ss -tlnp, /proc/net/tcp

All commands are whitelisted with NOPASSWD.
No shell access, no ALL command - principle of least privilege.
2026-04-30 17:46:39 +00:00
7994aad8d8 security: harden lazyworkhorse with firewall, fail2ban, SSH hardening
- Firewall (default deny):
  - Allow only essential ports: SSH(2424), Gitea(2222), HTTP(80), HTTPS(443)
  - Rate limit SSH (max 4 new connections/60s)
  - Rate limit HTTP/HTTPS (25/minute)
  - Drop invalid packets, log dropped packets

- Fail2ban (auto-ban attackers):
  - SSH jail: 3 strikes = 1 hour ban
  - HTTP auth failures: 5 strikes = 1 hour ban
  - HTTP scanning: 2 strikes = 2 hour ban
  - Recidive jail: repeat offenders = 1 week ban

- SSH hardening:
  - No root login
  - Max 3 auth tries, 5 sessions
  - 30s login grace time
  - No X11/TCP/agent forwarding
  - Verbose logging

- Kernel network hardening:
  - SYN flood protection (syncookies)
  - IP spoofing protection (rp_filter)
  - Disable source routing, redirects
  - Log martian packets
  - Connection tuning for high load

- Audit logging enabled

Ports commented for review (likely internal-only):
- 8000 (Portainer), 4242 (Coms), 5000/8087/8089 (TAK)
2026-04-30 17:46:39 +00:00
7efba3ac5b Compose update 2026-04-27 06:11:34 -04:00
Robert
cf1373cd68 Forced restart for docker services 2026-04-27 06:02:25 -04:00
Robert
bc875ef9fb feat: isolate docker networks and add cyt-pi remote node config
- Refactor all 12 compose stacks to use isolated networks with Traefik as the hub
- Add openclaw-ssh sidecar to ai stack for reverse tunneling (port 2425)
- Add sshnode entrypoint to Traefik configuration
- Add cyt-pi host configuration for Pi Zero 2 W (headless)
- Include kismet and target_detector_cli services for remote Wi-Fi monitoring
- Add reverse SSH tunnel service via autossh
2026-04-06 19:14:57 -04:00
Robert
c579b07843 fix: read gateway token from secret file via bash 2026-04-04 17:49:39 -04:00
Robert
d3f50cdadc fix: always restart node service on exit 2026-04-04 17:43:03 -04:00
Robert
8aa85e62e5 feat: add openclaw CLI to system packages 2026-04-04 17:23:15 -04:00
Robert
b9cf8a47f7 fix: set openclaw secret group to ai-worker 2026-04-04 17:15:24 -04:00
Robert
2e749228bb fix: set correct working directory and create home for ai-worker 2026-04-04 17:07:13 -04:00
Robert
ce20fad4d3 fix: enable flake-self-attrs for lix compatibility 2026-04-04 16:54:10 -04:00
Robert
401b23ce46 feat: add openclaw node service and migrate to lix
- Add headless openclaw node systemd service for host execution
- Migrate from nix to lix package manager
- Permit openclaw-2026.3.12 (insecure package warning)
- Use ai-worker user for node service
2026-04-04 16:26:33 -04:00
13dbf18f67 Progress dump before ai agent 2026-04-04 04:57:47 -04:00
58f7dd65f1 feat(05-01): OpenTAKServer selected for TAK server implementation
- Comprehensive research of TAK-compatible open-source implementations
- Comparison of FreeTAKServer, OpenTAKServer, and TAK Product Center Server
- Selected OpenTAKServer for feature richness and Docker deployment support
- Documented research findings and implementation plan
2026-01-01 18:25:30 -05:00
a4390fabcc Remove Phase 5 (TAK Server Integration) from roadmap 2026-01-01 16:03:49 -05:00
bb40ded253 feat(04-02): Web search capabilities through MCP servers tested and integrated 2026-01-01 14:38:30 -05:00
0845262c05 style: format Nix files after modifications 2026-01-01 14:32:17 -05:00
b59f8952ac feat(4-2): Test and document web search capabilities through MCP servers
- Started OpenCode service and verified it's running
- Tested Context7 web search functionality
- Tested DuckDuckGo web search functionality
- Documented web search integration in open_code_server.nix
- Updated ROADMAP and STATE with completion status
- Phase 4 complete, ready for Phase 5: TAK Server Integration
2026-01-01 14:30:42 -05:00
515fe8a830 chore: update roadmap with Phase 4.1 for commit organization 2026-01-01 02:25:46 -05:00
056c39aa71 chore: update flake imports and infrastructure secrets 2026-01-01 02:25:40 -05:00
71dfd04108 chore: add n8n-worker user and update authentication configuration 2026-01-01 02:25:34 -05:00
d92e1426ba chore: update service modules and remove deprecated systemd services 2026-01-01 02:25:25 -05:00
9531bff929 chore: enhance system configuration with hardware sensors, GPU support, and security 2026-01-01 02:25:11 -05:00
0b4e9e092d chore: add docker stack integration with improved service management 2026-01-01 02:25:05 -05:00
46ac5a72d0 docs: finalize roadmap - removed phase 4, focus on MCP and TAK
Phases 1-3 complete.

Phase 4 removed per request.

New focus:
4. Internet Access & MCP - web access via MCP server
5. TAK Server Integration - TAK server Docker integration
2026-01-01 02:07:22 -05:00
b77de4e384 docs: update roadmap - completed phases 1-3, added phases 4-6
Phases 1-3 complete - foundation, Docker integration, and AI assistant ready.

New phases:
4. Advanced Monitoring - service health and logging
5. Internet Access & MCP - web access via MCP server
6. TAK Server Integration - add TAK server to infrastructure

Dropped 04-01 (auto Docker Compose detection) per user request.
2026-01-01 02:03:55 -05:00
85fd05c6cf docs: initialize NixOS Infrastructure with AI Assistant (4 phases)
Reproducible NixOS infrastructure with Docker service management and AI assistant integration.

Phases:
1. Foundation Setup: Core NixOS configuration with flakes
2. Docker Service Integration: Docker Compose integration and Traefik proxy
3. AI Assistant Integration: OpenCode AI assistant for infrastructure management
4. Automation & Monitoring: Service detection and health monitoring
2026-01-01 01:47:43 -05:00
b54760f62b docs: initialize NixOS infrastructure with AI assistant
Creates PROJECT.md with vision and requirements.
Creates config.json with interactive workflow mode.
2026-01-01 01:36:58 -05:00
1210a44ecc Commented graphic drivers. longer janitor time. 2025-12-27 17:17:16 -05:00
e2b040e5f0 Simpler path copy for compose files 2025-12-27 17:14:22 -05:00
f5b3a04378 Added amd driver, rocm 2025-08-31 20:23:43 -04:00
a4c5a10c4f Forgot these.. 2025-08-31 16:52:04 -04:00
b8a8e1bdce Still trying to fix secret keys... 2025-08-31 16:50:26 -04:00
40a48eb605 Rekey the secret 2025-08-31 16:30:07 -04:00
266f563c2f Fixed host ssh key 2025-08-31 16:19:39 -04:00
a49c4f40e5 Merge branch 'master' of ssh://code.lazyworkhorse.net:2222/gortium/infra 2025-08-24 19:33:44 -04:00