2020-04-24 23:36:52 +00:00
|
|
|
import ../make-test-python.nix ({pkgs, ...}: {
|
|
|
|
name = "kerberos_server-heimdal";
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
nodes.machine = { config, libs, pkgs, ...}:
|
2020-04-24 23:36:52 +00:00
|
|
|
{ services.kerberos_server =
|
|
|
|
{ enable = true;
|
2024-06-20 14:57:18 +00:00
|
|
|
settings.realms = {
|
2020-04-24 23:36:52 +00:00
|
|
|
"FOO.BAR".acl = [{principal = "admin"; access = ["add" "cpw"];}];
|
|
|
|
};
|
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
security.krb5 = {
|
2020-04-24 23:36:52 +00:00
|
|
|
enable = true;
|
2024-01-13 08:15:51 +00:00
|
|
|
package = pkgs.heimdal;
|
|
|
|
settings = {
|
|
|
|
libdefaults = {
|
|
|
|
default_realm = "FOO.BAR";
|
|
|
|
};
|
|
|
|
realms = {
|
|
|
|
"FOO.BAR" = {
|
|
|
|
admin_server = "machine";
|
|
|
|
kdc = "machine";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
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",
|
|
|
|
)
|
|
|
|
|
|
|
|
for unit in ["kadmind", "kdc", "kpasswdd"]:
|
|
|
|
machine.wait_for_unit(f"{unit}.service")
|
|
|
|
|
|
|
|
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",
|
|
|
|
)
|
|
|
|
'';
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
meta.maintainers = [ pkgs.lib.maintainers.dblsaiko ];
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|