Desktop apps (Electron and Tauri) checklist¶
Copy this list into a pull request, design review or project kickoff and tick what applies. Rules are grouped by level and sorted by score (criteria). Each links to the file that explains it and cites its sources. Automatable names tools that can check the rule in CI (see the file's "How to enforce" section).
Also apply the general checklist.
This file is generated by python3 scripts/rank.py fix from the guidelines. Don't edit it by hand.
Strongly recommended (9–10)¶
-
DESKTOP-1(9) Keep Electron's secure renderer defaults: context isolation, the sandbox andwebSecurityon, and Node.js integration off. Callapp.enableSandbox()so that no window can turn the sandbox off. (specific/desktop) Automatable:app.enableSandbox(). -
DESKTOP-2(9) In Electron preload scripts, expose a narrow API withcontextBridge.exposeInMainWorld: one function per IPC message, usingipcRenderer.invokefor requests. Never exposeipcRendereror itssend,invokeoronmethods, and don't pass the IPC event object to callbacks in the page. (specific/desktop) -
DESKTOP-3(9) In Electron's main process, check the sender of every IPC message, for example the origin ofevent.senderFrame, and validate its arguments before acting on them. (specific/desktop) -
DESKTOP-12(9) Store users' credentials and tokens with Electron's asynchronoussafeStorageAPI, which uses the operating system's cryptography, or in Tauri, for example, with the Stronghold plugin, and never build API keys or other secrets into the app. (specific/desktop)
Recommended (6–8)¶
-
DESKTOP-4(8) Treat the arguments of every Tauri command as untrusted input: deserialize them into specific types, check their values in the command, and enforce your own scopes in the command itself. Keep secrets and as much business logic as you can in the Rust core. (specific/desktop) -
DESKTOP-8(8) Scope every Tauri plugin permission that reaches the system: allow file system access only to the base directories the app needs, such as$APPDATA, with deny scopes for sensitive paths, allow the shell plugin to run only named programs with argument validators, and allow the opener plugin only the URLs and paths it needs. (specific/desktop) -
DESKTOP-9(8) Limit where Electron windows can go: block navigation in awill-navigatehandler unless a parsed URL matches the pages you expect, deny new windows insetWindowOpenHandlerby default, and pass only checked, allowlisted URLs toshell.openExternal. (specific/desktop) -
DESKTOP-13(8) Sign every release in the release pipeline: sign macOS apps with a Developer ID Application certificate and notarize them, and sign Windows executables and installers with one consistent identity, asSTEAM-16describes. (specific/desktop) Automatable: SignToolverify. -
DESKTOP-14(8) Deliver updates only through a signed update mechanism over HTTPS: Electron'sautoUpdater, for example throughupdate-electron-app, in a signed app, or the Tauri updater with its signing key pair. Keep the update signing key in the CI secret store, and never set the Tauri updater'sdangerousInsecureTransportProtocol. (specific/desktop) Automatable: Tauri updater signature check. -
DESKTOP-15(8) Stay on an Electron major that the Electron team still supports, which is one of the latest three, on its latest minor release, and upgrade one major at a time. Update Tauri, the Rust compiler and Node.js just as promptly. (specific/desktop) Automatable: npm audit. -
DESKTOP-5(7) Never block Electron's main process: use the asynchronous versions of Node.js APIs, avoidipcRenderer.sendSyncand@electron/remote, and move CPU-heavy, crash-prone or untrusted work to a worker thread or a utility process. (specific/desktop) -
DESKTOP-6(7) Give every window a Content Security Policy that allows only your own scripts, such asscript-src 'self': in Electron, send it as a header fromsession.webRequest.onHeadersReceived, or in a<meta>tag for pages that can't get headers; in Tauri, setapp.security.cspintauri.conf.json, because Tauri's CSP protection is off until you set it. (specific/desktop) -
DESKTOP-7(7) Grant each Tauri window only the permissions it needs: give windows with different privileges separate capabilities, add a window to several capabilities only if it needs all their permissions, declare your own commands withAppManifest::commandsinbuild.rsso that a window can call them only when a capability allows it, and let only higher-privileged windows create windows. (specific/desktop) -
DESKTOP-10(7) Serve Electron's local pages from a custom protocol withprotocol.handleinstead offile://, and flip the fuses you don't need when packaging, before code signing: turn offRunAsNode,EnableNodeOptionsEnvironmentVariable,EnableNodeCliInspectArgumentsandGrantFileProtocolExtraPrivileges, and turn onEnableEmbeddedAsarIntegrityValidationandOnlyLoadAppFromAsar. (specific/desktop) Automatable: @electron/fuses. -
DESKTOP-11(6) Use Tauri's isolation pattern when the front end has many dependencies or loads third-party content, and keep the isolation application small, with few dependencies and build steps. (specific/desktop) -
DESKTOP-16(6) Run end-to-end tests against the built app, for example with WebdriverIO's Electron or Tauri service, or with Playwright's experimental Electron support, and mock the IPC layer in front-end unit tests, for example with Tauri'smockIPC. (specific/desktop)