SlaunchX 安全模型
采集实测 2026-08-18。四层: ①无开放入站端口 (只经 Cloudflare 隧道) ②zone WAF (IP 白名单) ③Cloudflare Access (@slaunchx.cc OTP) ④应用自身鉴权 + VPN 隔离。凭据一律指针制。
边界一: Cloudflare 隧道 (无开放端口)
三台机无公网入站端口; 唯一入口是网关 n-00008 的 cloudflared (cf-tunnel, tunnel slaunchx-nginx)。
后端在 VPN 10.8.0.0/24 内。入口清单见 ARCHITECTURE.md。
边界二: zone slaunchx.cc WAF 自定义规则 (实测)
按顺序 (zone eab11956…, phase http_request_firewall_custom):
| # | 动作 | 表达式 | 状态 |
|---|---|---|---|
| 1 | skip | not ip.src in $system_ips and http.host in {system-test, lampay-tenant-test, lampay-consumer-test, vpn, grafana} (.slaunchx.cc) |
enabled |
| 2 | block ("IP Bolck") | not ip.src in $system_ips |
enabled |
| 3 | block | not ip.src in $slaunchx_alpha_api_key_allowlist and host=api-alpha |
disabled |
| 4 | block | not ip.src in $slaunchx_test_api_key_allowlist and host=api-test |
enabled |
- 规则 1 是公开放行白名单: 这 5 个域名跳过后续 (即不受
system_ips限制) —grafana靠 Access 兜底;vpn/system-test/lampay-*-test需公网 webhook/接入而故意放开。 - 规则 2 是主闸门: 非白名单 IP 一律 403。
system_ips (13 个团队出口 IP)
| IP | 归属 (list 注释) |
|---|---|
| 8.210.222.68 | 阿里云-slash |
| 8.217.194.135 | nginx 服务器 |
| 43.162.101.103 | (无注释) |
| 47.96.88.140 | 企业内网 IP-国内 |
| 47.242.79.110 | 香港 VPN (= n-00007 主 VPN 出口, CI runner 出口) |
| 49.51.251.120 | (无注释) |
| 64.186.238.106 | 美国 IP (= org_egress_hubs hub-b DNJ269) |
| 69.63.201.120 | 美国 IP (= hub-business RYL566 / 整宅出口) |
| 74.82.194.15 | BWG-JP |
| 81.181.132.176 | Hubstudio IP |
| 103.117.102.30 | (无注释) |
| 104.194.85.163 | (无注释) |
| 154.12.190.89 | (无注释) |
相关账号级 IP list: org_egress_hubs (hub-a 191.222.214.72 UVP328 / hub-b 64.186.238.106 DNJ269 /
hub-business 69.63.201.120 整宅出口)、system_slaunchx_ip (6)、各环境 *_api_key_allowlist。
边界三: Cloudflare Access (@slaunchx.cc OTP, 8h)
10 个 slaunchx self_hosted 应用挂 Access (清单见 ACCESS.md), 策略 = @slaunchx.cc 企业邮箱一次一码, 会话 8h。
Drone 不挂 Access (机器调用链, 只靠 WAF + Gitea OAuth)。
边界四: 应用鉴权 + VPN 隔离
- 中间件 (Redis/MinIO/RabbitMQ/OpenBao) 绑
127.0.0.1(例外: n-00006 elaypay RabbitMQ 绑 VPN10.8.0.7)。 - 公网到达后仍需各控制台自身登录 (OpenBao token / MinIO root / RabbitMQ admin / Grafana 账号)。
- fail2ban (三机 active), smartd 磁盘 SMART 监控 (n-00007/n-00006 active)。
凭据指针制 (铁律)
- 不在聊天/命令参数/仓库/Issue/日志/临时文件出现明文密钥。
- 取用:
vault --business slaunchx run <应用> -- <命令>(注入 env, 不打印)。 - 应用:
cloudflare-slaunchx-workspace-admin、gitea-slaunchx-admin/-developer、backup-n7-offsite-slaunchx。 - 机上明文只在受控 compose env / OpenBao 中, 路径见
platform/ACCOUNTS.md/platform/CONSOLES.md。
备份加密
- 异地推送前 openssl AES-256 加密; 密钥双份:
vault
backup-n7-offsite-slaunchx/N7_BACKUP_KEY(DR 用) + n-00007 机上/root/.config/n7-backup.key(0400)。 - 接收端 (大脑机) authorized_keys 用
restrict,command="rrsync -wo …"锁死, 任意命令实测被拒。 - 专用 SSH key
/root/.ssh/n7-backup-offsite(仅推送用)。
OpenVPN
- 三套隧道 (slaunchx-vpn / mgmt / mgmt-usa), 每机 openvpn-client + watchdog 保活, vpncentre 集中管理。
- 服务端: hub-a
191.222.214.72(mgmt) / hub-b64.186.238.106(mgmt-usa) / vpn-aliyun47.242.79.110(n-00007 主) — 均在system_ips白名单内。
已知安全/合规注意点
- n-00006 product 数据无备份 (见该机 README), 属可用性风险。
- n-00006
remote-promtail备份日志目标grafana-ai.slaunchx.cc为死链 (已废弃)。 - WAF 规则 2 描述拼写为 "IP Bolck" (无功能影响, 记录以便识别)。