I’m curious as to why someone would need to do that short of having a bunch of users and a small office at home. Or maybe managing the family’s computers is easier that way?

I was considering a domain controller (biased towards linux since most servers/VMs are linux) but right now, for the homelab, it just seems like a shiny new toy to play with rather than something that can make life easier/more secure. There’s also the problem of HA and being locked out of your computer if the DC is down.

Tell me why you’re running it and the setup you’ve got that makes having a DC worth it.

Thanks!

@cm0002@lemmy.world
link
fedilink
English
157M

I do, for a multitude of reasons

  • Easier management of family computers
  • an authoritative source for Authentik SSO
  • Learning experience, I’m also heavy Linux, but I try to maintain an OS agnostic philosophy with my skill set so I can have options in my career
  • I was bored
  • Again, since I like to maintain an OS agnostic philosophy I have a healthy mix of Windows, Linux and MacOS devices, and you CAN in fact join Linux (w/ SSSD) and MacOS to a domain too

In addition to what others have said with roaming profiles and such:

DO NOT SET YOUR AD DOMAIN AS THE SAME DOMAIN OF A WEB ADDRESS YOU USE

I…er…someone… Found themselves in this situation and have been in a mess since lmao

@MigratingtoLemmy@lemmy.world
creator
link
fedilink
English
1
edit-2
7M

Thank you for the wonderful comment.

Indeed, I was hoping to have a good SSO setup alongside learning about AD and domain services (also looking at the *nix alternatives like FreeIPA).

Could you tell me more about the DNS setup with regards to AD? I’d like to use my own DNS and not have AD be the DNS provider in my network. The idea to put it in its own subdomain is excellent and I’ll remember that.

People here also mention an increase in attack surface and security vulnerabilities in running AD/domain services on a network. Now, I agree that letting free access to the domain server and having rogue accounts causing havoc on the network is not great, but I’d like to know more. What has been your experience?

Some of the best and worst decisions people have made started with, “I was bored.” Ha!

cooljacob204
link
fedilink
17M

Is there costs associated with this?

@cm0002@lemmy.world
link
fedilink
English
37M

To deploy AD, that depends.

If you like to sail the high seas AND aren’t trying to use it for a business, then no.

If you don’t want to sail the high seas or need to use it for a business, then yes, you’ll need to buy a Windows Server license

@Dashi@lemmy.world
link
fedilink
English
17M

Windows server license and CALs… don’t forget that extra little cost just because from MS

@assembly@lemmy.world
link
fedilink
English
67M

I run AD at home but it’s because my job is in enterprise software engineering and so running these programs in my home lab requires AD integrations. It’s also needed for HyperV and SCVMM along with things like SQL server auth and GMSA which I can’t get out of testing. Ironically most of my work is in open source/Linux but Windows servers are all over the Enterprise so I don’t have a choice but to run this stuff. No real users on it and just used for the lab.

It seems cool but it’s just going to be a big headache man. I would just spin up a domain controller and maybe some workstations to play around with.

@MigratingtoLemmy@lemmy.world
creator
link
fedilink
English
17M

I can see that. I will probably do the same before I even think of integrating a DC in my homelab - that goes for both AD and FreeIPA. Thanks

@alomsimoy@lemmy.world
link
fedilink
English
17M

I’m running truenas scale with truecharts and I manage all users and groups with the LLDAP chart, which is an stripped down version of ldap. I’m considering deploying another server and running 389ds with replication to increase the features and to learn more about ldap, but overall lldap covers all my necessities regarding user and group managment in all my homelab apps

@MigratingtoLemmy@lemmy.world
creator
link
fedilink
English
1
edit-2
7M

I am considering FreeIPA myself too! Thanks!

@kylian0087@lemmy.world
link
fedilink
English
17M

I in fact run a AD domain controller *and *a rhel IDM controller. For me other then it is fun to play with, makes it a load more simple to manage the user accounts of my famalie. Also auto mounting network shares and setting a few policys for updates and security is great to from a central location. having SSO for many if my services also makes it more easy to use for the fam. The rhel IDM controller I use to manage a few user accounts. I also use it to manage the ssh keys and set sudo rules on all my servers.

