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。
# 一个源:静态 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)。
server {
listen 80;
@@ -22,12 +23,14 @@ server {
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/ {
proxy_pass http://flowable-service:8089/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
return 404;
}
# 静态资源:带 hash 的构建产物可长缓存