@hanshi-798

Windows Update Reason

OpenClaw tool plugin that explains why Windows updates matter by using Microsoft MSRC CVRF data.

Current version
v1.0.1
code-pluginCommunitysource-linked

Windows Update Reason

这是一个给 OpenClaw 使用的工具插件,用来解释 Windows 更新为什么值得安装。插件会读取 Microsoft Security Response Center(MSRC)的公开 CVRF 数据,按月份、Windows 产品、KB 或 CVE 聚合安全漏洞信息,并返回用户决策所需的摘要。

能做什么

  • 查某个月 Windows 安全更新涉及哪些 CVE。
  • 查某个 KB 对应修复了哪些漏洞。
  • 查某个 CVE 的严重性、CVSS、影响类型、受影响产品和修复链接。
  • 默认只返回 Windows 相关产品,必要时可开启 includeNonWindows 查看 .NET、Azure、Office 等其他 Microsoft 产品。
  • 给出简短建议:Install promptlyEvaluate soonMonitorNo matching update found

数据来源

插件默认访问:

  • https://api.msrc.microsoft.com/cvrf/v3.0/updates
  • https://api.msrc.microsoft.com/cvrf/v3.0/cvrf/{month}
  • https://msrc.microsoft.com/update-guide/vulnerability/{CVE}
  • https://support.microsoft.com/help/{KB}

MSRC 是公开数据源,不需要 API Key。结果仍应作为更新决策参考,最终部署前建议结合资产重要性、业务维护窗口、兼容性测试和组织策略。

OpenClaw 安装

项目已经包含 openclaw.plugin.jsondist/index.jsdist/core.js,可以直接作为本地插件目录使用。

示例:

cd C:\Users\Administrator\Desktop\tool\test
openclaw plugins install .
openclaw plugins enable windows-update-reason

如果你的 OpenClaw CLI 版本使用不同的本地安装命令,请把这个目录作为插件目录导入即可。插件入口是:

dist/index.js

工具名称

windows_update_reason

参数

参数类型必填说明
monthstringMSRC 月份,例如 2026-May。不填时自动取 MSRC 最新安全更新月份。
productstring产品筛选,例如 Windows 11Windows Server 2022
kbstringKB 编号,例如 KB50654265065426
cvestringCVE 编号,例如 CVE-2026-32177
limitnumber最多返回多少条漏洞记录,范围 1 到 50,默认 10。
includeNonWindowsboolean是否包含非 Windows 产品,默认 false

调用示例

查询最新 Windows 安全更新原因:

{
  "limit": 10
}

查询 Windows 11 在 2026 年 5 月的更新原因:

{
  "month": "2026-May",
  "product": "Windows 11",
  "limit": 20
}

查询某个 KB:

{
  "month": "2026-May",
  "kb": "KB5065426",
  "product": "Windows 11"
}

查询某个 CVE:

{
  "month": "2026-May",
  "cve": "CVE-2026-32177",
  "includeNonWindows": true
}

返回结构

插件返回结构化 JSON,主要字段如下:

  • summary.totalMatched:匹配到的漏洞数量。
  • summary.highestSeverity:最高 Microsoft 严重性。
  • summary.highestCvss:最高 CVSS 基础分。
  • summary.recommendation:建议级别。
  • summary.why:为什么给出该建议。
  • vulnerabilities[].cve:CVE 编号。
  • vulnerabilities[].title:漏洞标题。
  • vulnerabilities[].impact:影响类型,例如 Remote Code Execution。
  • vulnerabilities[].remediations:KB、修复链接、固定版本、是否需要重启。
  • vulnerabilities[].decisionReason:面向用户的决策摘要。
  • vulnerabilities[].links:MSRC 和 KB 链接。

本地测试

不需要联网即可运行核心测试:

cd C:\Users\Administrator\Desktop\tool\test
npm test

测试使用 fixtures/msrc-sample.json,覆盖月份选择、KB 归一化、Windows 默认过滤、CVE/产品筛选、严重性排序和建议生成。

编码

项目说明、README、测试夹具和源码均按 UTF-8 保存。

设计说明

核心逻辑在 src/core.tsdist/core.js

  • analyzeWindowsUpdateReason:主分析函数。
  • buildProductMap:从 MSRC ProductTree 建立产品 ID 到产品名称的映射。
  • summarizeVulnerability:提取 CVE、严重性、CVSS、影响、KB、修复链接、是否公开利用等字段。
  • normalizeMonthnormalizeKb:统一用户输入格式。

OpenClaw 入口在 src/index.tsdist/index.js。入口只注册工具,业务逻辑全部委托给核心模块,方便后续维护和测试。

限制

  • 插件解释的是安全更新原因,不会替用户安装或阻止更新。
  • MSRC 数据可能包含非 Windows 产品;默认会过滤,只保留产品名含 Windows 的记录。
  • 某些 KB 可能修复多个产品线,结果需要结合实际系统版本判断是否适用。
  • 若 OpenClaw 所在环境无法访问 api.msrc.microsoft.com,实时查询会失败;离线测试不受影响。

Source and release

Source repository

hanshi-798/openclaw-windows-update-reason

Open repo

Source commit

9d1209d0452a40d8cc6ddc6f4b56f15a6abb6ab7

View commit

Install command

openclaw plugins install clawhub:openclaw-windows-update-reason

Metadata

  • Package: openclaw-windows-update-reason
  • Created: 2026/05/26
  • Updated: 2026/05/26
  • Executes code: Yes
  • Source tag: main

Compatibility

  • Built with OpenClaw: 2026.5.17
  • Plugin API range: >=2026.5.17
  • Tags: latest
  • Files: 12