Well, the jolly ol' man has arrived and now we're on the verge of a brand-new year. If it is one thing I am thankful for this year is the ability to have patience, especially in this latest segment of my home lab! Why you may ask? Well, let's start from December 27th to now so I can lay down what happened....
It was a cold December afternoon and I was getting ready to put together my brand new server rack given to me by my lovely wife Tamara Pryor. As I was doing so, I shut down the Proxmox VM that was running my cyber range with no problems, as well as the server itself. All was hunky-dory, as I begin building and installing my server rack ensuring that everything was in place and done properly. It wasn't until I plugged the sucker back in that I realized something was off....
It was at this exact moment that my heart sank into my stomach, as I realized that weeks worth of effort was now gone. I looked in my backups, checked my checkpoints, even tried to see if maybe perhaps the .VHDX was moved by some Christmas miracle- no dice. At this point, I felt my blood pressure start to go up and my watch told me to do some breathing exercises. This did not happen. I had no other choice to rebuild my ENTIRE cyber range from scratch. So now, you get to see what has been done since the last post!
Using Pomerium for an Access Proxy
The first thing I did after getting my Proxmox VM with the essentials from my last post back online was getting Pomerium up and running as well. For those of you who do not know what Pomerium is, the Pomerium service is an access proxy that allows for you to be able to authenticate users and give them access to on-premise services that would traditionally require a VPN. Because I don't want to give users VPN access, I wanted an open-source way that a user can authenticate with Entra and then access a portal with the things they need. Enter: Pomerium!
Pomerium comes as a docker image that can be installed onto any machine that supports docker. In this case I installed it onto a Ubuntu Server VM with the following commands:
Install Docker
This will allow you to install the dependencies required to use the docker image:
sudo apt update
sudo apt install -y docker.io docker-compose git
sudo systemctl enable docker --nowCreate the Pomerium directory
Now, create your Pomerium directory that the docker image will go into:
mkdir -p ~/pomerium
cd ~/pomeriumCreate your DOCKER-COMPOSE.YAML file
This is what docker will use to pull what it needs from Pomerium to run it locally:
version: "3.8"
services:
pomerium:
image: pomerium/pomerium:latest
container_name: pomerium
volumes:
- ./config.yaml:/pomerium/config.yaml:ro
- ./certs:/pomerium/certs:ro
ports:
- "443:443"
restart: unless-stoppedCreate an Entra App Registration (for Pomerium Authenticate)
In the Azure Portal:
- Go to Microsoft Entra ID
- Select App registrations
- Click New registration
- Name it: Pomerium Authenticate
- Supported account types: Accounts in this organizational directory only
- Redirect URI (Web): https://authenticate.domain.com/oauth2/callback
- Ensure that you set the API permissions to allow for: openid, email, profile, and offline_access. Grant admin consent.
Create a new subdirectory called CONFIG
In this subdirectory, we'll add the configuration file we need so that Pomerium knows where to authenticate and redirect:
mkdir configCreate your CONFIG.YAML file
The CONFIG.YAML file contains the information from your app registration
address: ":443"
insecure_server: false
authenticate_service_url: "https://authenticate.domain.com"
authorize_service_url: "https://authorize.domain.com"
idp_provider: "azure"
idp_client_id: "YOUR_ENTRA_CLIENT_ID"
idp_client_secret: "YOUR_ENTRA_CLIENT_SECRET"
idp_tenant: "YOUR_TENANT_ID"
routes:
- from: <insert URL here>
to: <insert URL here>
tls_skip_verify: true
allow_public_unauthenticated_access: falseBuild and Test
Finally, we can begin the build! If all goes well, you should be able to navigate to the destination you placed in the routes section of the CONFIG.YAML file. If not however, try running the build again with debugging enabled to see if there are any snags:
cd ~/pomerium
sudo docker-compose up -dThe end result will allow the user to sign-in using your custom domain and bring them to the login portal for Microsoft Online (which authenticates them against your app registration):
Custom HTML Landing Page in Pomerium
I ran a daemon in the background on my Pomerium server to host an HTTP server that can be connected to using Pomerium. The reasoning for this was because I didn't want users navigating to the Proxmox server web GUI directly- rather, I wanted to make an interface of my own that will give them some preset options that I specify:
The other reason for this is for security. I want to prevent as much lateral movement as possible, so this creates a layer of protection as it gives users only one way to access the interfaces they require. If they try to access the interfaces outside of the portal, they will not be able to, requiring them to use the portal each time. This is especially effective because I can also monitor who is using what and adjust the tools based on what users are utilizing the most.
The Big Lesson
In the end of it all, I learned something very valuable; shutting down gracefully isn't always graceful. If you're going to take ANYTHING offline, make sure that you backup what you can. Or, you can end up like me scrambling to fix what I broke. Nonetheless, the next portion is getting the SIEMs up and running, isolation from the rest of the network now that I have a switch that can do VLAN tagging, and then creating our first NPC's with GHOSTS.
Until next time folks, here's a full picture of my homelab (now in it's rack)!