From 4f469c051d49dd6c236f704374ac4a75dc916ed8 Mon Sep 17 00:00:00 2001 From: Architecture Designer Date: Tue, 10 Mar 2026 08:49:46 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9E=B6=E6=9E=84:=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E8=AE=BE=E8=AE=A1=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- architecture/security.md | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 architecture/security.md diff --git a/architecture/security.md b/architecture/security.md new file mode 100644 index 0000000..17d4c97 --- /dev/null +++ b/architecture/security.md @@ -0,0 +1,45 @@ +# 安全设计文档 + +## 认证安全 + +### JWT Token +- 使用 HS256 算法签名 +- Token 有效期: 7 天 +- 存储在客户端 localStorage + +### 密码安全 +- 使用 bcrypt 进行密码哈希 +- 盐值强度: 10 轮 + +## API 安全 + +### 输入验证 +- 所有用户输入进行验证 +- SQL 参数化查询防注入 +- 文件名特殊字符过滤 + +### 权限控制 +- 用户只能访问自己的文件 +- 分享链接验证权限 +- API 请求频率限制 + +## 数据安全 + +### 传输安全 +- HTTPS 强制使用 +- Token 传输使用 Bearer 模式 + +### 存储安全 +- 数据库文件存储在应用目录 +- 建议生产环境使用加密存储 + +## 文件安全 + +### 上传限制 +- 文件大小限制: 100MB +- 文件类型验证 +- 文件名 sanitization + +### 恶意文件 +- 不执行上传文件 +- 文件存储在隔离目录