netbird icon indicating copy to clipboard operation
netbird copied to clipboard

Feature Request: remotely (management) initiated debugging/control of clients

Open ecwio opened this issue 1 year ago • 13 comments

Is your feature request related to a problem? Please describe.

I know that is a lot but here are my first thoughts as a new user

I find the debugging process hard because informations are not centralized so I am proposing the following features for debugging within a dedicated page

  • restart client from server
  • update client from server (not sure if possible)
  • get remote client status from within server
  • IOS app needs a status page

The current transition period and current strenghts of each Network methods would also benefit from a Enable/Disable feature on the legacy route system and The new Network system for debugging or other testing purposes for transition so we can enable one or the other at will or both. Currently testing both methods because I still can't get a fully working environment changing from one configuration to another is hard.

Describe alternatives you've considered not sure how we can make an alternative to debugging tools but the enable/disable feature could be replaced by a preset/snapshot system

ecwio avatar Dec 31 '24 21:12 ecwio

One of my biggest wishes would be to update the client/peer from the server or dashboard. I know this feature from Tailscale, where you can update the client in the client overview with a simple button. I have only found the following in the API, but it seems to be only about updating information about the peer: https://docs.netbird.io/ipa/resources/peers#update-a-peer

maxus-git avatar Jan 29 '25 10:01 maxus-git

Also found here: #1793 and #832

maxus-git avatar Jan 29 '25 12:01 maxus-git

+1

M0nk3yOo avatar Feb 14 '25 20:02 M0nk3yOo

+1

d3dx9 avatar Feb 21 '25 09:02 d3dx9

+1

B08Z avatar Mar 24 '25 07:03 B08Z

Just to let you know, I came up with this feature request a few days ago independently of the ticket as it would significantly improve my own technical support role. This isn't much more than an idea at this point, but I will try to make it happen and keep you posted.

nazarewk avatar Mar 24 '25 18:03 nazarewk

Hi. since the use of netbird agents in AWS/GCP/Azure is used as relay agents (agents that publish networks), it would be great if the management can control them:

open a SSH session to the console? power management - reboot, shutdown (via SSH - not via ILO/IDRAC) run remote commands? send a netbird agent upgrade? (bulk option will be great as well) at the moment i have a custom script that asks for a required version and environment (my routing agents are devided per env: Prod, stage, IT, Internal) and do the following:

get a list of all the groups this agent is a member of remove them from all the groups and leaves ONLY the group "all" set up an upgrade script based on agent OS, transfer it via SCP run the script remotely which upgrades the netbird version once the agent is connected back it adds all the previous groups back to the agent so it will publish the routes to clients.

ez1976 avatar Apr 07 '25 10:04 ez1976

Noting down that this feature could help with logs/debug bundle collection for users without administrative privileges on their machines: employees using devices centrally managed by IT departments etc.

nazarewk avatar Apr 18 '25 11:04 nazarewk

Also it would be great if we can force a reconnect of an agent from the console. instead of requesting the users to disconnect and reconnect, it would be great if we can force a reconnection from the console (with a batch select to improve this). so a few thoughts:

  • "reconnect if fail every X minutes" - force a reconnection every 10 minutes for example to eliminate the need to connect manually to each netbird route agent

  • remote commands on agents - reboot / netbird reconnect / upgrade

  • agents with keys - console option with credentials or private SSH key

  • upgrade clients - basically to initiate a download and install based on the OS ( i do this manually from MDM so it shouldn't be that difficult)

ez1976 avatar Apr 18 '25 13:04 ez1976

something to consider when implementing remote debugging features https://github.com/netbirdio/netbird/issues/683

nazarewk avatar Apr 23 '25 18:04 nazarewk

Hi @mlsmaycon, I'd like to pick this up as my first contribution.

Since this bundles several distinct features, I'd suggest splitting it into scoped pieces so each can be reviewed separately:

  1. Remote peer status surfaced through the Management API / dashboard
  2. Management-initiated client restart
  3. Management-initiated client update
  4. iOS status page
  5. Toggle between legacy routes and the Networks routing system for testing

A few of these may overlap with what has shipped since this was opened, so before writing any code I'd like to confirm with the team:

  • Which of these items are still relevant and wanted?
  • Which one would you prioritize as a first slice?
  • Since this touches the Management gRPC/REST surface and daemon IPC, should I write up a short design proposal in Discussions first, per the contributing guide?

Happy to start wherever you point me. Thanks!

0xMudit avatar Aug 24 '26 04:08 0xMudit

Much of this has landed since the issue was opened, so I checked what remains against current main. I'd like to pick up the rest if the scope below works for you.

Already covered

  • Remote debugging info: remote debug bundle jobs (#4592), gated by the peer opt-in --allow-remote-jobs / MDM (#7153), mobile included (#7406). This also covers collecting bundles from users without admin rights on their machine.
  • Remote client update: management-pushed auto-update settings (auto_update_version / auto_update_always).
  • Enable/disable of legacy routes vs Networks: routes, network resources, and network routers each have enabled, and peers have disable_client_routes / disable_server_routes.
  • iOS status page: belongs in netbirdio/ios-client.

Still missing

  1. Live peer status from management, the equivalent of netbird status -d, without collecting a full bundle.
  2. Forcing a peer to reconnect from management.

I'd suggest leaving arbitrary remote commands, reboot/shutdown, and SSH-key console access out of scope. They would give the management server root-level code execution on every peer, which runs against the trust concern in #683, and NetBird SSH already covers interactive access.

Proposal: two new job types on the existing Job framework

The framework already has the pieces this needs: a oneof workload, the opt-in gate, the RemoteJobs permission, and the pending and connected checks.

peer_status job (read-only, first PR)

  • Proto: StatusParameters peer_status = 11 in JobRequest (anonymize, anonymize_level) and StatusResult peer_status = 11 in JobResponse (JobResponse already has a status field). Old clients already answer unknown workloads with "not implemented", and old management ignores the new fields.
  • REST: PeerStatusWorkloadRequest / PeerStatusWorkloadResponse added to the WorkloadRequest / WorkloadResponse oneOf with type: peer_status.
  • Management: JobTypePeerStatus in types/job.go, plus a per-type minimum client version in CreatePeerJob so old peers are rejected up front. Results already persist as JSON on the job row, so I don't expect a migration.
  • Client: a new case in the engine's job handler. It builds the status from the status recorder, converts it through the existing client/status code, applies the bundle anonymizer when requested, and caps the size.

reconnect job (second PR, stacked on the first)

  • Same effect as netbird down && netbird up with the current config. The client replies with success first, then triggers the engine's existing reset path so the daemon's retry loop reconnects.
  • Management already controls the peer's whole network map, so this adds no new capability. It stays behind the same opt-in.

Dashboard support and docs would follow as separate PRs in netbirdio/dashboard and netbirdio/docs.

Questions before I start

  1. Is it fine to narrow this issue to the two missing items above and treat the rest as done?
  2. For the status result, would you prefer the same JSON as netbird status -d --json, which is stable and familiar to users, or a new typed proto message?
  3. Should reconnect sit behind its own permission or opt-in, separate from debug bundles?
  4. @nazarewk, are you still working on this? I don't want to duplicate your work.

pasanchamikara avatar Sep 24 '26 18:09 pasanchamikara

Thanks for the request.

NetBird now tracks feature requests in Discussions, explained in https://github.com/netbirdio/netbird/discussions/6074, so this one is being converted to a discussion in Ideas and Feature Requests. Everything here moves with it, the write up and every comment, and it stays open for votes and replies. Nothing about it is being dismissed.

thomashacker avatar Oct 05 '26 09:10 thomashacker