fix(deploy): nginx 关闭 /flowable/ 公网直通(安全评审 Critical#1)+A10加固backlog

flowable-service:8089 无鉴权,裸 proxy_pass 对外会绕过网关超管门匿名部署/覆盖生产BPMN。
前端只经 /api/workflow/ 网关访问流程能力,/flowable/ 改 return 404。
High#2/Medium#3-4 等 A10 生产加固项记入计划 backlog(超管信任模型内可接受)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 16:26:12 +08:00
parent a5e2540c8f
commit 36aa94db7d
2 changed files with 14 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
# EIP4 单源托管(A10 W3)。挂载为 nginx:alpine 的 /etc/nginx/conf.d/default.conf。 # EIP4 单源托管(A10 W3)。挂载为 nginx:alpine 的 /etc/nginx/conf.d/default.conf。
# 一个源:静态 SPA(eip4-web/dist)+ 反代 /api→platform-app、/flowable→flowable-service。 # 一个源:静态 SPA(eip4-web/dist)+ 反代 /api→platform-app(唯一后端入口)。
# flowable-service:8089 无鉴权,绝不经 nginx 对外(见下 /flowable/ 说明)。
# 消除 dev 的 vite proxy 依赖;切流灰度(W6)可在此用 upstream 权重双跑(eip3↔eip4)。 # 消除 dev 的 vite proxy 依赖;切流灰度(W6)可在此用 upstream 权重双跑(eip3↔eip4)。
server { server {
listen 80; listen 80;
@@ -22,12 +23,14 @@ server {
proxy_read_timeout 130s; # 略大于 statement_timeout(120s),避免反代先于 DB 超时切断 proxy_read_timeout 130s; # 略大于 statement_timeout(120s),避免反代先于 DB 超时切断
} }
# 工作流引擎(按需直达;多数流程经 platform-app 网关,故默认收窄) # 🔴 工作流引擎(flowable-service:8089)绝不对外暴露。
# flowable-service 进程无 Spring Security,鉴权唯一落点=platform-app 网关的超管门
# (ProcessModelerController.requireSuperAdmin);裸直达 8089 会绕过所有鉴权,
# 匿名即可部署/覆盖生产 BPMN、办结/终止任意任务(安全评审 Critical#1)。
# 前端只经 /api/workflow/*(网关)访问流程能力,不需要 /flowable/ 直达。
# 若确需内网调试直达,改为 `internal;` 仅供内部子请求,严禁对公网 proxy_pass。
location /flowable/ { location /flowable/ {
proxy_pass http://flowable-service:8089/; return 404;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} }
# 静态资源:带 hash 的构建产物可长缓存 # 静态资源:带 hash 的构建产物可长缓存

View File

@@ -357,6 +357,11 @@ commit:`test(modeler): 流程Modeler live e2e(改存量/新建/走查 3 场景
--- ---
## B3 最终安全对抗评审(2026-07-02 阶段4)——1 Critical 已修 + A10 生产加固 backlog
- **✅ Critical#1 已修**:`deploy/nginx.conf` 的 `/flowable/` 裸 proxy 到无鉴权 8089 对公网暴露→绕过网关超管门匿名部署/覆盖生产 BPMN。改 `return 404`(前端只走 `/api/workflow/` 网关,不需要直达)。**注:此洞在 A10 部署骨架里、生产未切流,非 B3 运行时可达**;网关侧超管门本身实现严密无绕过面(评审确认)。
- **A10 生产加固 backlog(非 B3 dev 阻塞,超管信任模型内可接受,随 A10 生产化做)**:High#2 部署 BPMN 可含 serviceTask/JUEL 表达式/监听器=引擎内表达式求值面(超管信任内可接受;修 #1 后降为加固项,v2 可加可执行元素白名单);Medium#3 网关→flowable-service 无凭据纯靠网络隔离(加 X-Internal-Auth 共享密钥纵深);Medium#4 审计只覆盖网关 deploy 路径+写失败静默(下沉审计到 flowable-service 实际部署点或加失败告警)。Low#5(无细粒度流程授权=v1有意)/#6(伪造metaInfo不提权=超管本可写任意key)/#7(impact 缺 DOCTYPE 兜底=enableSafeBpmnXml 已挡)/#8(disableSchemaValidation 只跳 XSD 不开 DTD) 均已缓解/可接受。
## 已知限制 / v2 精化点(2026-07-02 阶段4 e2e 发现) ## 已知限制 / v2 精化点(2026-07-02 阶段4 e2e 发现)
- **会签办理人 content 为空的语义缺口**:ModelSemanticValidator 校验 `items 非空`(数组长度)但不校验 candidate item 的 `content 非空`。会签模板出厂 items=[{type:user,content:""}] 过语义门,但运行期 multiInstanceUsersHandler 解析空 content → MI 跳过 → 流程无任务直接结束。**不硬修**(content 常是 `${APPLYUSERS}` 变量表达式,硬要求非空会误拒合法流程);v2 可考虑「content 空且非变量表达式 → WARNING」。用户新建会签流程须填办理人,否则部署出空转流程。 - **会签办理人 content 为空的语义缺口**:ModelSemanticValidator 校验 `items 非空`(数组长度)但不校验 candidate item 的 `content 非空`。会签模板出厂 items=[{type:user,content:""}] 过语义门,但运行期 multiInstanceUsersHandler 解析空 content → MI 跳过 → 流程无任务直接结束。**不硬修**(content 常是 `${APPLYUSERS}` 变量表达式,硬要求非空会误拒合法流程);v2 可考虑「content 空且非变量表达式 → WARNING」。用户新建会签流程须填办理人,否则部署出空转流程。