Skip to content

AI-Net-Guard v5.9.6

Choose a tag to compare

@github-actions github-actions released this 26 Nov 12:16
· 16 commits to main since this release
a0d8494

AI-Net-Guard v5.9.6 发布说明 (Release Notes)

候选节点按需测速白名单版 (Candidate Node Speed-Test Whitelist):解决开启全盘 DefaultOutbound=Block 后,v2rayN 对订阅里的非活动候选节点测速被防火墙默认拦截、显示为“高延迟/超时”的问题;同时严格保持 fail-closed 安全边界与活动节点单一 /32 主路由不变。


一、主要更新

  1. 按需候选节点伴生白名单(10-sync-node-rule.ps1)
    • 新增 -IncludeAllNodes 与 -ClearCandidateNodes 开关:以只读方式(mode=ro)读取 v2rayN guiConfigs\guiNDB.db 中的候选节点配置,按核心二进制(xray.exe / sing-box.exe / mihomo*.exe 等)与公网候选节点 IP/端口创建专用伴生放行规则 AI-Guard-Allow-Candidates-<Core>-{TCP,UDP},并记录至 backup\candidate-nodes.json。
    • 安全边界不变:默认同步仍仅放行当前活动节点;即使启用 -IncludeAllNodes,也不会扩大通用出站放行,不会对候选节点注入物理网卡批量 /32 静态路由。
  2. 共享校验、物理阻断豁免与状态观测(lib-guard-common.ps1、07-mode.ps1、09-rollback.ps1)
    • 新增 Test-GuardPublicNodeIpv4、Test-GuardPortSpec、Read-GuardCandidateNodes、Write-GuardCandidateNodes 共享校验与持久化函数。
    • 07-mode.ps1 在 Get-FirewallRuleAnalysis 中强制要求 AI-Guard-Allow-Candidates-* 同时绑定 App= 与 RA4=,在 Sync-ForeignPhysicalBlockRule 中豁免已授权的候选节点 IP(防止与 AI-Guard-Block-Foreign-Physical 冲突),并在 -Status 中输出候选节点统计。
    • 09-rollback.ps1 回滚时同步清理 backup\candidate-nodes.json。
  3. 测试门禁扩展(test-stun-ports.ps1)
    • 回归断言从 60 条扩展至 62 条,覆盖候选节点辅助函数与 Sync-ForeignPhysicalBlockRule 豁免行为。

二、验证范围

  • 全仓纯 ASCII & AST:所有 .ps1 脚本 100% 纯 ASCII、0 AST 解析错误;
  • 双引擎单元测试:tests\test-stun-ports.ps1 在 Windows PowerShell 5.1(62/62 PASS) 与 PowerShell 7.7(62/62 PASS) 下全部通过;
  • GUI 构建与附件脱敏扫描:gui\build.ps1 -RunSmokeTest 0 警告 0 错误、8/8 UI 冒烟 PASS;生成的 AI-Net-Guard.exe(含内嵌 payload.zip)与 AI-Net-Guard-portable.zip 经二进制及压缩条目逐项扫描 0 敏感命中。

三、从本地仓库同步到 C:\AI-Net-Guard(管理员 PowerShell 执行)

将 C:\path\to\AI-Net-Guard 替换为你的本地仓库目录后执行:

$ws = "C:\path\to\AI-Net-Guard"; $root = "C:\AI-Net-Guard"; powershell -ExecutionPolicy Bypass -File "$ws\scripts\13-harden-acl.ps1" -Root $root -SyncWorkspace -WorkspaceRoot $ws -SkipVerification; & "$root\scripts\10-sync-node-rule.ps1" -IncludeAllNodes; & "$root\scripts\07-mode.ps1"; & "$root\scripts\12-regression.ps1"