birdman4512/forensic-claw
GitHub: birdman4512/forensic-claw
基于 OpenClaw 定制的数字取证与应急响应 AI 代理平台,通过 Docker 沙盒化执行辅助安全分析师完成 DFIR 任务。
Stars: 0 | Forks: 0
# OpenClaw Docker 设置
## 文件夹结构
```
.
├── .env ← Your secrets (never commit this)
├── .env.example ← Template – copy and fill in
├── Dockerfile ← Custom image with extra tools installed
├── docker-compose.yml
├── config/ ← OpenClaw config & session data (auto-created)
├── workspace/ ← Agent workspace – files the Claw reads/writes
├── skills/ ← Custom skills loaded by the agent
└── cases/ ← Task / case files handed to the agent
```
## 首次设置
```
# 复制 env 模板并填写你的 secrets
cp .env.example .env
# 创建本地文件夹(Docker 也会创建它们,但这是一个好习惯)
mkdir -p config workspace skills cases
# 构建自定义镜像(安装 Dockerfile 中定义的额外工具)
docker compose build
# 运行 onboarding 向导(设置 provider 密钥、channels 等)
docker compose run --rm openclaw-cli onboard
# 启动 gateway
docker compose up -d openclaw-gateway
```
在浏览器中打开 [http://localhost:18789](http://localhost:18789)。
如果提示需要 token,请使用以下命令获取:
```
docker compose run --rm openclaw-cli dashboard --no-open
```
## 日常使用
```
# 启动
docker compose up -d openclaw-gateway
# 停止
docker compose down
# 查看日志
docker compose logs -f openclaw-gateway
# 仅重启 gateway
docker compose restart openclaw-gateway
# 拉取最新镜像并重新构建
docker compose pull && docker compose build && docker compose up -d
```
## 向镜像中添加工具
编辑 `Dockerfile`,在 `apt-get install` 或 `pip install` 代码块下添加包,然后重新构建:
```
docker compose build
docker compose up -d openclaw-gateway
```
## 启用子代理沙盒
子代理在由网关生成的独立 Docker 容器中运行(Docker-in-Docker)。
1. **查找你的 Docker socket 组 ID**(Linux):
stat -c '%g' /var/run/docker.sock
在安装了 Docker Desktop 的 macOS 上,GID 通常为 `0`。
2. **更新 `.env`**:
OPENCLAW_SANDBOX=1
DOCKER_GID=<步骤 1 中获取的值>
3. **在 `docker-compose.yml` 中取消沙盒相关行的注释**:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
group_add:
- "${DOCKER_GID:-999}"
4. 重新构建并重启:
docker compose build --build-arg OPENCLAW_INSTALL_DOCKER_CLI=1
docker compose up -d openclaw-gateway
然后在你的 OpenClaw 配置文件(`~/.openclaw/config.json` → 映射为 `./config/config.json`)中,启用沙盒:
```
{
"agents": {
"defaults": {
"sandbox": {
"scope": "agent",
"docker": {
"image": "openclaw-custom:latest"
}
}
}
}
}
```
## 存储卷参考
| 主机路径 | 容器路径 | 用途 |
|------------------|---------------------------------------|----------------------------------|
| `./config` | `/home/node/.openclaw` | 配置,会话,记忆 |
| `./workspace` | `/home/node/.openclaw/workspace` | 代理工作区(读/写) |
| `./skills` | `/home/node/.openclaw/skills` | 自定义技能 |
| `./cases` | `/home/node/.openclaw/cases` | 案例 / 任务文件 |
## 常用 CLI 命令
```
# 列出已批准的设备
docker compose run --rm openclaw-cli devices list
# 批准设备配对请求
docker compose run --rm openclaw-cli devices approve
# 获取 dashboard token URL
docker compose run --rm openclaw-cli dashboard --no-open
# Health check
docker compose exec openclaw-gateway node dist/index.js health --token "$OPENCLAW_GATEWAY_TOKEN"
```
标签:Docker, Docker Compose, Docker-in-Docker, LLM安全应用, MITM代理, OpenClaw, Python, SecOps, SOAR, Web截图, 云安全架构, 人工智能体, 子代理, 安全运营, 安全防御评估, 容器化安全工具, 容器安全, 扫描框架, 数字取证, 文档结构分析, 无后门, 沙箱隔离, 网关, 网络安全, 自动化响应, 自动化工具集成, 自动化脚本, 请求拦截, 隐私保护, 靶场环境