feat: add Venus IPS log query service package#258
Open
cc06 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
接入设备
/log/memorylog/ipslog.php)实现方法
本 service package 封装了 Venustech IPS 的攻击日志查询能力,提供 1 个 gRPC 方法:
QueryIpsLog技术实现要点:
@chaitin-ai/octobus-sdk的defineService封装,运行时模式:long-runningGET /log/memorylog/ipslog.php拉取攻击日志页,按 HTML 表格中带title的日志列解析为结构化entrieslimit参数,对返回条目数做客户端侧截断;<=0表示返回全部解析结果ips_log_filter识别有效页面;设备会话失效时即使返回 200 登录页,也会映射为FAILED_PRECONDITION,避免误判为空结果timeoutMs和skipTlsVerify配置,适配私有化自签证书环境headers),并兼容host/restBaseUrl/baseUrl与cookie/sessionCookie/session_cookie别名错误码映射
INVALID_ARGUMENTPERMISSION_DENIEDFAILED_PRECONDITIONips_log_filter标记)FAILED_PRECONDITIONUNAVAILABLEUNKNOWN测试命令
测试结果
静态校验:
npm run validate -- --service-dir venus__ips✅npm run pack:check✅内网真机联调:
GET /log/memorylog/ipslog.php,使用credentials: include,与当前实现的 Cookie 会话鉴权方式一致ips_log_filter标记,说明当前实现用于区分“有效日志页”和“登录失效页”的判定依据与真机一致名称、源IP、源端口、目的IP、目的端口、协议类型、时间、类型、事件级别、优先级、动作、入侵防御策略ID、发生次数、内容,与当前字段映射一致allpage = 316,确认该接口返回的是设备真实日志列表页name:TCP_可疑行为_安全风险_MYSQL_查询系统变量src_ip:10.40.164.2src_port:60782dst_ip:10.249.184.8dst_port:3883protocol:TCPtime:2026-06-25 17:49:45type:可疑行为severity:中priority:警示action:PASSpolicy_id:1count:1content列在真实页面中通过td title承载长文本内容,当前实现按title提取,可覆盖该字段覆盖场景:
limit截断逻辑rpcdef与 service handler 暴露校验已知限制
Closes #256