@computergeek125@lemmy.world
link
fedilink
English
5
edit-2
7M
  1. Yes I do - MS AD DC

  2. I don’t have a ton of users, but I have a ton of computers. AD keeps them in sync. Plus I can point services like gitea and vCenter at it for even more. Guacamole highly benefits from this arrangement since I can set the password to match the AD password, and all users on all devices subsequently auto-login, even after a password change.

  3. Used to run single domain controller, now I have two (leftover free forever licenses from college). I plan to upgrade them as a tick/tock so I’m not spending a fortune on licensing frequently

  4. With native Windows clients and I believe sssd realmd joins, the default config is to cache the last hash you used to log in. So if you log in regularly to a server it should have an up to date cache should your DC cluster become unavailable. This feature is also used on corporate laptops that need to roam from the building without an always-on VPN. Enterprises will generally also ensure a backup local account is set up (and optionally auto-rotated) in case the domain becomes unavailable in a bad way so that IT can recover your computer.

  5. I used to run in homemade a Free IPA and a MS AD in a cross forest trust when I started ~5-6y ago on the directory stuff. Windows and Mac were joined to AD, Linux was joined to IPA. (I tried to join Mac to IPA but there was only a limited LDAP connector and AD was more painless and less maintenance). One user to rule them all still. IPA has loads of great features - I especially enjoyed setting my shell, sudoers rules, and ssh keys from the directory to be available everywhere instantly.

But, I had some reliability problems (which may be resolved, I have not followed up) with the update system of IPA at the time, so I ended up burning it down and rejoining all the Linux servers to AD. Since then, the only feature I’ve lost is centralized sudo and ssh keys (shell can be set in AD if you’re clever). sssd handles six key MS group policies using libini, mapping them into relevant PAM policies so you even have some authorization that can be pushed from the DC like in Windows, with some relatively sane defaults.

I will warn - some MS group policies violate Linux INI spec (especially service definitions and firewall rules) can coredump libini, so you should put your Linux servers in a dedicated OU with their own group policies and limited settings in the default domain policy.

@MigratingtoLemmy@lemmy.world
creator
link
fedilink
English
2
edit-2
7M

Thanks for the great answer.

Using AD for SSO in git-frontends and other applications is a fantastic idea. I will probably also run FreeIPA (that’s a name I hadn’t heard in a while till this thread, from another commenter) and have a trust relationship.

You’re right, this is probably better for learning rather than actually using at home, since most of my computers are linux/BSD, so if I needed a central auth server, I’d probably be better off using something made for *nix.

With that said, I had a curious idea - can I spin up temporary credentials, using something akin to service/machine accounts, rotate credentials and invalidate credentials freely etc? In essence, I’m wondering if this can be a way to implement a sort of homegrown “AWS STS” alternative, for app secrets, workers and the like. I was initially looking at secret management suites like Vault and Conjur but what if this can do it?

Also, can AD encrypt the DB? Can FreeIPA do it? I’d like such an option for security.

Thanks!

I don’t have an immediate answer for you on encryption. I know most of the communication is encrypted in flight for AD, and on disk passwords are stored hashed unless the “use reversible encryption field is checked”. There are (in Microsoft terms) gMSAs (group-managed service accounts) but other than using one for ADFS (their oath provider), I have little knowledge of how it actually works on the inside.

AD also provides encryption key backup services for Bitlocker (MS full-partition encryption for NTFS) and the local account manager I mentioned, LAPS. Recovering those keys requires either a global admin account or specific permission delegation. On disk, I know MS has an encryption provider that works with the TPM, but I don’t have any data about whether that system is used (or where the decryptor is located) for these accounts types with recoverable credentials.

I did read a story recently about a cyber security firm working with an org who had gotten their way all the way down to domain admin, but needed a biometric unlocked Bitwarden to pop the final backup server to “own” the org. They indicated that there was native windows encryption going on, and managed to break in using a now-patched vulnerability in Bitwarden to recover a decryption key achievable by resetting the domain admin’s password and doing some windows magic. On my DC at home, all I know is it doesn’t need my password to reboot so there’s credentials recovery somewhere.

Directly to your question about short term use passwords: I’m not sure there’s a way to do it out of the box in MS AD without getting into some overcomplicated process. Accounts themselves can have per-OU password expiration policies that are nanosecond accurate (I know because I once accidentally set a password policy to 365 nanoseconds instead of a year), and you can even set whole account expiry (which would prevent the user from unlocking their expired password with a changed one). Theoretically, you could design/find a system that interacts with your domain to set, impound/encrypt, and manage the account and password expiration of a given set of users, but that would likely be add on software.

