A series on building a company's IT with containers and open source
When I made the rule "every app signs in through Keycloak", I thought it was an integration task. It turned out to be a selection process. Something between a job interview and a reality TV show, where apps get voted off the island.
Over a few months it removed more apps than any other reason. Every time, the lab got better.
Free software first
Before the SSO test, there's an even earlier filter, and it's a personal one.
I've been a member of the Free Software Foundation for a while. My rule for Inner Bits is: free software wherever possible, and pay only when there's genuinely no alternative. That's not a purity contest (the host runs Windows, I've made my peace with that in post 1). It's a practical choice:
- You can read the code, fix it, and keep running it when the vendor changes its mind.
- Your data sits in formats and databases you control.
- It's what makes "accessible to anyone" actually accessible. A per-seat licence is a gate. Free software isn't.
So every app in the lab starts as a free software (or free community edition) candidate. Then it has to survive the SSO test.
The graveyard
From the Git history, a moment of silence for the fallen:
| Was | Replaced by | Cause of death |
|---|---|---|
| WordPress | Drupal | Got hacked shortly after installation. Drupal was the natural next stop |
| Splunk Free | Loki + Grafana | Splunk Free has no authentication and no alerting. Also, not free software |
| Greenbone / OpenVAS | netscan (Nmap + Nuclei) |
No SSO, and ~57 GB of volumes |
| ONLYOFFICE | Euro-Office | Other vendors are dropping ONLYOFFICE for Euro-Office; I followed the crowd for once |
| SQL Server | nothing | Pure Microsoft-guy reflex. Completely useless here: nothing in the lab needed it |
| Dremio | Trino + Superset | Wanted Keycloak-native data tools |
| phpLDAPadmin, then LDAP Account Manager | nothing | LDAP itself was retired |
| phpMyAdmin and pgAdmin | DbGate | Two tools, two logins, one of them with no login at all |
WordPress deserves a moment of its own. It went in, and very shortly afterwards somebody else had let themselves in too. In my defence, it's the most attacked CMS on the planet, and bots start probing a fresh install before you've even picked a theme. It didn't get a second chance, and Drupal was the natural replacement: it installs itself from the command line, signs in through Keycloak, and its installer and update scripts are blocked from the internet by the Traefik rules in post 3. Lesson learned: never expose a half-configured app to the internet, not even "just for a minute".
Each one was days or weeks of work. None of it was wasted. Living with an app for a while is the fastest way to know exactly what you need from its replacement.
The interview questions
The rule began as "does it support SSO?". It's grown into a short interview:
- Does the free edition do OIDC or SAML? Many vendors keep SSO for the enterprise tier: the infamous "SSO tax". This rejected DefectDojo (its open-source version has no SSO at all) and CloudBeaver (OIDC is Enterprise-only) before they ever got a container.
- Can a group become a role? Apps that read a
groupsclaim makelab-adminsmean something. Apps that don't need manual grants, and manual grants drift. - Can I configure it from a script? API, CLI or config file. If setup is only a web wizard, every rebuild needs me sitting in front of it, clicking "Next" like it's 2003.
- Is it one or two containers? Not a hard rule. But a ten-container app had better be worth ten containers.
- Is the image maintained? Some images on Docker Hub haven't been rebuilt in a year and carry more CVEs than features. The scanner from post 9 is very good at finding these.
When SSO is paywalled: the gate
Some apps ace everything except question 1. Plane, the project-management tool, is a great Community Edition, but its OIDC is a paid feature.
But Plane CE does support "Sign in with GitLab". And GitLab signs in through Keycloak. So:
browser ──> oauth2-proxy gate (Keycloak, lab-users) ──> Plane
──> "Continue with GitLab" ──> GitLab ──> already signed in via Keycloak
One password, one MFA prompt, and nothing touches Plane's login page without going through Keycloak first. Is it a Rube Goldberg machine? A little. Does it work every time? Yes. A setup script creates the GitLab OAuth app and Plane's settings, so a rebuild still needs zero clicks.
Plane also gave me one of the lab's funniest bugs. Its bundled web server applies a per-IP rate limit. Behind Traefik on Docker Desktop, every browser in the world arrives from the same NAT address. So the entire world shared one rate limit, and everyone got HTTP 429 after a few clicks. The fix was my own copy of its Caddy config without that limit, and a note in the handbook to check it after every upgrade.
Never settle
Here's a personality trait my colleagues already know about: I'm never quite happy with "it works". If a tool works but there's a better one out there, I'll find it, usually around midnight, and the old one's days are numbered.
In a VM world, that habit is expensive. Swapping an app means a new VM, a migration and a weekend. In a Compose file, it's a new service block, a sign-in script and a push. Containers made my restlessness affordable. (Whether that's a good thing is a question for my free time to answer.)
Four upgrades I'm especially pleased with:
phpMyAdmin + pgAdmin → DbGate. For months the lab had two database admin tools: phpMyAdmin for MariaDB and pgAdmin for PostgreSQL. Two UIs, two sets of habits, two sign-in stories. pgAdmin did OIDC fine. phpMyAdmin has no SSO at all, so it lived behind an oauth2-proxy gate and then opened MariaDB with no login of its own. Worse, it also listened on a local port with no login whatsoever. My security scanner raised an eyebrow. I raised two.
DbGate replaced both on the same day. One web UI for MariaDB and PostgreSQL, signing in with Keycloak natively, letting only lab-admins in. The connections are predefined in the Compose file, so nobody can add new ones from the UI, and it publishes no port at all: Traefik is the only way in. I looked at CloudBeaver first, and it fell at question 1: OIDC is Enterprise-only. Two tools out, one in, and one fewer open door. That's my favourite kind of maths.
Splunk → Loki + Grafana. Splunk was in the lab out of pure day-job habit. It's a brilliant search engine, and I know my way around it. But Splunk Free has no authentication and no alerting, and it isn't free software. Loki stores logs, Alloy ships them, and I read them in Grafana, behind Keycloak, right next to the metrics and dashboards. Less powerful search, much better fit. (Post 8 has the details.)
Dremio → Trino + Superset. I wanted SQL across all the company's data (Zabbix alerts, Matomo visits, LiteLLM usage, iTop tickets) in one place. Dremio did it, but didn't fit the identity model. So it became two tools, each better at its own job. Trino is the query engine and signs in through Keycloak, even for JDBC clients (they pop open a browser to log in, which still feels like magic). Superset does the dashboards and queries Trino as the signed-in person, so access rules apply per user. Both are admins-only, every data source is read-only, and the finance department of Inner Bits (me) is thrilled.
Greenbone → netscan. Greenbone is the open-source vulnerability scanner. It's also enormous, has its own user database with no SSO, and keeps its reports in yet another web UI. I replaced it with a small container that runs Nmap (with CVE matching) and Nuclei on a schedule and sends results to Loki. They show up in Grafana, behind Keycloak, next to everything else. Smaller, more useful, one less password. (Post 9 has the details.)
And the biggest swap of all wasn't an app: it was the directory. The road from LDAP to Keycloak only is in post 5.
Notice the pattern? Every swap ended with fewer logins, fewer open ports, and more of it in one place. That's not a coincidence. That's the SSO test doing its job.
The cast that made it
Inner Bits is meant to look like a real company, so here's who survived, by department:
- Everyone: mail and webmail (Stalwart, Roundcube), files, chat, video and documents (Nextcloud with Talk and Euro-Office), XMPP chat (Prosody), intranet (HumHub), mailing lists (Sympa), an AI assistant (Open WebUI)
- Marketing and web: Drupal, Matomo, LimeSurvey
- Sales: EspoCRM
- HR and training: Moodle
- Projects: Plane
- Engineering: GitLab, SonarQube, n8n
- Finance and management: Trino and Superset over everything
- IT: iTop as service desk and CMDB (Zabbix opens tickets in it automatically), Zabbix, Grafana, Prometheus, Loki, Technitium DNS, DbGate, and the security scanners
Does a home lab need all of this? Absolutely not. Does a company? Yes. And every one of them taught me something about how that kind of software plugs in, which is the whole point.
The lesson for the day job
The SSO tax is real, and it shapes architecture far more than vendors admit. When an app's identity story doesn't fit, the workarounds (gates, shared accounts, manual grants) become the most fragile part of the system.
Asking "how does it sign in?" before "what can it do?" would have saved me a lot of installs I later deleted. I'm going to start asking it earlier at work too. Procurement is going to love me.
Next: how a git push becomes a deployment on a Windows desktop, and what Windows Update thinks about that.
Read next: Company in a Box, Part 7 of 11: Every Git push is a deployment
Comments
Post a Comment