跳到正文
DEV Community· Christian Anderson·· 2 小時前AI 評分42

warden:5 分鐘用示範資料設定家用實驗室安全控制台

Set up warden in 5 minutes: try my homelab security console on demo data

AI 導讀

warden 提供以示範資料設定家用實驗室安全控制台的教學,5 分鐘內即可試用,無須連接任何設備。它會讀取日誌、掃描設備並提出封鎖及修補建議,但不會自行執行;每項操作均須用戶批准。warden 亦提供 REST API 和 MCP 端點,MCP 工具僅供讀取。

正文

Cover image for Set up warden in 5 minutes: try my homelab security console on demo data

Christian Anderson

warden is my in-house security console: it reads the logs, scans the machines, and proposes bans and patches that I approve with a ✅ in Discord. It never does anything on its own.

The usual problem with a tool like this is you have to wire it to everything before you can see if you even like it. So the setup guide starts with demo data. Five minutes, nothing to connect.

The guide is tested too. A GitHub job pulls the commands out of docs/SETUP.md and runs them on a fresh Ubuntu machine every week.

warden's demo steps on a fresh GitHub runner: demo data, a user, the sign-in redirect, the REST summary and the setup check

Get it

Linux with systemd and Python 3. Tested on Ubuntu 24.04 and Debian 13.

sudo apt install python3-yaml python3-requests nmap
sudo git clone https://github.com/casareanderson/warden.git /opt/warden
sudo chown -R "$USER" /opt/warden && cd /opt/warden

Look before you wire anything

export WARDEN_DATA=/tmp/warden-demo
python3 tools/demo.py
./warden-setup user add demo --role admin
python3 warden-ui.py

Open http://127.0.0.1:8792 and sign in as demo with the one-time password it printed. You'll be asked to pick your own.

It also has a REST API and an MCP endpoint, so an AI agent can ask it "anything dodgy last night?". Mint a token and try it:

TOKEN=$(./warden-setup token try-it | head -1)
curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:8792/api/v1/summary

You get JSON with "mode": "detect-only" and the headline counts. Every MCP tool is read-only, and a test enforces that: an agent can ask, it can't ban or patch anything.

Then the real install

./warden-setup init                  # asks about your estate, alerts and machines
./warden-setup check --hosts         # ✓ / ✗ / ○ for every feature
sudo ./warden-setup units --install  # only turns on the timers you need

check is the bit I like. It asks the running system what actually works, and tells you what to do about each ✗. It exits 1 while anything required is missing, so it works in a script too.

What CI can't prove

Everything after the demo. init asks you questions, and the real install talks to your own machines, logs and Cloudflare account, so the weekly run stops at "the example config loads and the checks run". The guide says that next to each step.

Full guide: github.com/casareanderson/warden/blob/main/docs/SETUP.md

What would you want a homelab security console to tell you first thing in the morning?


🤖 Drafted with AI assistance from my own homelab notes, logs and repos, then reviewed and edited before publishing.

來源:DEV Community · dev.to