@MigratingtoLemmy@lemmy.world
creator
link
fedilink
English
27M

Thanks!

Kid_Thunder
link
fedilink
27M

Personally I use FreeIPA for my LDAP. I like that I can create sudoers rules from one centralized place and manage ssh keys across all clients. Granted I could just use Ansible I suppose, which is how I update multiple distributions in my network and online but I like that I can just change SSH keys and sudoers from one place easily instead of changing tasks/roles. I also usually run cockpit even on my non-Red Hat distros with SSH keys just so I don’t have to log into everything though it is somewhat limited outside of the Red Hat sphere.

If you don’t want to use ProxMox or some other specialized HyperVisor ecosystem, you can also use Cockpit to manager your VMs along with your Pods. I wish there’d be more attention to it for features because it feels like it could do a lot more.

I also don’t really worry about locking myself out for two reasons:

  1. I use SSH keys.

  2. I also have a break-glass local account on every system…with SSH keys. If its on your local network, you can use VNC/VM console/Remote Desktop with a local account while only allowing SSH with keys if you’d like. Just make sure if you’re going to allow remote access outside of your network that you never forward the VNC/RDP ports. For SSH when I do this I always pick some random port – never default and never common ones like 2222 to at least keep my logs less noisy from the botnet auto attacks.

For my online VPS’ I use a firewall with geoIP from Maxmind and drop all ports but 443 from the world, except for whatever country I’m in. I drop all packets from certain countries that seem to auto-attack more often than others. I try to drop packets from all known (to me) Shodan scanners. If I’m not traveling I just restrict all other ports to my public IP’s subnet though my IP hasn’t changed for years. For status checking services like StatusCake, I use the “push” method instead using a simple cron job with curl instead of relying on servers around the world checking my ports. In this case, the services just check that my server has successfully hit them within X minutes to be “up”.

@MigratingtoLemmy@lemmy.world
creator
link
fedilink
English
27M

Thank you for your experience using FreeIPA, your comment really got me re-thinking about AD, about trust setups and if I really needed a Windows domain controller other than for learning. Being able to manage Sudoers centrally is fantastic!

I plan to use XCP-ng as my hypervisor.

Unfortunately, I didn’t quite catch how using SSH keys will keep you from getting locked out if your domain controller goes down. That sounds exactly like what I want, and great idea having a spare account on each machine!

Thanks for your comment, very informative!

Kid_Thunder
link
fedilink
2
edit-2
7M

The SSH keys don’t help me if I get locked out of a Domain Controller unless you’re using OpenSSH (which is now a native feature you can turn on). In that case you can actually still log into the DC via command line because it authenticates based on authorized_keys and not the LDAP of the DC. I actually do this on the enterprise, not because I may get locked out but because it is just convenient. Granted you’ll have to execute powershell on the command line once in to use the AD cmdlets.

On the other hand when you create a DC now-a-days (Server 2019…I don’t remember if this is asked in the wizard when in Server 2016) you can create a “Directory Services Restore Mode” password which is basically a local admin account on the DC that you can log into only when the DC is booted into safe mode. You’ll be asked to create it when you promote your DC.

@MigratingtoLemmy@lemmy.world
creator
link
fedilink
English
17M

Thanks, great to know about Restore Mode.

@MigratingtoLemmy@lemmy.world
creator
link
fedilink
English
17M

Hey, I’d like to ask you one more thing: is it possible to set up short-term credentials which can be provisioned and invalidated automatically with policies? I’m looking towards an idea of a self-hosted AWS STS without installing a secrets manager like Conjur and I think it should technically be possible with FreeIPA. Please let me know what you think.

@Treczoks@lemmy.world
link
fedilink
English
27M

Keep in mind that AD, Office, and Exchange is he holy trinity of getting hacked in the last years.

@MigratingtoLemmy@lemmy.world
creator
link
fedilink
English
17M

I’ll keep that in mind, I’ve been warned by quite a few people in the comments haha

Create a post

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!

  • 1 user online
  • 31 users / day
  • 84 users / week
  • 216 users / month
  • 846 users / 6 months
  • 1 subscriber
  • 1.42K Posts
  • 8.09K Comments
  • Modlog