-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving automated remote connection via Inspector Protcol #348
Comments
+1 on those requirements. Based on past discussion I also think we need to add some requirements around security as that has been a blocker for using the inspector protocol in the past. I think the concerns expressed were about making a security connection but also around limiting what you can do when connected versus what is available today. |
Agreed, security should be taken into account, but that should be solved on the server/main-process side (and it's probably worth its own issue), otherwise we would still be able to bypass security with a raw websocket client. |
@mmarchini I don't think that can address "limiting what you can do when connected versus what is available today.". That is about reducing available functionality when connecting to the inspector. |
I don't think I agree. Implementing the limitations on the client side means only users using that particular client will be barred from using privileged features on the inspector protocol. Any other clients will be able to bypass it, since the inspector protocol is just an exchange of Websocket messages. If we want to make the inspector protocol more secure, we need to allow the process being debugged to determine which inspector features are allowed and which ones are denied. (maybe we are saying the same thing. Yes, we should be able to connect to a process with limited functionality. But who determines what is limited should not be client, otherwise an attacker would be able to always connect to a process with unlimited access) |
Yes we are saying the same thing. It should be the process that controls what can be used through the inspector protocol. |
|
@gireeshpunathil I think we'd probably have to have a table of what you can do through the inspector and then indicate what should/should not be possible |
It should be configurable in a similar fashion to the restrictions to child process spawning and network access. From what I saw in the Security WG last time I checked there may not be a final decision as to what it's going to be, but I'm bringing it up here because I'd like to suggest it should not be modifiable in runtime by code from node_modules. IMHO, If a restriction to what can be done via inspector was set, it should remain unchanged for the lifetime of the process if it's supposed to be helpful for security. Also, is it ok to put the functionality in node itself? Would calling |
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
Removed stale label as I'm actively working on this and will present in the next WG meeting. |
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
The Inspector Protocol allow us to use tools like V8 CPU Profiler and Heap Snapshots without relying on C++ binding. It also allows us to call those tools remotely, which is useful when running those tools in production via an automated workflow. We can connect to the Inspector Protocol remotely using the following methods:
node inspect host:port
will open a REPL for users to run inspector commandsChrome DevTools
,ndb
, etc. will provide a nice UI1
is not useful for automation, because it doesn't allow users to run scripts (it only works interactively).2
has similar problems (since those are GUI), plus they also enable the Debugger domain by default, which is not desirable in production.3
is the best option for automation, but it requires extra environment setup (installingwebsocat
,ws
. etc) which is not always possible during an outage, for example.I would like to propose an alternative: in core, provide a simple way to interact with the inspector protocol on a remote process with automation scripts. Some implementation examples would be:
node inspect
instead of opening a REPLconnectToRemoteHost
method or with a newRemoteSession
class)node diagnostics --cpu-profile --pid $(pgrep node)
Personally, I think the
2
option would be the most flexible and useful for our users, but I want to hear what other members of the WG thing.Overall, I'm trying to ensure we can trigger those tools given the following constraints (which are common in enterprise environment):
The text was updated successfully, but these errors were encountered: