ismartcoding / plain-app

PlainApp is an open-source application that allows you to manage your phone through a web browser. Access files, videos, music, contacts, sms, calls, and more from your desktop using a secure, easy to use web interface!
https://docs.plain.icu
GNU Affero General Public License v3.0
2.15k stars 113 forks source link

Auth/networking designed to isolate access to proxied connections #151

Open snydergd opened 4 months ago

snydergd commented 4 months ago

Is your feature request related to a problem? Please describe. I'm using FRP to expose plainapp behind transparernt authentication middleware (similar to Vouch/OAuth2-Proxy with nginx), which creates quite a nice access control for the app.

I'm having trouble finding a way to restrict access to PlainApp to just connections coming through my proxy.

PlainApp binding on localhost/127.0.0.1 would work just fine, and because of this, I don't want it binding on other addresses, since I don't have a need and makes some risk. People accessing PlainApp from my network in this case is unwanted. From what I can tell, the access controls also require user interaction and couldn't be bypassed in the proxy scenario with a header or anything like that (passwords are harder to steal if no one ever types them).

Describe the solution you'd like To have localhost as an option in the list of addresses to bind (keeping others on the local network from accessing the app directly), even if other network addresses are available.

Or - allow or require the password to be passed in a header in setups like mine.

Describe alternatives you've considered I thought about having the proxy layer authenticate so the user doesn't have to type the password, even exposing the login form to my local network is more than I really want to do.

ismartcoding commented 4 months ago

You can set a long password in the Password settings. image

snydergd commented 4 months ago

@ismartcoding Thanks for the note. I noticed that, but even with the long password there are a couple challenges behind the proxy. Here is my explanation of those:

I hope that makes sense - happy to explain more. Thanks for taking a look.

ismartcoding commented 4 months ago

I believe you are requesting a whitelist feature, where only IP addresses listed in the whitelist would be granted access to the PlainApp webpage.

snydergd commented 4 months ago

@ismartcoding That would be one way to address it, and if I could tell it to bind on localhost/127.0.0.1 instead of the LAN or carrier IPs, it would essentially be a simple version of that on most devices.

However, having an option/switch to say "Require in auth header" for the password would be the overall better option if choosing one or the other.

Both tactics together would provide more benefit, but I would be happy with one or the other.