Files
blackbird/docs/security/DEPLOY_SECURITY_AUDIT_20260801.md
T
qing a7a78d1424 docs: aggregate project documentation under docs/ with unified index
- Move all per-module security audit reports to docs/security/
- Move code review logs to docs/reviews/, analysis reports to docs/reports/
- Add docs/INDEX.md as single entry point for all project documentation
- Add documentation management conventions section to README.md
- Clean up empty per-module docs/ directories
2026-08-03 13:21:48 +08:00

79 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 部署配置安全审计报告
**审计日期**: 2026-08-01
**审计范围**: `docker-compose.yml`、`docker.sh`、`_inst.sh`、`_setup.*.sh`、`.env.example`
**代码版本**: dev_qing 分支
---
## 修复进度
| 优先级 | 总数 | 已修复 | 待修复 |
|--------|------|--------|--------|
| P0 | 1 | 0 | 1 |
| P1 | 2 | 0 | 2 |
| P2 | 3 | 0 | 3 |
---
## 🔴 P0 — 严重问题
### P0-1: WAF 规则默认全部注释,WAF 形同虚设
- **位置**: `waf/rules/local/custom.conf`
- **问题**: 所有 WAF 安全规则默认被注释掉:
```
# SecRule ... SQL 注入规则...
# SecRule ... XSS 规则...
```
部署后 WAF 实际不拦截任何攻击,恶意请求直接透传到后端
- **修复建议**:
1. 启用核心规则集(SQLi、XSS、命令注入等关键规则)
2. docker.sh 启动时检测规则是否启用,若全注释则打印警告
3. 异常模式先运行一周,观察误报后切换到拦截模式
---
## 🟠 P1 — 高危问题
| # | 问题 | 位置 | 说明 |
|---|------|------|------|
| P1-1 | 默认密钥/密码需检查 | `.env.example`、各 `_set.sh` | 确认没有硬编码的默认数据库密码、API Key |
| P1-2 | Docker 容器权限过高 | `docker-compose.yml` | 检查是否使用 `--privileged`、是否挂载了敏感目录(`/etc`、`/root`) |
---
## 🟡 P2 — 中危问题
| # | 问题 |
|---|------|
| P2-1 | Docker 镜像未指定非 root 用户运行 |
| P2-2 | 没有健康检查配置,异常服务不会自动重启 |
| P2-3 | 数据库文件/配置文件未配置定期备份 |
---
## ✅ 已有安全机制
1. ✅ **端口绑定限制**: 内部服务(db、confs、smtp、captcha、pymsg 服务)均绑定 `127.0.0.1`,不对外暴露
2. ✅ **Docker Compose 编排**: 容器化部署,环境一致性
3. ✅ **.env.example 模板**: 环境变量配置模板,不硬编码密钥
4. ✅ **独立 Docker 网络**: 服务间通过内部网络通信
5. ✅ **waf 前置**: 所有公网流量先经过 WAF 再到 gateway
---
## 修复路线图
### 立即(24小时)
- [ ] 启用 WAF 核心规则(关键攻击类型)
### 短期(72小时)
- [ ] 检查所有默认密码/密钥
- [ ] 容器非 root 用户运行
- [ ] 移除不必要的 privileged 权限
### 中期
- [ ] 添加健康检查配置
- [ ] 自动备份策略
- [ ] Docker 镜像安全扫描