platform icon indicating copy to clipboard operation
platform copied to clipboard

feat(dashmate): detect firewall issues during setup

Open pshenmic opened this issue 1 year ago • 4 comments

Expected Behavior

During setup, dashmate should check the availability of the node by probing core p2p port on externalIp.

Current Behavior

If your ufw is enabled and incorrectly configured, your node will start, but will be unable to sync with the quorum which will result in PoSeBan until you figure out whats hapenning

Possible Solution

Probe port via connecting to the tcp port on externalIp

Steps to Reproduce (for bugs)

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop, server, or mobile):
  • Link to your project:

pshenmic avatar Jul 29 '23 07:07 pshenmic

@pshenmic To verify if port is open you need to connect from outside. It's a bad idea to use externalIp since it's open an attack vector to checker. We could use mnwatch to check ports. Do you want to take this one?

shumkov avatar Sep 23 '24 17:09 shumkov

Extra service on mnowatch to verify the IP if submitted. If the IP is matching that which MNOwatch determined, then the port is checked and either OPEN or CLOSED is returned. In case the IP is not matching, no port check is made and the system returns INVALID_IP.

Eg https://mnowatch.org/9999/?validateIp=127.0.0.1

kxcd avatar Sep 27 '24 14:09 kxcd

Cool! @kxcd thank you. I will take this one then.

shumkov avatar Sep 27 '24 15:09 shumkov

I've added validation to the status and doctor commands https://github.com/dashpay/platform/pull/2183. To validate external IP and port during the setup command we need to put more efforts: a TCP server should be started during setup and only then port checker called. So I keep this PR open for now.

shumkov avatar Sep 28 '24 20:09 shumkov