43
submitted 11 months ago by andy47@lemmy.world to c/selfhosted@lemmy.world

I'd like to set up my identity and authentication service for my self hosted applications but it is not a beginner friendly subject.

I'm aware of the various tools available; authentik, authelia, LLDAP, keycloak, etc and see lots of useful discussions on them which is great.

But I can't seem to find a beginner friendly introduction to setting up one or more of these tools that helps me understand the core concepts at the same time. Does such a thing exist?

I'd like to try out LLDAP and Authelia on my home lab and then possibly roll this out to my production services.

But every tutorial I've come across seems to assume a fair amount of knowledge that I don't think I have.

For instance if I deploy LLDAP what should I use as my base DN? And how can I seperate a homelab directory from a seperate production directory?

Any pointers gratefully received.

top 15 comments
sorted by: hot top controversial new old
[-] cooopsspace@infosec.pub 11 points 11 months ago

Simplest would be Authelia and Swag.

Swag comes with prewritten config files and all you really need to do is uncomment a few lines and make sure it's pointed to your service.

Linuxserver.io guides are good for this.

I ended up landing on Keycloak and I believe I set mine up using the ansible script, again it's a matter of plugging in some details.

[-] andy47@lemmy.world 1 points 11 months ago

Thanks for the pointer, I'll check it out. I don't think I've come across SWAG before, and a web search comes up with lots of references to sleeping bags (I'm in Australia - https://outbackreview.com.au/best-swags-australia/). Could you provide pointers and/or a homepage? Thanks in advance.

[-] andy47@lemmy.world 3 points 11 months ago

Ok, I found this - https://www.linuxserver.io/blog/2020-08-26-setting-up-authelia.

Which, if I'm reading it correctly tells me that SWAG (Secure Web Application Gateway) is essentially a web server, reverse proxy with lets encrypt support. It doesn't seem to do any authentication.

Authelia is a component of an identity and authentication solution that provides single sign on and 2FA but, crucially, does not include a user directory, by default it uses a YAML file but can be connected to an LDAP server - https://www.authelia.com/overview/authentication/first-factor/

Which I think goes towards the point in my original post - none of this is simple so I'd like a nice explanation that helps me understand what I need running, how they work together and what settings to use.

[-] cooopsspace@infosec.pub 4 points 11 months ago* (last edited 11 months ago)

You probably need to realise that this is advanced self hosting here.

I might suggest you start off with something a bit simpler.

Run an application, do DNS, point Nginx to it, get certbot and follow the instructions on their site to implement it. Read logs. Update stuff. Break stuff.

You need to build up to it, because Authentication is a compilation of 5-6 different basic tasks that you need to be across. And if you mess up any of them, it won't work and you need to work out why.

[-] andy47@lemmy.world 1 points 11 months ago

Thanks. I have all of that. I've been at this for a while and am now looking to move to centralised authentication and access management because I've got everything else working as I want it. It's just not ideal to have to maintain seperate logins across each of the services that I'm running. Hence starting to look at authentication. I know it's complex and the original post was wondering if there is a nice simple introduction to the subject matter.

[-] cooopsspace@infosec.pub 3 points 11 months ago

Yep if you've got the requisite skills the linuxserver guide is the best for authelia.

I've also ran Keycloak via the red hat documentation.

That's really as easy as it gets..if you want to learn, be prepared to pile through the documentation.

[-] gdog05@lemmy.world 1 points 11 months ago

I think you have to look for nginx in the swag search https://github.com/linuxserver/docker-swag

[-] theghostoutside_@aussie.zone 1 points 11 months ago

Haha how good. SWAG is a reverse proxy using Nginx. I use the Docker container.

[-] cooopsspace@infosec.pub 1 points 11 months ago

Secure Web Application Gateway.

And something like "swag selfhosted" or "swag linuxserver" would have been a better search term. You need to lead the horse at least slightly in the direction of water when it comes to Google searches.

[-] notfromhere@lemmy.one 3 points 11 months ago

I know this isn’t what you’re asking for but I think this is still a good starting point. Like you correctly surmised, identity and authentication management is not an easy subject and does require extensive experience and theory.

[-] rentar42@kbin.social 3 points 11 months ago

I don't have a simple guide, but it's probably a good idea to reduce the number of moving parts if you're trying to keep stuff simple. So pick something that has all the features in-one (user management, authentication, authorization, ...). They might not be the best at ever single thing (they almost certainly won't), but doing it all usually means that it's easier to configure and you don't need to wire multiple things together.

I've recently moved from Authelia to Authentik due to some features that I was missing/wishing for, but between those two I'd definitely say Authenlia is easier to get running initially (and you don't need external LDAP for it, as others have mentioned).

You'll probably still need a proxy that can do proxy auth because not all services can do OICD/OAuth2. I'm using Traefik, but heard that Caddy is easier to set up initially (can't compare myself).

[-] dinosaurdynasty@lemmy.world 2 points 11 months ago

Hint: you don't have to use ldap to use authelia (I haven't bothered). It's a bit awkward to use though, I'd only recommend it for single-user setups (I wish they would just add support for SQLite, they already use it for 2fa and stuff)

[-] vegetaaaaaaa@lemmy.world 1 points 11 months ago

what should I use as my base DN?

I posted this a while ago about LDAP basics: https://lemmy.world/comment/1539633

The base DN is usually the DN under which your user accounts (inetOrgPersons) can be found. In my case it is ou=users,dc=example,dc=org.

[-] conrad82@lemmy.world 1 points 11 months ago

I use nforwardauth and caddy for authentication, I think it is one of the simplest solutions https://github.com/nosduco/nforwardauth

[-] Decronym@lemmy.decronym.xyz 0 points 11 months ago* (last edited 11 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
HTTP Hypertext Transfer Protocol, the Web
nginx Popular HTTP server

2 acronyms in this thread; the most compressed thread commented on today has 4 acronyms.

[Thread #171 for this sub, first seen 28th Sep 2023, 05:25] [FAQ] [Full list] [Contact] [Source code]

this post was submitted on 28 Sep 2023
43 points (97.8% liked)

Selfhosted

39247 readers
256 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