Skip to content

Browse and edit a Windows device's registry from the website without a remote session - #288

Merged
gccody merged 2 commits into
mainfrom
remote-tools-registry
Nov 11, 2026
Merged

gccody merged 2 commits into
mainfrom
remote-tools-registry

Conversation

@gccody

@gccody gccody commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Builds on #286 (processes and services), which should merge first. Until it does, this diff includes #286's commit. After #286 merges, this branch will be rebased onto main, leaving only the registry commit.

What

A Registry tool for Windows devices beside Processes and Services. It needs no remote session.

  • Browse HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT and HKEY_CURRENT_CONFIG, in the 64-bit view or the 32-bit one (WOW6432Node). A key shows its subkeys and values. The path bar accepts pasted paths, including Regedit's Computer\HKEY_…. A filter narrows the list.
  • Create keys. Delete keys, asking first; a key with subkeys asks to delete the whole tree.
  • Create, edit, rename and delete values of type REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ, REG_DWORD, REG_QWORD (hexadecimal or decimal) and REG_BINARY. Other types are shown in hexadecimal but can't be edited.
  • On macOS and Linux devices the tool shows as unavailable ("Only Windows has a registry."), not hidden. The server answers unsupported without asking those devices.

Design

  • Wire types: crates/protocol-types/src/registry.rs plus seven new ToolOperations, carried by Show and change a device's processes and services from the website without a remote session #286's request/response flow. Server waits, Agent deadlines, busy handling and the per-device bound all work as in Show and change a device's processes and services from the website without a remote session #286.
    • A listing caps each value's data at 2 KB and holds at most 50,000 subkeys and 5,000 values, about 2 MB of JSON. Editing a longer value reads it whole first, up to 256 KB. A larger value can't be edited here.
    • A REG_QWORD travels as a decimal string, since JavaScript can't hold every 64-bit value.
  • Agent (agent/src/remote/tools/registry.rs): Win32 registry calls as SYSTEM, with KEY_WOW64_64KEY or KEY_WOW64_32KEY.
    • Recursive delete uses RegDeleteTreeW, then RegDeleteKeyExW on the key in the chosen view.
    • Windows can't rename a value, so the Agent writes the new name and deletes the old. If the delete fails, it removes the new one.
    • Protected: the keys at the top of every root, and the Agent's own service key in any control set, along with any key above it. Those keys can't be deleted, and the service key's values can't be changed.
    • New error codes: exists and not_empty.
  • Permissions: tools.registry.view and tools.registry.manage, granted to Technician. Every route authorizes through windows_device, which calls Show and change a device's processes and services from the website without a remote session #286's authorized_device, so device authorization still happens in one place.
  • Audit: registry.key.create, registry.key.delete (with recursive), registry.value.set (type, size, created), registry.value.rename and registry.value.delete. Each records the key, view and value name, and the result, including failed and unconfirmed. Never the data written, which may be a secret. Browsing isn't recorded.
  • Website: the registry panel is part of Show and change a device's processes and services from the website without a remote session #286's lazy tools chunk, so the main bundle is unchanged.

Docs: a Registry section in docs/remote-tools.md (behavior, limits, protected keys, audit, routes, wire format), a row and note in platform-parity.md, and the README feature list.

How it was tested

  • cargo test -p meshrmm-server --test registry on SQLite and PostgreSQL, using a stand-in Windows Agent. It covers:
    • every route relayed both ways;
    • permissions for view versus manage;
    • the audit log, including a check that the data written never appears in it;
    • recursive delete getting the long wait;
    • the device's not_found and not_empty;
    • bad paths, names, data and sizes refused without asking the device;
    • a Linux device answered unsupported;
    • timeouts recorded as unconfirmed;
    • offline devices recorded as nothing.
  • The tools, users_and_roles, api_tokens, schema_parity, maintenance_windows and reports tests and the server's unit tests, on both databases.
  • cargo test -p meshrmm-agent registry on Windows against the real registry:
    • every type converted to the registry's bytes and back;
    • HKLM\SOFTWARE listed in both views;
    • the protected keys refused;
    • keys and values of every type created, edited, renamed and deleted inside a throwaway HKCU\Software\MeshRMM-test\… key, which the test deletes afterwards.
  • Linux and macOS Agent builds with clippy -D warnings (zigbuild), and the Linux tools:: tests.
  • npm run verify in dashboard (370 tests, bundle sizes included): path parsing (including HKCU rejected), data formatting, the editor's limits and conversion between bases (64-bit values kept exact), and unavailability on other platforms.

@gccody
gccody force-pushed the remote-tools-registry branch 2 times, most recently from 0222fd1 to d15e9c9 Compare November 11, 2026 22:52
@gccody
gccody enabled auto-merge (squash) November 11, 2026 22:52
@gccody
gccody merged commit d0d6655 into main Nov 11, 2026
9 checks passed
@gccody
gccody deleted the remote-tools-registry branch November 11, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant