Files
wms-saas/docs/12-security-audit.md
T
2026-09-29 13:08:21 +08:00

52 lines
1.0 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.
# 12 日志、审计与安全
## 日志和审计
必须考虑:
- 登录日志
- 操作日志
- API 日志
- 库存变更日志
- 订单状态变更日志
- 入库状态变更
- 出库状态变更
- 用户权限变更
库存、订单等重要数据的关键变更必须能够追踪:
| 字段 | 含义 |
| --- | --- |
| 谁 | 操作用户 / 系统任务 |
| 什么时候 | 操作时间 |
| 做了什么 | 操作类型 |
| 修改前 | 变更前数据 |
| 修改后 | 变更后数据 |
| 来源 IP | 请求 IP |
| 请求 ID | 全链路请求标识 |
## 安全要求
必须考虑:
- SQL Injection
- XSS
- CSRF
- API Authentication
- API Authorization
- Rate Limit
- Tenant Isolation
- 文件上传安全
- Webhook 签名
- 密钥加密
- 敏感信息保护
- 日志脱敏
## 密钥管理
任何第三方 API Token、Secret:**禁止直接写入 Git。**
- 使用 `.env`(不提交)与 `.env.example`(仅占位)。
- 租户级第三方凭证在数据库中加密存储。
- 日志中不得输出 Token、密码、完整地址电话等敏感信息。