Skip to content
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

Dropbear: Enable SSH from WAN firewall rule #7138

Closed
wants to merge 4 commits into from

Conversation

stokito
Copy link
Contributor

@stokito stokito commented May 26, 2024

A draft implementation of an easy way to enable the Allow SSH from WAN rule from UI.

The whole idea is to make a Luci GUI wizard to enable WAN access #7137

Luci Dropbear enable WAN screenshot

The key idea is to have a firewall rule pre-defined and the GUI should only enable it.
This is a simplest implementation. It will work only for 22 port.
We may extend it later but it already covers the typical usage.

What is missing: we should show precautions for a users that this is not safe at all.

And same for the uhttpd:

luci uhttpd enable WAN screenshot

Here it may be not enough to just open an access. A user may want to switch IP address of uhttpd. Additionally the rfc1918 filter should be disabled. So I copied them from luci-app-uhttpd.

This needs somehow to be managed in graceful way.

The wan_ssh_allow firewall rule should be pre-configured but disabled by default.
For the main Dropbear instance will be shown an additional flag to enable the rule.
Once the rule is enabled, the only way to disable it is on the Firewall page.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
The wan_https_allow firewall rule should be pre-configured but disabled by default.
For the main uhttpd instance will be shown an additional flag to enable the rule.
Once the rule is enabled, the only way to disable it is on the Firewall page.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
The rfc1918_filter blocks access to Luci from LAN when opening it by a domain which resolves to a public IP.
So we need this option here to uncheck to get access.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
…ptions

A user may want to change the uhttpd port or IP address e.g. set it to 192.168.1.1.
If the user switched to another web server e.g. nginx or lighttpd he may also want to stop the uhttpd.
The settings normally shouldn't be changed, but if a user starts to use a second web server then it will be enough to change only these options.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
@stangri
Copy link
Member

stangri commented May 26, 2024

it already covers the typical usage.

I'm pretty sure the typical usage is to not allow SSH/HTTP/HTTPS on WAN port. Why overload UI (and risk unintentional exposure for newbies) for the very fringe use cases?

@systemcrash
Copy link
Contributor

I'm pretty sure the typical usage is to not allow SSH/HTTP/HTTPS on WAN port. Why overload UI (and risk unintentional exposure for newbies) for the very fringe use cases?

I had the same thought.

@Neustradamus
Copy link

@stokito: It is needed to have 2 separate rules, one for HTTP and another one for HTTPS.
It must be possible to enable HTTPS and not HTTP.

In more, it is important to choice an external port (to have not default 80/443/22):

  • HTTP
  • HTTPS
  • SSH

@stokito
Copy link
Contributor Author

stokito commented Aug 30, 2024

HTTP may be needed for LetsEncrypt webroot challenge. The HTTP/S should be in a one rule.

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.

4 participants