Skip to content

Instantly share code, notes, and snippets.

@mbbx6spp
Last active October 29, 2019 13:26
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbbx6spp/64f83aaa945cd52e75927100e5942b65 to your computer and use it in GitHub Desktop.
Save mbbx6spp/64f83aaa945cd52e75927100e5942b65 to your computer and use it in GitHub Desktop.
Suggested NixOS LDAP server configuration for Lookout. Nix, NixOS, OpenLDAP, LDAP. Basic (common sense) SSH/PAM/sudo settings too.
{ pkgs, config, ... }:
{
imports = [
<nixpkgs/nixos/modules/profiles/headless.nix>
];
# Enable sudo logins if the user's SSH agent provides a key
# present in <filename>~/.ssh/authorized_keys</filename>.
# This allows machines to exclusively use SSH keys instead of
# passwords.
security.pam.enableSSHAgentAuth = true;
# Basic security settings
security.sudo.enable = true;
# Only ok beause of enableSSHAgentAuth
security.sudo.wheelNeedsPassword = false;
# Reasonable OpenSSH settings
services.openssh.enable = true;
services.openssh.permitRootLogin = "no";
# Here's the inside joke...although perhaps not so inside any more.
services.openldap.enable = true;
services.openldap.extraConfig = ''
include ${pkgs.openldap.out}/etc/openldap/schema/core.schema
include ${pkgs.openldap.out}/etc/openldap/schema/cosine.schema
include ${pkgs.openldap.out}/etc/openldap/schema/inetorgperson.schema
include ${pkgs.openldap.out}/etc/openldap/schema/nis.schema
database bdb
suffix dc=lookout,dc=com
rootdn cn=shitlords,dc=lookout,dc=com
# NOTE: change after first start or don't because nobody takes security seriously *shrug*
# You create your own adventure...
rootpw lookoutislookout
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment