this post was submitted on 28 Oct 2023
1 points (100.0% liked)

Homelab

827 readers
1 users here now

Rules

founded 2 years ago
MODERATORS
 

I love my homelab, and the more I tune things the more satisfaction I have. I tolerated the "Your connection is not private" for my self-signed SSL certs on my services for way too long.

I just setup NGINX Proxy Manager as a LXC on my Proxmox Server and pointed a subdomain I own to the server. Now I have custom domains for each service along with valid SSL Certificates. It's all local without exposing anything to the outside world. It's very satisfying. I tried explaining what I was doing to my GF but she could care less ¯\_(ツ)_/¯

Followed this video from Wolfgang's Channel YouTube (great channel btw), the first minute does a better job explaining the setup. I always thought I would have to setup a local CA which is more work than I was interested in, but this approach was much simpler (and free!).

top 47 comments
sorted by: hot top controversial new old
[–] broxamson@alien.top 1 points 2 years ago

Hey babe love how our http communications are secure locally now. Blow job and a back rub?

[–] Large_Yams@alien.top 1 points 2 years ago

Next step, CloudFlare proxy so you don't leak your IP when accessing services.

And you can more safely host more public things like blogs.

[–] MrExCEO@alien.top 1 points 2 years ago

When we were dating many years ago, my wife asked about some network concepts. I took it upon myself to draw out a network infrastructure on the white paper sheet covering the table. It was big with details. WTF was I thinking. She was a Dev so I wanted to flex. I think it worked 🤣

[–] kaiwulf@alien.top 1 points 2 years ago

But, setting up your own offline root and intermediate issuing CAs is so much fun!

I too like my websites and web-based consoles to not pop up the https warning, so good on ya for getting that going

All my network devices have role based access via AD, and run through a RADIUS server. Most of my devices talk PEAP-MS-CHAPv2 for RADIUS auth, in a server per service environment like I have where the NPS server is separate from the DCs, a RAS & IAS cert on the NPS server is required for that communication.

[–] invalidmemory@alien.top 1 points 2 years ago

This is like seeking appreciation for breathing.

[–] robomagician@alien.top 1 points 2 years ago

I am using caddy, which I thought was a one stop shop, but I’m getting errors for the certain trusted by my antivirus.

[–] FenixVale@alien.top 1 points 2 years ago (1 children)

I wont appreciate you, because SSL certs stop being used years ago. TLS however...

[–] wb6vpm@alien.top 2 points 2 years ago

While pedantically true, it’s still referred to as a SSL certificate in common usage.

[–] dgfrench@alien.top 1 points 2 years ago

10 points for the subject lmfao I’ll go read now .. go easy on the gf, she probably rambles about makeup or skin care or something that makes your eyes gloss over

[–] Couch941@alien.top 1 points 2 years ago

I wanted to do that aswell but was too stupid to figure out how. Guess I will give it another shor

[–] rlesath@alien.top 1 points 2 years ago
[–] light2089@alien.top 1 points 2 years ago

Congrats! Good job!

I have had local SSL and in house DNS servers for many years now, and I feel you because my wife couldn't care less.

She does find it annoying and confusing when we are traveling and the bedroom light doesn't switch off by itself 🤷 - our home is fully automated as well

[–] DaGhostDS@alien.top 1 points 2 years ago

Oh thanks for that, that was one of my next project, as I don't like unencrypted packets going out through Tailgate to my phone (or worse my GF phone) for my Home Assistant setup..

It's funny how most of questions are either already answered or get answered when I'm about to search. xD

[–] ItsANoBrainerGG@alien.top 1 points 2 years ago

I got this working as well and am super happy with it! I do have a few small issues though.

I have setup a wildcard cert to *.mydomain.dev pointing to my IP. Anyone can ping any of the subdomains and get my true IP because this setup requires me to have cloudflare setup dns only and if I set it to proxied, it doesn't work.

The second issue I have is some of my applications are not too happy with the setup on https. CasaOS will fail to load the login page unless I clear the cache every time. Pterodactyl won't let anyone externally get to a few of the pages. And a few more here and there I can't remember.

I've followed this nginx proxy manager tutorial and a couple others to get it working to where it's at now, but I can't for the life of me figure out my above issues with my knowledge and experience.

If anyone has any knowledge or resources for these issues please let me know as I've wanted to fix this for a while.

[–] miseur_meeseeks@alien.top 1 points 2 years ago (1 children)

Interesting. I'm a noob - can you tell us if there were any complications or workarounds that the video didn't cover?

[–] -my_reddit_username-@alien.top 1 points 2 years ago

There was actually, cloudflare seemed to not like 2nd level subdomains. So using a wildcard cert for *.foo.bar.com didn't work for the setup as described in the video, but *.bar.com did.

The other thing was just specific to some of the services I use, like proxmox needed specific NGINX config that I mentioned in this comment. That was it really! DNS and NGINX isn't that foreign to me so I was comfortable, but it was pretty simple IMO. Give it a shot!

[–] theykk@alien.top 1 points 2 years ago (1 children)
[–] -my_reddit_username-@alien.top 1 points 2 years ago

That was the route I always thought I had to go, but it's quite a bit more work/config. One day!

[–] hadrabap@alien.top 0 points 2 years ago (1 children)

Welcome to the TLS family! I personally run my own CA, but the end result is the same. 🙂 Welcome and enjoy! 😛

[–] bobbyorlando@alien.top 0 points 2 years ago (1 children)

Hiw can i set this up? Is it hard?

[–] hadrabap@alien.top 0 points 2 years ago (4 children)

No, it is not so difficult. But you need a bit of planning.

First of all, you need a way to distribute your ROOT certificate to your clients. That's more a question of automation.

Second, you need to prepare the topology with certain rules. Things like dedicated certificates for people (identity), services (server certificates for dedicated subdomains), machine clients (for mTLS and zero-trust), infrastructure stuff like BMC/IPMI, UPS, routers...

Basically, the rules are:

  1. Self signed ROOT certificate
  2. Intermediate CA (signing certificate)
  3. (Optional) signing certificate

In case of multiple (dedicated) certificates, you want to make the split at the intermediate/signing level. The chain will help you enforce the rules.

You should decide which algorithm to use (RSA vs. ECC).

Finally, you need a piece of software that will create and sign the certificates for you. This software must authenticate you and check your request if it comforms to the rules above.

I'm using multiple instances of step-ca. Most of the famous certificate management solutions (the service side asking your authority for a certificate, including rekeying/renewal) support it. Which is good. Standard protocols are always better than in-house ~solutions~ workarounds.

To start building your CA:

  1. Learn about PKI (good start is RFC-5280
  2. Learn OpenSSL, how to deal with openssl.conf, sections, ASN.1
  3. If you need additional information on the certificate, register for your own Private Enterprise Number. Do not abuse existing attributes!
  4. Prepare HTTP (plain HTTP, no TLS) server to serve your intermediate/signing certificates (for AIA protocol) and CRL (for validation)
  5. Put your intermediate/signing key/certificate to step-ca as a ROOT and you're good to go.

You can also incorporate HSM if you have one. Just configure its pkcs11 module in the OpenSSL and in the step-ca.

As it is quite a complex topic, feel free to drop additional questions. 👍

[–] Simon-RedditAccount@alien.top 1 points 2 years ago

Finally! A ~~worth opponent~~ fellow who also cares about having proper OIDs and AIA :)

[–] EODdoUbleU@alien.top 0 points 2 years ago (1 children)

Prepare HTTP (plain HTTP, no TLS) server to serve your intermediate/signing certificates (for AIA protocol) and CRL (for validation)

Or create a repository on Github, point ca.yourdomain.com to Github Pages and publish there. Doing this solves the PKI chicken-and-egg problem for a homelab and doesn't tie up any resources to serve them.

[–] hadrabap@alien.top 1 points 2 years ago

HTTP! Not HTTPS! No chicken and egg problem here.

[–] steezy280@alien.top 0 points 2 years ago (1 children)

Thank you, I’m actually currently building my CA. Planning for an offline root. Question, what free or not enterprise prices software options are there? I have entrust at work, looking for something I can use at home.

[–] EODdoUbleU@alien.top 0 points 2 years ago (2 children)

For my Root I use OpenSSL with the pkcs11 module to keep the keys on a Yubikey, then I use Step CA as an intermediate/issuing.

[–] Simon-RedditAccount@alien.top 1 points 2 years ago

Planning to use Yubikey for one of my subCAs. Do you know a good writeup on OpenSSL+Yubikeys?

Also, which Yubikey slot do you use for storing the cert/pkey?

[–] hadrabap@alien.top 0 points 2 years ago (1 children)

Ha! You run the same stack as I do. 🙂

[–] Simon-RedditAccount@alien.top 1 points 2 years ago

I asked EODdoUbleU on the parent comment here, but could you please reply to that question as well?

[–] LogosLine@alien.top 0 points 2 years ago (1 children)

"not so difficult"

Well thanks, I feel like a complete moron, because that's a level of complexity way beyond what I could do/manage.

[–] lestrenched@alien.top 1 points 2 years ago

It's a bunch of terms I don't know about, but I don't think it's very hard after you learn a bit more and understand the reasoning behind the steps.

I'd personally not want to host a personal CA without HA though, so I suppose I'm sticking with EFF for this one

[–] PossibleDrive6747@alien.top 0 points 2 years ago (4 children)

Sometimes my wife will ask me to explain technology things in great detail when she's having trouble falling asleep.

[–] dgfrench@alien.top 1 points 2 years ago
[–] ShinyTechThings@alien.top 1 points 2 years ago

Yeah, that's normal. 🤓😎

[–] notdoreen@alien.top 0 points 2 years ago (1 children)

If anyone wants to explain Nginx, reverse proxies and Cloudflare tunnels I'm here for it.

[–] hodak2@alien.top 0 points 2 years ago (1 children)

Think of a reverse proxy as a middle man.

Internet comes in to your internet connection and immediately asks “cool story bro…where do I find XYZ service?”

A reverse proxy works by your modem or router saying “ffs bro I have no idea, all I know is you need to go talk to Apache”

So the internet traffic walks over and says “the modem told me to talk to you about getting to XYZ service?”

Apache goes ahead and responds “dude I got you…that service. It lives over here at 192.168.0.12:1234. In fact let me go get it for you so that you don’t have to go anywhere else. Here’s what you are looking for, you can just go through me and I’ll get you the things you want.”

So the internet traffic continuously goes through Apache, Nginx proxy, traefik etc to get the things it wants and Apache Nginx etc just work as a middle man.

I have a lot of not very good YouTube videos explaining how to reverse proxy from Apache to a bunch of services…unifi proxmox esxi and others. As well as videos explaining how to get star certs setup and things like that.

But in a nutshell. That’s what’s going on.

[–] agentdickgill@alien.top 1 points 2 years ago

I’m gonna get yelled at but… why? What does this do for the network? Does it make it faster? Safer? Just feels like another thing that could break and then the wife breaks me with “it’s not working.”

[–] DecisionDesperate629@alien.top 0 points 2 years ago (1 children)
[–] scsibusfault@alien.top 0 points 2 years ago (1 children)

Sam sounds like a homewrecker

[–] Calm_Space4991@alien.top 1 points 2 years ago

I hear Jodi is worse.

[–] neggleston@alien.top 0 points 2 years ago (1 children)

Well done! You'll celebrate even more if you are using a service like Let's Encrypt and the certificate auto renews without intervention.

[–] -my_reddit_username-@alien.top 1 points 2 years ago

Yup, it's through Let's Encrypt. It was a relatively painless setup. I'm quite pleased.

[–] jaredearle@alien.top 0 points 2 years ago (1 children)

I use HAProxy on pfSense with wildcard LetsEncrypt certs and a firewall rule only to allow connections from the WAN IP Address.

It’s really easy and requires no certificates on the target servers.

[–] CodeTheStars@alien.top 1 points 2 years ago

My setups are similar. HAProxy as an SSL terminator for all domains. Unencrypted proxy to the services after that. Nginx can use v2 proxy which is nice.

I have a bunch of scripts that collect all the domains and then generate / renew the certs with acme.sh . HAProxy can reload certs with no downtime as well.

[–] Tamazin_@alien.top 0 points 2 years ago (1 children)

One day i will take my lazy ass and fix this too. Not today though, but some day!

[–] smooth-dust2254@alien.top 0 points 2 years ago (1 children)

I took the time months ago to setup a wildcart cert with letsencrypt but they’re only good for like 3 months. The first time it expired I was like meh fuck it lol