2024-07-06 13:08:05 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
2024-07-07 00:07:59 +02:00
|
|
|
realm = "PVV.LOCAL";
|
2024-07-06 13:08:05 +02:00
|
|
|
cfg = config.security.krb5;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
security.krb5 = {
|
|
|
|
enable = true;
|
|
|
|
|
2024-07-07 00:07:59 +02:00
|
|
|
# NOTE: This is required in order to build smbk5pwd, because of some nested includes.
|
2024-07-06 13:08:05 +02:00
|
|
|
# We should open an issue upstream (heimdal, not nixpkgs), but this patch
|
|
|
|
# will do for now.
|
|
|
|
package = pkgs.heimdal.overrideAttrs (prev: {
|
|
|
|
postInstall = prev.postInstall + ''
|
|
|
|
cp include/heim_threads.h $dev/include
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
realms.${realm} = {
|
2024-07-07 00:07:59 +02:00
|
|
|
kdc = [ "dagali.${lib.toLower realm}" ];
|
|
|
|
admin_server = "dagali.${lib.toLower realm}";
|
|
|
|
kpasswd_server = "dagali.${lib.toLower realm}";
|
|
|
|
default_domain = lib.toLower realm;
|
2024-07-06 13:08:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
kadmin.default_keys = lib.concatStringsSep " " [
|
|
|
|
"aes256-cts-hmac-sha1-96:pw-salt"
|
|
|
|
"aes128-cts-hmac-sha1-96:pw-salt"
|
|
|
|
];
|
|
|
|
|
|
|
|
libdefaults.default_etypes = lib.concatStringsSep " " [
|
|
|
|
"aes256-cts-hmac-sha1-96"
|
|
|
|
"aes128-cts-hmac-sha1-96"
|
|
|
|
];
|
|
|
|
|
|
|
|
libdefaults = {
|
|
|
|
default_realm = realm;
|
|
|
|
};
|
|
|
|
|
|
|
|
domain_realm = {
|
2024-07-07 00:07:59 +02:00
|
|
|
"${lib.toLower realm}" = realm;
|
|
|
|
".${lib.toLower realm}" = realm;
|
2024-07-06 13:08:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
logging = {
|
2024-07-07 00:07:59 +02:00
|
|
|
# kdc = "CONSOLE";
|
2024-07-06 13:08:05 +02:00
|
|
|
kdc = "SYSLOG:DEBUG:AUTH";
|
|
|
|
admin_server = "SYSLOG:DEBUG:AUTH";
|
|
|
|
default = "SYSLOG:DEBUG:AUTH";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.kerberos_server = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
realms.${realm} = {
|
2024-07-07 00:07:59 +02:00
|
|
|
dbname = "/var/lib/heimdal/heimdal";
|
|
|
|
mkey = "/var/lib/heimdal/m-key";
|
|
|
|
acl = [
|
|
|
|
{
|
|
|
|
principal = "felixalb/admin";
|
|
|
|
access = "all";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
principal = "oysteikt/admin";
|
|
|
|
access = "all";
|
|
|
|
}
|
|
|
|
];
|
2024-07-06 13:08:05 +02:00
|
|
|
};
|
|
|
|
# kadmin.default_keys = lib.concatStringsSep " " [
|
|
|
|
# "aes256-cts-hmac-sha1-96:pw-salt"
|
|
|
|
# "aes128-cts-hmac-sha1-96:pw-salt"
|
|
|
|
# ];
|
|
|
|
|
|
|
|
# libdefaults.default_etypes = lib.concatStringsSep " " [
|
|
|
|
# "aes256-cts-hmac-sha1-96"
|
|
|
|
# "aes128-cts-hmac-sha1-96"
|
|
|
|
# ];
|
|
|
|
|
|
|
|
# password_quality.min_length = 8;
|
|
|
|
};
|
|
|
|
};
|
2024-07-07 00:07:59 +02:00
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 88 464 749 ];
|
|
|
|
networking.firewall.allowedUDPPorts = [ 88 464 749 ];
|
2024-07-06 13:08:05 +02:00
|
|
|
}
|