[Draft] Basic LDAP/Portunus config #12
|
@ -3,31 +3,53 @@
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
tld = "moe";
|
tld = "moe";
|
||||||
hostname = "eisvogel";
|
hostname = "eisvogel";
|
||||||
domain = "portunus.${hostname}.${tld}";
|
domain = "portunus.${hostname}.${tld}";
|
||||||
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
portunusUser = "portunus";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
portunusGroup = "portunus";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
ldapUser = "openldap";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
ldapGroup = "openldap";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
in {
|
in {
|
||||||
# TODO: acme/letsencrypt oder andere lösung?
|
users.users."${portunusUser}" = {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
#
|
isSystemUser = true;
|
||||||
potential security risk potential security risk
should be nix path should be nix path
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
services.nginx = {
|
group = "${portunusGroup}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
enable = true;
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
virtualHosts."${domain}" = {
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
forceSSL = true;
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
enableACME = true;
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
locations = {
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
"/".proxyPass = "http://localhost:${toString config.services.portunus.port}";
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
"/dex".proxyPass = "http://localhost:${toString config.services.portunus.dex.port}";
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
};
|
};
|
||||||
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
users.groups."${portunusGroup}" = {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
name = "${portunusGroup}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
members = ["${portunusUser}"];
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
};
|
};
|
||||||
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
users.users."${ldapUser}" = {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
isSystemUser = true;
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
group = "${ldapGroup}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
};
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
users.groups."${ldapGroup}" = {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
name = "${ldapGroup}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
members = ["${ldapUser}"];
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
};
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
# TODO: eigenes secrets.yaml für seedfile?
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
sops.secrets.portunus_seedfile = {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
owner = "${portunusUser}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
group = "${portunusGroup}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
};
|
};
|
||||||
|
|
||||||
services.portunus = {
|
services.portunus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
user = "${portunusUser}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
group = "${portunusGroup}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
domain = "${domain}";
|
domain = "${domain}";
|
||||||
ldap = {
|
ldap = {
|
||||||
|
user = "${ldapUser}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
group = "${ldapGroup}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
suffix = "dc=${hostname},dc=${tld}";
|
suffix = "dc=${hostname},dc=${tld}";
|
||||||
tls = true;
|
tls = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: siehe unten sops, statische config
|
# TODO: wohin seed file?
|
||||||
potential security risk potential security risk
should be nix path should be nix path
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
# seedPath = "";
|
seedPath = "";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
|
||||||
# falls wir das brauchen
|
# falls wir das brauchen
|
||||||
# dex = {
|
# dex = {
|
||||||
|
@ -41,7 +63,20 @@ in {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
enable = true;
|
enable = true;
|
||||||
server = "ldaps://${domain}";
|
server = "ldaps://${domain}";
|
||||||
base = "dc=${hostname},dc=${tld}";
|
base = "dc=${hostname},dc=${tld}";
|
||||||
# useTLS = true; # nicht noetig weil ldaps domain festgelegt. wuerde sonst starttls auf port 389 versuchen
|
# useTLS = true; # nicht nötig weil ldaps domain festgelegt. würde sonst starttls auf port 389 versuchen
|
||||||
potential security risk potential security risk
should be nix path should be nix path
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
};
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
# TODO: acme/letsencrypt oder andere lösung?
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
services.nginx = {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
enable = true;
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
virtualHosts."${config.services.portunus.domain}" = {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
forceSSL = true;
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
enableACME = true;
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
locations = {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
"/".proxyPass = "http://localhost:${toString config.services.portunus.port}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
"/dex".proxyPass = "http://localhost:${toString config.services.portunus.dex.port}";
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
};
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
|
};
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
@ -49,5 +84,4 @@ in {
|
||||||
potential security risk potential security risk
should be nix path should be nix path
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
443 # https
|
443 # https
|
||||||
636 # ldaps
|
636 # ldaps
|
||||||
];
|
];
|
||||||
# TODO: sops zeug, keine ahnung wie das (ordentlich) gemacht wird/gemacht werden soll
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
|
|||||||
}
|
}
|
||||||
|
|
||||||
potential security risk potential security risk
should be nix path should be nix path
potential security risk potential security risk
should be nix path should be nix path
|
potential security risk
should be nix path