Repository navigation
docs(plugins): align plugin security doc with egress and grant code - #2025
Conversation
The security spec said a bare "*" in net.domains is refused at install and that users can uncheck declared permissions at install. Neither holds: the host-core installer does not read net.domains, so the refusal happens in validateManifest at check and load time, and the installer refuses any grant that omits a declared permission. The panel-session bullet also missed the ui.microphone exception and the per-plugin persisted partition shared by panels and views, and the zh-CN fetch bullet still described a pre-redirect-mode design. Correct those statements in both the English and zh-CN documents. Related to vastsa#2000
vastsa
left a comment
There was a problem hiding this comment.
已独立对照 applyPluginEgressPolicy、pluginSessionPartition、PluginViewHost、parseNetDomains / validateManifest、Rust PluginManifest / installer 和 loadFromPath。麦克风例外、共享持久分区、本地 scheme 放行、裸通配符的校验时机、整体授权及 websocket 引用均符合当前实现,中文 fetch 重定向说明与英文一致,未发现阻塞问题。
最新 main:f0cdf590bb7918d0611e28372196bbb0a6d04888;已验证的 GitHub 合并候选:19231fb5459b41c44bf64f2b80bb17f4f8e689e7。diff --check、base ancestry、86 组中英配对、599 个文档页面、agent-policy sync、VitePress 生产构建及 GitHub Docs checks / Head contains latest base 全部通过。仅文档改动,应用 E2E 不适用。
|
Merged. Thanks! Auditing egress, partition, and sandbox claims against the actual isolation code is the part of #2000 that is easiest to get wrong, and the paired English/Chinese edits kept the gap from widening. This also complemented #2005, which filled the missing Chinese sections in the same file — the two did not collide. |
Related to #2000
P1 第 4 项:
04-plugin-security.md的 sandbox / partition / egress 部分对照实现。只改文档,中英文成对。检查的文档
docs/spec/07-plugins/04-plugin-security.md(重点 §3、§8.0、§8.1、§11)docs/zh-CN/spec/07-plugins/04-plugin-security.md对照的代码
plugin-panel-host.ts、plugin-view-host.tsnet-policy.ts、plugin-websocket.ts、plugin-mcp.tsspawnUtilityProcess、pluginChildEnvloadFromPath已核对一致
contextIsolation: true、nodeIntegration: false、sandbox: true(panel、view);面板setWindowOpenHandler→ deny。utilityProcess,环境变量来自minimalChildEnv,与 §11 第 7 条一致;§11 “Not enforced yet” 中关于 Node 内置模块可达的说明与plugin-host-process.mjs一致。net.anyHost下云元数据主机仍被拒绝(net-policy.ts#L25-L27);MCP 最多 5 跳;websocket 4 个 / 1 MiB。发现与修改
ui.microphone时放行纯音频 media 请求(plugin-panel-host.ts#L140-L153)persist:pi-plugin-<id>,面板窗口与停靠视图共用,都调用applyPluginEgressPolicy;file:/data:/blob:/devtools:/chrome-extension:/主题资源 scheme 直接放行(L70-L77)*is refused at install”parseNetDomains(经validateManifest),即pi-plugin check与宿主 加载时;host-corePluginManifest不读取net,市场安装后在loadFromPath才失败PLUGIN_PERMISSION_DENIED: missing grant for …;无记录授权时 加载取声明集合net.websocketis implemented … (§8.1)”pi.net.fetch仍写“Electron 主进程不提供任何替代的 fetch 服务”redirect: "error" / "manual"模式发现但未在本 PR 处理
验证
git diff --check通过03-plugin-api#网锚点均指向现有章节upstream/mainc85251b