Docker 部署
Panguard 提供 Docker image 和 Compose config,方便容器化部署。這篇涵蓋單容器、完整堆疊 Compose、正式環境強化。前置需求
Docker 快速開始
1
拉 image
2
跑容器
3
確認
Docker Compose:基本(API + Ollama)
這個 config 跑 Panguard API server 搭配本地 Ollama,零成本做 Layer 2 AI 分析。Docker Compose:完整堆疊(Guard + Ollama + Threat Cloud)
跑完整 Panguard 平台,含 Guard 防護和本地 AI。Port 參考
環境變數
Guard Agent
API Server
正式環境強化
Docker Image 安全
正式環境 image 包含:- 多階段 build — build 依賴不會進最終 image
- 非 root 使用者 — 以
panguard(UID 1001)跑 - tini — 正確的 PID 1 信號處理和 zombie process 回收
- 最小套件 — 最終 image 只有
tini和curl
需要的 Capabilities
Guard 回應動作在 Docker 裡要授予這些 capabilities:檢查清單
- 設
NODE_ENV=production(開啟 HSTS、關閉萬用 CORS) - 產生強力密鑰(
openssl rand -hex 32) - 用 TLS 終止(前面放 nginx/Caddy 反向代理)
- 限制 Manager port 的網路存取
- 密鑰用 env file 掛載,不要用行內環境變數
- 用 named volume 做持久化
- 設好容器日誌輪替
日誌位置(容器內)
日誌輪替
ReportAgent 自動處理日誌輪替:備份策略
相關文件
系統服務
不用 Docker,把 Guard 裝成原生 systemd/launchd 服務。
多端點部署
把 Guard agent 連線到集中式 Manager。
Threat Cloud
在 Guard 機群旁邊部署 Threat Cloud。
架構
平台的完整技術架構。