this post was submitted on 11 Apr 2024
18 points (95.0% liked)

Selfhosted

40198 readers
517 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

In my home network, I'm currently hosting a public facing service and a number of private services (on their own subdomain resolved on my local DNS), all behind a reverse proxy acting as a "bouncer" that serves the public service on a subdomain on a port forward.

I am in the process of moving the network behind a hardware firewall and separating the network out and would like to move the reverse proxy into its own VLAN (DMZ). My initial plan was to host reverse proxy + authentication service in a VM in the DMZ, with firewall allow rules only port 80 to the services on my LAN and everything else blocked.

On closer look, this now seems like a single point of failure that could expose private services if something goes wrong with the reverse proxy. Alternatively, I could have a reverse proxy in the DMZ only for the public service and another reverse proxy on the LAN for internal services.

What is everyone doing in this situation? What are best practices? Thanks a bunch, as always!

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 0 points 7 months ago (1 children)

Double NIC on the proxy. One in each VLAN.

[–] [email protected] 1 points 7 months ago (2 children)

One proxy with two NICs downstream? Does that solve the "single point of failure" risk or am I being overly cautious?

Plus, the internal and external services are running on the same box. Is that where my real problem lies?

[–] [email protected] 3 points 7 months ago (1 children)

Are you running redundant routers, connections, ISPs...etc? Compromise is part of the design process. If you have resiliency requirements redundancy will help, but it ratchets up complexity and cost.

Security has the same kinds of compromises. I prefer to build security from the network up, leveraging tools like VLANs to start building the moat. Realistically, your reverse proxy is likely battle tested if it's configured correctly and updated. It'll probably be the most secure component in your stack. If that's configured correctly and gets popped, half the Internet is already a wasteland.

If you're running containers, yeah technically there are escape vectors, but again your attacker would need to pop the proxy software. It'd probably be way easier to go after the apps themselves.

Do something like this with NICs on each subnet:

DMZ VLAN <-> Proxy <-> Services VLAN

[–] [email protected] 3 points 7 months ago* (last edited 7 months ago) (1 children)

Right, I could have been more precise. I'm talking about security risk, not resilience or uptime.

"It’ll probably be the most secure component in your stack." That is a fair point.

So, one port-forward to the proxy, and the proxy reaching into both VLANs as required, is what you're saying. Thanks for the help!

[–] [email protected] 1 points 7 months ago (1 children)

It depends on the trade-offs you want to make. If you want to maintain one less Nginx install with a little more risk, that's a way to go.

If your priority is security, use a separate proxy for your private services and do allow your public VLAN access into your private VLAN.

My home network only has public services on it right now, but now you are making me think I should segment it further if I want to host any truly private services there.

[–] [email protected] 1 points 7 months ago

The answer seems to always be "not segmented enough". ;)

[–] [email protected] 2 points 7 months ago (1 children)

Plus, the internal and external services are running on the same box. Is that where my real problem lies?

It's one of them, yes.

If you want to limit exposure in the case of a compromise you need to put everything public facing in it's own vlan that cannot initiate traffic into your lan.

[–] [email protected] 1 points 7 months ago

Haha, why do I even ask.