Just a reminder here that if the attacker gained access to Node-RED, there is a very good chance they then got access to the whole device. Logs will be suspect as will the configuration of the OS.
This is why I've always said that Node-RED should not be installed globally and should always be run under its own, limited user-id.
Hello, I was reading this topic and I have a question...
I'm following Node-REDās security recommendations, especially the part that says the editor should never be exposed directly to the internet.
My setup is as follows: I'm running a minimal Linux-based IIoT edge device, using Docker containers for each service (node-red, postgres, and cloudflared separately). The only service I want to expose externally is the Node-RED Dashboard, and I'm doing that using a Cloudflared Tunnel pointing to http://localhost:1880.
To ensure security, Iāve taken the following measures:
Enabled password authentication on the dashboard using httpNodeAuth;
Completely disabled the editor using disableEditor: true in settings.js;
No open ports are exposed ā only Cloudflared handles external access;
Node-RED is bound to localhost inside the container.
Given this setup ā where the editor is fully disabled and only the dashboard is exposed through a Cloudflared tunnel ā
would this be considered a secure and acceptable way to expose the Node-RED Dashboard?
Or is the VPN-only approach still the only officially recommended method?
This is still not the best approach. If using Cloudflared, use their authentication/authorisation service. You can have up to 50 users on their free tier. Cloudflare have years of hard-won experience securing the Internet.
This also saves you a load of extra work ensuring that the NR auth stays secure and gets regularly updated.
When using Cloudflare Zero Trust, you don't need to disable the editor, just make sure that only people on your local network can access it. Though, of course, if you are running a separate, secure instance of Node-RED then yes, disabling it is good.
So only localhost connected users (e.g. via SSH) could access the editor anyway.
There is no "official" method. Security has too many different and sometimes competing needs. It is what works for you.
But in general, no, the 3rd-party proxy method such as Cloudflare Zero Trust is what I always recommend over other approaches.
Thanks a lot for the detailed explanation.
I'll move forward with Cloudflare Access to handle authentication instead of relying on Node-RED's internal password system.
but unfortunately even if you enable audit for more detailed logs .. you wont have the remote IP there so its not possible to use fail2ban using node-red logs.
You could use a reverse proxy like caddy server or nginx in front of your NR server
and use their more detailed logs to implement the additional fail2ban security (protecting you from brute force attacks) along with node-red's authentication using a strong password.
I'm very sorry, the solution is not mine but hardlib's in post 5. Once again I apologize. I tried to remove the solution mark but it didn't work. I ask the moderators to fix this.
Greetings.