0–5 分钟:映射 trust boundaries
列出 content origins、windows/webviews、bridges、native commands、files、credentials、ports、updater 和 signer。
成功标准每个 privileged hop 都有 owner 和 documented boundary。
桌面运行时安全检查表 · 更新 2026-07-05
面向使用 Tauri、Electron、Pake 式 wrappers、local webviews、privileged IPC、auto-update channels、code signing 和 container-backed local services 的团队安全检查表。
Web 技术构建的 desktop apps 会同时跨越多个 trust boundaries:remote/local web content、renderer 或 webview、privileged native commands、filesystem access、deep links、update channels、signing identities,以及有时存在的 local container services。安全设计必须 review 完整链路,而不能把 desktop shell 当成单纯 packaging 细节。
这份 checklist 连接 RepoDaily 已覆盖的 Tauri、Electron、Pake、Apple container、Podman、Colima 和 Docker Desktop。目标不是宣布某个 runtime 天然更安全,而是要求团队证明 navigation、IPC、permissions、local services、update delivery、signing、secrets、storage 和 rollback 都有明确边界和证据。
RepoDaily 判断
选择能让团队定义并验证最窄实际 privilege boundary 的 runtime。Tauri 要 review capabilities、permissions、command scopes、CSP、plugins、updater 和 signing;Electron 要 review remote-content rules、context isolation、sandboxing、preload bridges、IPC validation、navigation、new-window handling、dependencies、updates 和 signing。对于 wrappers 与 local-service apps,还必须证明加载什么 URL、哪些 origins 能访问本地服务、暴露了哪些 mounts/sockets,以及 compromise 后如何 reset。
| 表面 | 基线规则 | 失败信号 | 保留证据 |
|---|---|---|---|
| Loaded content | 优先 packaged content 或严格 allowlist | 任意 remote origin 可触达 privileged APIs | Origin inventory 与 navigation policy |
| Renderer/webview | 假设 rendered content 可能变成 hostile | Privileged APIs 全局暴露 | Isolation 与 sandbox configuration |
| IPC/native bridge | 暴露 narrow typed operations,不暴露 generic execution | Renderer 可调用 shell、filesystem 或 arbitrary commands | Bridge/API inventory 与 validation tests |
| Permissions | 按 window、feature、command、path、origin 最小授权 | Default-wide capability grants | Capability files、permission diff、owner approval |
| Filesystem | 只允许 user-selected 或 app-owned paths | 可读取 home directory 或整个 workspace | Path scopes 与 denial tests |
| Network/local services | 窄 bind,并给 sensitive local APIs 做 auth | 0.0.0.0、permissive CORS、暴露 daemon socket | Bind address、ports、auth、origin policy |
| Updates | 使用 authenticated update metadata 并准备 rollback | Unsigned artifacts 或 mutable download URLs | Release manifest、signature verification、rollback record |
| Code signing | 保护 signing identities 并验证 release provenance | 共享 unmanaged certificate 或 CI secret sprawl | Signer owner、CI boundary、verification output |
| Secrets and storage | Credentials 不进入 renderer state 与 logs | Tokens 出现在 localStorage、debug logs、crash reports 或 bundled config | Storage map、redaction test、rotation owner |
| Containers and sockets | 把 runtime sockets 与 host mounts 当作 host-level privilege | App 可访问 Docker/Podman socket 或 broad host mounts | Mount/socket inventory 与 least-privilege review |
Beta 分发或启用敏感本地 integration 前先评分。
| 控制项 | 0 分 | 1 分 | 2 分 | Owner 问题 |
|---|---|---|---|---|
| Content boundary | 任意 origin 可加载 | 部分 allowlist | Packaged content 或 strict origin/navigation policy | 哪些 content 能进入 app shell? |
| Privilege bridge | Generic bridge | 部分 wrappers | Narrow typed commands + validation | 最小 privileged API 是什么? |
| Isolation | Renderer 共用 privilege | 部分 isolation | Isolation/sandbox 有 negative tests | Renderer XSS 后会发生什么? |
| Filesystem scope | Broad home access | Feature-level rules | 仅 user-selected/app-owned paths | Compromised view 能读无关文件吗? |
| Update chain | Manual mutable downloads | 仅 signed builds | Signed updates + staged rollout + rollback evidence | Bad update 如何停止和回滚? |
| Local services | Open unauthenticated ports | 仅 loopback | Loopback + auth/origin controls + port inventory | 其他本地进程或 LAN host 能调用吗? |
| Release signing | Unmanaged identity | 有手工文档 | Protected signer + auditable CI/release path | 谁能产出 trusted release? |
| Recovery | 重装就是计划 | 有 cleanup notes | Reset、rotation、rollback、incident owner 都明确 | Compromise 后用户如何恢复? |
可作为 pre-beta 快速 gate;production review 需要更深入。
列出 content origins、windows/webviews、bridges、native commands、files、credentials、ports、updater 和 signer。
成功标准每个 privileged hop 都有 owner 和 documented boundary。
测试 redirects、external links、new windows 和 unapproved origin,确认它们不能继承 privileged APIs。
成功标准Unapproved content 被阻止或在 privileged shell 外打开。
发送 malformed paths、oversized data、unexpected URLs、traversal strings 和 unauthorized command names。
成功标准Privileged handlers 无副作用地拒绝 invalid inputs。
检查 bind scope,并尝试无 auth 和 unapproved origin 调用。
成功标准Sensitive endpoints 不可从 unauthorized local/LAN contexts 访问。
检查 signer ownership、artifact verification、update metadata、staged rollout 和 emergency halt path。
成功标准Forged artifact 或 metadata change 无法成为 trusted update。
演练 downgrade/rollback policy、撤销 test credential、清理 app data,并停止 local services/containers。
成功标准团队可以让 app 和 host 回到 known safe state。
| 场景 | 必需控制 | 停止条件 |
|---|---|---|
| Packaged offline utility | Packaged assets、narrow native bridge、scoped file picker、signed release | 暴露 generic shell 或 home-directory access |
| Remote website wrapper | Strict URL allowlist、navigation/new-window policy、remote content 无 privileged bridge | Auth page 或任意 link 可继承 native privilege |
| Tauri productivity app | Capabilities per window、scoped permissions、CSP、plugin/updater/signing review | 无法解释 broad default capability grants |
| Electron desktop client | Context isolation、sandbox、narrow contextBridge、validated IPC、navigation controls | Renderer 可直接访问 Node 或 generic IPC execution |
| Pake-style internal wrapper | Owned target origin、redirect audit、dedicated storage、minimal native features | Wrapper 指向 third-party/changeable content 却没有 isolation review |
| Desktop app with local API | Loopback bind、authentication、strict origin policy、lifecycle cleanup | Service 可被 LAN 访问或接受 unauthenticated privileged requests |
| Desktop shell controlling containers | 避免 daemon socket、explicit mounts、non-privileged containers、network policy、disposable state | Container socket 或 broad host filesystem 暴露给 compromised UI |
| Auto-updating app | Signed artifacts、authenticated metadata、staged rollout、release owner、rollback | 团队无法快速 halt 或 reverse bad release |
当 remote content、redirects、injected scripts 或 compromised dependencies 能访问 privileged native bridge 时,wrapper 会变成高风险边界。
Generic command execution、shell access、unrestricted filesystem methods 和 unvalidated IPC arguments 会把 renderer compromise 升级为 host compromise。
Capabilities 与 plugin permissions 会随时间变宽,应把 permission diff 当 API surface change review。
即使 runtime 本身安全,弱 update metadata、artifact hosting、signing identities 或 release automation 仍可分发恶意代码。
Loopback services、permissive CORS、predictable tokens、LAN binds 和 unauthenticated WebSockets 可能形成 browser-to-localhost attack path。
Docker/Podman sockets 与 broad host mounts 会抹掉 container-backed desktop architecture 期待的 isolation。
Webview storage、cookies、caches、logs、crash reports、screenshots 和 update artifacts 都可能长期保留 secrets/private data。
紧急 manual downloads 或 downgrade instructions 可能在用户最脆弱时绕开安全 release path。
暴露 selectProjectFolder、exportReport 这类 task operation,而不是 generic readFile、exec 或 shell methods。
Settings、login、content preview 与 privileged administration windows 使用不同 capability profiles。
Native side 的设计要确保 renderer compromise 后仍不能突破 path scopes、调用 arbitrary commands 或伪造 trusted update state。
每个 release 保留 artifact hashes、signing evidence、source revision、build job identity、update manifest、rollout cohort 和 rollback target。
每个 local service 文档化 bind address、port、authentication、allowed origins、request limits、logs、lifecycle 与 cleanup。
优先用 narrow broker/task API,不要把 general container daemon socket 暴露给 desktop UI code。
自动化 denied-navigation、denied-path、malformed-IPC、forged-update、unauthorized-local-service tests。
面向 review desktop web runtimes 团队的简短回答。
不是。两者 architecture 与 controls 不同,但 broad native APIs、untrusted content、misconfigured permissions、弱 update/signing chain 都会让任一 runtime 变得不安全。
假设 rendered web content 可能变成 hostile,并让 privileged bridge 保持 narrow、validated、least-privileged。
当 page 能接触 native privilege 时不能。使用 strict allowlist、控制 navigation/new windows,并把 remote content 与 privileged bridges 分离。
越来越多 desktop tools 用 containers 启动 local databases、browsers、models、workers 和 APIs;host mounts、daemon sockets、ports、credentials 与 volumes 都进入 desktop threat model。
不一定。其他本地进程和 browser-origin attacks 仍可能访问 localhost,因此 sensitive APIs 还需要合适的 auth、origin controls、narrow methods 和 lifecycle cleanup。
Runtime/dependency updates、permission/capability changes、IPC surface、new origins、local ports、signing provenance、update metadata、rollout controls 与 rollback readiness。
Feedback
匿名反馈只用于判断内容是否真正有用。