2019-11-23 13:25:27 +01:00
|
|
|
import ../make-test-python.nix ({pkgs, ...}: {
|
2017-11-06 18:41:34 +01:00
|
|
|
name = "kerberos_server-heimdal";
|
2023-12-21 11:37:55 +01:00
|
|
|
|
2022-03-21 00:15:30 +01:00
|
|
|
nodes.machine = { config, libs, pkgs, ...}:
|
2017-11-06 18:41:34 +01:00
|
|
|
{ services.kerberos_server =
|
|
|
|
{ enable = true;
|
|
|
|
realms = {
|
|
|
|
"FOO.BAR".acl = [{principal = "admin"; access = ["add" "cpw"];}];
|
|
|
|
};
|
|
|
|
};
|
2023-07-24 23:12:29 +02:00
|
|
|
security.krb5 = {
|
2017-11-06 18:41:34 +01:00
|
|
|
enable = true;
|
2023-07-13 01:21:59 +02:00
|
|
|
package = pkgs.heimdal;
|
|
|
|
settings = {
|
|
|
|
libdefaults = {
|
|
|
|
default_realm = "FOO.BAR";
|
|
|
|
};
|
|
|
|
realms = {
|
|
|
|
"FOO.BAR" = {
|
|
|
|
admin_server = "machine";
|
|
|
|
kdc = "machine";
|
|
|
|
};
|
2017-11-06 18:41:34 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-11-23 13:25:27 +01:00
|
|
|
machine.succeed(
|
|
|
|
"kadmin -l init --realm-max-ticket-life='8 day' --realm-max-renewable-life='10 day' FOO.BAR",
|
|
|
|
"systemctl restart kadmind.service kdc.service",
|
|
|
|
)
|
2017-11-06 18:41:34 +01:00
|
|
|
|
2019-11-23 13:25:27 +01:00
|
|
|
for unit in ["kadmind", "kdc", "kpasswdd"]:
|
|
|
|
machine.wait_for_unit(f"{unit}.service")
|
2017-11-06 18:41:34 +01:00
|
|
|
|
2019-11-23 13:25:27 +01:00
|
|
|
machine.succeed(
|
|
|
|
"kadmin -l add --password=admin_pw --use-defaults admin",
|
|
|
|
"kadmin -l ext_keytab --keytab=admin.keytab admin",
|
|
|
|
"kadmin -p admin -K admin.keytab add --password=alice_pw --use-defaults alice",
|
|
|
|
"kadmin -l ext_keytab --keytab=alice.keytab alice",
|
|
|
|
"kinit -kt alice.keytab alice",
|
|
|
|
)
|
2017-11-06 18:41:34 +01:00
|
|
|
'';
|
2023-12-21 11:37:55 +01:00
|
|
|
|
|
|
|
meta.maintainers = [ pkgs.lib.maintainers.dblsaiko ];
|
2017-11-06 18:41:34 +01:00
|
|
|
})
|