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

[Feature request] Auth and HTTPS to prevent misuse on peer discovery affecting data provider and monitor #1101

Open
ametial opened this issue Jan 6, 2023 · 2 comments

Comments

@ametial
Copy link

ametial commented Jan 6, 2023

Peer discovery on 3000 can be exploitable if a firewall not properly configured.

Tested on a test machine:


nmap -p3000 -Pn ip5b135217.dynamic.kabel-deutschland.de
Starting Nmap 7.80 ( https://nmap.org ) at 2023-01-06 12:08 CET
Nmap scan report for ip5b135217.dynamic.kabel-deutschland.de (91.61.13.22)
Host is up (0.0028s latency).
PORT     STATE SERVICE
3000/tcp open  ppp

Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds

This exposes data provider's peerId in the wild.

Is it possible to implement SSL encryption at least locally on the docker container and maybe land on a login prompt on the browser rather than directly on the peer discovery?

@krhougs
Copy link
Contributor

krhougs commented Jan 8, 2023

The 3000 port is exposed by the monitor which is listened on 0.0.0.0 by default.

pRB is designed to run in a managed network where the pRB setup is connected within a LAN instead of connected to the internet directly. This makes it safe for components of pRB to use mDNS to discover each other by default within the connected broadcast range.

If you need HTTPS and Basic Auth for the monitor, consider wrapping it with a reverse proxy like Nginx and Caddy.

@ametial ametial changed the title security flaw on peer discovery affecting data provider and monitor [Feature request] security flaw on peer discovery affecting data provider and monitor Jan 8, 2023
@ametial
Copy link
Author

ametial commented Jan 8, 2023

Thanks for the input @krhougs!

I will try to set up a test environment to play around. Indeed, it was more of a "feature request" rather than an issue. So, i tagged it.

After further research and tests, i realized that this behavior is only relevant when independent port forwarding is configured which requires an explicit user intervention on a home router (behind the one set by ISP, which will anyway filter incoming traffic to the NAT IP on port 3000).

Anyway, i will try to play with reverse proxy on a dummy machine.
May I ask you if you can share any considerations or links that you might find useful in this use case?

if it turns succesfull, I will create a wiki on the forum.phala.network for whom is interested.

@ametial ametial changed the title [Feature request] security flaw on peer discovery affecting data provider and monitor [Feature request] Auth and HTTPS to prevent misuse on peer discovery affecting data provider and monitor Jan 8, 2023
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

No branches or pull requests

2 participants