Files
wecom_it_smart_desk/docs/10-任务说明/P1-01-IP白名单收窄.md
T

70 lines
1.5 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.
# P1-01: IP 白名单收窄
## 任务概述
| 项目 | 内容 |
|------|------|
| 需求ID | #48 |
| 优先级 | P1 |
| 状态 | 待网络组确认 |
| 预估工时 | 1h |
## 背景
当前 `/api/admin/``/itadmin/` 的 Nginx 配置临时设置为 `allow 0.0.0.0/0`,存在安全风险。需要收窄到真实业务 IP 段。
## 阻塞条件
**需网络组确认真实代理 IP 段**
- WAF 出口 IP
- 堡垒机出口 IP
- CDN 出口 IP(如有)
## 技术方案
### 1. Nginx 配置修改
```nginx
# 修改 /etc/nginx/conf.d/admin-*.conf
location /api/admin/ {
# 允许的 IP 段(网络组确认后填入)
allow 10.0.0.0/8;
allow 172.16.0.0/12;
# deny all 放在最后
deny all;
proxy_pass http://backend_api;
# ... 其他配置
}
```
### 2. 测试验证
- 本地 curl 测试不同 IP 访问
- 确认白名单内 IP 正常访问
- 确认白名单外 IP 返回 403
## 验收标准
- [ ] 获取网络组提供的 IP 段清单
- [ ] Nginx 配置已更新为指定 IP 段
- [ ] 白名单内 IP 可正常访问 `/api/admin/``/itadmin/`
- [ ] 白名单外 IP 返回 403 Forbidden
- [ ] 文档已更新
## 文件清单
| 文件 | 操作 |
|------|------|
| `/etc/nginx/conf.d/admin-backend.conf` | 修改 |
| `/etc/nginx/conf.d/admin-frontend.conf` | 修改 |
| 部署运维文档 | 更新 |
## 实施步骤
1. 提交工单给网络组,确认业务 IP 段
2. 收到回复后更新 Nginx 配置
3. `nginx -t && nginx -s reload`
4. 测试验证
5. 更新文档