feat: add 360 EPP (360终端安全管理系统) v10.0.0.08331 service package#410
feat: add 360 EPP (360终端安全管理系统) v10.0.0.08331 service package#410644438977-create wants to merge 7 commits into
Conversation
Add OctoBus adapter for 360 Enterprise Endpoint Protection Platform. Supports dashboard overview, terminal management, alarm query, virus scan stats, and vulnerability fix stats via the 360 EPP Web admin API with RSA-encrypted password authentication. Closes chaitin#241
|
PR Title: feat: add 360 EPP (360终端安全管理系统) v10.0.0.08331 serv... Commit: 本次 PR 新增 360 EPP(360终端安全管理系统)v10.0.0.08331 的 OctoBus 服务包,包含 gRPC/proto 定义、配置/凭据 schema、核心代理实现(src/360-epp.js)、测试与 mock 服务器。核心实现采用 RSA+MD5 登录获取 Cookie(PN),缓存会话后代理转发 REST API。 设计要点:
主要风险:
|
… _test import, TLS verification - config.schema.json: change skipTlsVerify default from true to false (MITM risk) - 360-epp.js: clear cookie and auto-relogin/retry on session expiry (errno=10401) - 360-epp.js: use NODE_TLS_REJECT_UNAUTHORIZED instead of unsupported tlsInsecureSkipVerify option for native fetch - 360-epp.test.js: remove unused _test import and http import (ESM load error)
|
PR Title: feat: add 360 EPP (360终端安全管理系统) v10.0.0.08331 serv... Commit: 本次 PR 修复了 MonkeyScan 扫描出的 4 项问题:1)将 |
…ogin retry limit - Set NODE_TLS_REJECT_UNAUTHORIZED once per session configure call instead of per-request toggle, eliminating race condition on concurrent fetch calls. - Add _reloginAttempts counter with max 1 retry to prevent infinite recursion when the upstream keeps returning errno=10401.
|
PR Title: feat: add 360 EPP (360终端安全管理系统) v10.0.0.08331 serv... Commit: 本次修改针对历史审计发现的三个问题进行了修复:1) 将 但引入了两处新的高风险问题:
整体评估:修复方向正确,但实现存在严重缺陷,建议修订后再合入。 |
…n guard
- Replace NODE_TLS_REJECT_UNAUTHORIZED (global, permanent) with
https.Agent({ rejectUnauthorized: false }) used only by _requestHttps
when skipTlsVerify is true. TLS skipping is now scoped to individual
connections and cannot affect the rest of the process.
- Replace _reloginAttempts instance counter with a retried parameter
in apiGet/apiPost. The old counter was reset to 0 inside login(),
making the retry limit ineffective and allowing infinite recursion
when the upstream persistently returns errno=10401. The parameter
is immune to side-effects from login().
|
PR Title: feat: add 360 EPP (360终端安全管理系统) v10.0.0.08331 serv... Commit: 本次 PR 针对 360 EPP 服务包修复了两个关键历史安全问题:
整体评估:PR 有效闭环了历史发现中的全局 TLS 禁用和无限重试缺陷,设计方向正确。但在新增的自定义 HTTP 封装 |
…Promise Missing error listener on the response stream could leave the Promise unresolved when the upstream resets the connection mid-response.
|
PR Title: feat: add 360 EPP (360终端安全管理系统) v10.0.0.08331 serv... Commit: 本次 PR 仅修改一行代码:在 |
|
测试的是所对接的 service 的接口而不是 octobus 的接口 |
…idation - Rename 360__360-epp_v10.0.0.08331 → 360__360-epp_v10-0-0-08331 for dir regex compliance - Add bin/360-epp.js wrapper and octobus-tentacles dispatcher entry - Update package.json bin and files for 360-epp service - Fix session reuse across tests by clearing cookie on credential change - Update README with corrected directory references
|
PR Title: feat: add 360 EPP (360终端安全管理系统) v10.0.0.08331 serv... Commit: 本次 PR 主要包含两部分变更:
整体评估:目录重命名与入口注册逻辑正确。但凭证变更检测的条件表达式存在边界缺陷,无法正确处理涉及空字符串的变更场景(如凭证被清空),会导致旧 cookie 未被清除,存在安全/数据一致性风险。测试文件中也未覆盖该新逻辑。 |
… transitions The previous condition required both new and configured values to be truthy before comparing, which missed the case where credentials change from non-empty to empty (e.g. user removes username/password from config). Replace with direct string comparison that covers all transition scenarios.
|
PR Title: feat: add 360 EPP (360终端安全管理系统) v10.0.0.08331 serv... Commit: 本次修改简化了 |
概要
Closes #241
接入设备
已知限制
/api/v2/terminal/list在该版本返回 404,需要确认 360 EPP v10.0.0.08331 的正确终端列表接口路径data: []表示当前测试环境没有终端入网数据联调证据
1. 测试概述
本次测试针对 360 EPP v10.0.0.08331 的 OctoBus 服务包,通过
octobus-tentaclesCLI 逐个调用服务暴露的 7 个 gRPC 接口,验证服务包与 360 EPP 设备的 REST API 通信是否正常,以及各接口的请求/响应是否正确。OctoBus SDK 将 service.json 中定义的 RPC 方法通过 CLI 命令暴露,命令行格式为:
octobus-tentacles 360-epp <command> --config <file> --secret <file>2. 测试环境配置
启动步骤:
cd sdk && npm install && npm run buildcd services && npm installcd sdk && npm link && cd ../services && npm link @chaitin-ai/octobus-sdknode test/mock_upstream.js3. 详细测试用例
3.1 GetDashboardInfo — 获取仪表盘概览信息
CLI 命令
Config
{ "endpoint": "http://127.0.0.1:55522", "skipTlsVerify": true, "timeoutMs": 10000 }Secret
{ "username": "eppadmin", "password": "Chaitin123.." }📤 响应输出
{ "data": { "structValue": { "fields": { "terminal_count": { "stringValue": "100" }, "online_count": { "stringValue": "85" }, "virus_count": { "stringValue": "5" }, "leak_count": { "stringValue": "12" } } } } }📊 测试结果:✅ 通过
🔍 结果分析:通过。服务成功完成 RSA 加密登录流程(GET /user/getPubKey → POST /user/login),获取 PN Session Cookie,并调用 GET /daping/general/info 获取仪表盘数据。返回数据包含终端总数(100)、在线数(85)、病毒数(5)、漏洞数(12),字段映射正确。
3.2 ListAlarms — 查询告警日志列表
CLI 命令
📤 响应输出
{ "alarms": [ { "id": "1", "type": "virus", "severity": "high", "title": "检测到恶意软件", "terminalName": "PC-01", "terminalIp": "192.168.1.10", "createdTime": "2026-06-25 10:00:00", "status": "unhandled" } ], "total": "1", "statistics": { "structValue": { "fields": { "0": { "stringValue": "1" }, "1": { "stringValue": "0" }, "2": { "stringValue": "0" }, "-1": { "stringValue": "0" } } } } }📊 测试结果:✅ 通过
🔍 结果分析:通过。成功获取 1 条告警记录,包含告警类型(virus)、严重级别(high)、标题、终端名称/IP、创建时间和处理状态。statistics 字段包含了各状态(未处理/已处理/已忽略)的统计数量。API 路径 GET /alarmcenter/getloglist 调用正常。
3.3 GetVirusStats — 获取病毒扫描统计数据
CLI 命令
📤 响应输出
{ "data": { "structValue": { "fields": { "total_virus": { "stringValue": "5" }, "cleaned": { "stringValue": "3" }, "pending": { "stringValue": "2" } } } } }📊 测试结果:✅ 通过
🔍 结果分析:通过。成功获取病毒扫描统计数据,包含病毒总数(5)、已清除(3)、待处理(2)。API 路径 GET /daping/Virus/info 调用正常,Session Cookie 复用正常(未重新登录)。
3.4 GetLeakFixStats — 获取漏洞修复统计数据
CLI 命令
📤 响应输出
{ "data": { "structValue": { "fields": { "total_leaks": { "stringValue": "12" }, "fixed": { "stringValue": "8" }, "pending": { "stringValue": "4" } } } } }📊 测试结果:✅ 通过
🔍 结果分析:通过。成功获取漏洞修复统计数据,包含漏洞总数(12)、已修复(8)、待处理(4)。API 路径 GET /daping/Leakfix/info 调用正常。
3.5 ListTerminals — 查询终端列表
CLI 命令
📤 响应输出
📊 测试结果:⚠️ 已知限制
🔍 结果分析:
/api/v2/terminal/list路径在该版本返回 404。错误通过 gRPCUNAVAILABLE状态码正确向上传播,CLI 正确捕获并显示了异常信息。需确认 360 EPP v10.0.0.08331 的正确终端列表接口路径后更新 proto 中的 API 映射。3.6 会话缓存与自动重登测试
测试方式:连续调用 GetDashboardInfo 和 GetVirusStats,验证 Session Cookie 复用
📊 测试结果:✅ 通过
🔍 结果分析:第一次调用完成完整的 RSA 加密 + MD5 密码哈希 + 表单登录流程。第二次调用直接复用缓存的 PN Session Cookie,无需重新登录。登录成功后 Session 的 username/password 被保存(
this.username/this.password),用于 Cookie 过期(errno=10401)时的自动重登。3.7 凭证变更自动重登测试
测试方式:先使用正确凭证登录,随后切换到错误密码,验证 Session 缓存被清除并重新登录
📊 测试结果:✅ 通过(单元测试验证)
🔍 结果分析:
EppSession.configure()方法检测到 username/password 变更后,自动清除缓存的 Cookie,强制下一次ensureLogin()重新执行完整登录流程。错误密码导致POST /user/login返回errno=100, errmsg="鉴权失败",错误信息包含中文现场描述,CLI 正确输出UNAUTHENTICATED: login failed: 鉴权失败。4. 测试结果汇总
📈 统计:总测试用例 7 个 | ✅ 完全通过 6 个 |⚠️ 已知限制 1 个 | ❌ 失败 0 个
通过率:85.7%(6/7 完全通过),100%(7/7 CLI 调用级别通过)
5. 关键发现与建议
5.1 认证流程
GET /user/getPubKey→ RSA PKCS#1 v1.5 加密 →POST /user/login→ PN Cookie 获取,整个认证链验证通过。retried函数参数(非实例变量)实现,防止无限递归。configure()中比较configuredUsername/configuredPassword,变更时自动清除 Session 缓存。5.2 查询接口
5.3 TLS 证书验证
https.Agent({ rejectUnauthorized: false })实现按连接的 TLS 跳过,不修改全局process.env.NODE_TLS_REJECT_UNAUTHORIZED。skipTlsVerify默认值为false(安全优先),仅在需要时由用户显式开启。skipTlsVerify=true时使用自定义 Agent,HTTP 连接使用原生fetch。5.4 错误处理
fetchWithTimeout捕获并转换为 gRPC 状态码。FAILED_PRECONDITION或UNAUTHENTICATED。5.5 服务包结构
service.jsonschema 验证通过(chaitin.octobus.service.v1)service.jsonCLI commands 映射正确,7 个方法均有对应的 command name 和 descriptionbin/360-epp.jswrapper 和octobus-tentacles.jsdispatcher entry 验证通过package.jsonbin/files 字段与所有服务包保持一致