2020-04-24 23:36:52 +00:00
|
|
|
import ../make-test-python.nix ({pkgs, ...}: {
|
|
|
|
name = "kerberos_server-mit";
|
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;
|
|
|
|
realms = {
|
|
|
|
"FOO.BAR".acl = [{principal = "admin"; access = ["add" "cpw"];}];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
krb5 = {
|
|
|
|
enable = true;
|
2022-12-17 10:02:37 +00:00
|
|
|
kerberos = pkgs.krb5;
|
2020-04-24 23:36:52 +00:00
|
|
|
libdefaults = {
|
|
|
|
default_realm = "FOO.BAR";
|
|
|
|
};
|
|
|
|
realms = {
|
|
|
|
"FOO.BAR" = {
|
|
|
|
admin_server = "machine";
|
|
|
|
kdc = "machine";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
users.extraUsers.alice = { isNormalUser = true; };
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.succeed(
|
|
|
|
"kdb5_util create -s -r FOO.BAR -P master_key",
|
|
|
|
"systemctl restart kadmind.service kdc.service",
|
|
|
|
)
|
|
|
|
|
|
|
|
for unit in ["kadmind", "kdc"]:
|
|
|
|
machine.wait_for_unit(f"{unit}.service")
|
|
|
|
|
|
|
|
machine.succeed(
|
|
|
|
"kadmin.local add_principal -pw admin_pw admin",
|
|
|
|
"kadmin -p admin -w admin_pw addprinc -pw alice_pw alice",
|
|
|
|
"echo alice_pw | sudo -u alice kinit",
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
})
|