Skip to content
Snippets Groups Projects
Commit 0faf6ac7 authored by Florian Sesser's avatar Florian Sesser
Browse files

vpn: add global preshared key. post-quantum resistence sounds great!

parent ef4a991f
No related branches found
No related tags found
3 merge requests!101Merge staging into production,!100Merge develop into staging,!87Add monitoring VPN modules and config
Pipeline #517 failed
......@@ -37,6 +37,14 @@
permissions = "0400";
action = ["sudo" "systemctl" "restart" "wireguard-monitoringvpn.service"];
};
"monitoringvpn-preshared-key" = {
source = "../../PrivateStorageSecrets/monitoringvpn/preshared.key";
destination = "/var/secrets/monitoringvpn/preshared.key";
owner.user = "root";
owner.group = "root";
permissions = "0400";
action = ["sudo" "systemctl" "restart" "wireguard-monitoringvpn.service"];
};
};
};
......
......@@ -20,6 +20,14 @@
permissions = "0444";
action = ["sudo" "systemctl" "restart" "wireguard-monitoringvpn.service"];
};
"monitoringvpn-preshared-key" = {
source = "../../PrivateStorageSecrets/monitoringvpn/preshared.key";
destination = "/var/secrets/monitoringvpn/preshared.key";
owner.user = "root";
owner.group = "root";
permissions = "0400";
action = ["sudo" "systemctl" "restart" "wireguard-monitoringvpn.service"];
};
};
};
......
......@@ -21,6 +21,14 @@ in {
File with base64 public key generated by <command>cat private.key | wg pubkey > pubkey.pub</command>.
'';
};
presharedKeyFile = lib.mkOption {
type = lib.types.path;
example = lib.literalExample /var/secrets/monitoringvpn/preshared.key;
default = /var/secrets/monitoringvpn/preshared.key;
description = ''
File with base64 preshared key generated by <command>wg genpsk</command>.
'';
};
allowedIPs = lib.mkOption {
type = lib.types.listOf lib.types.str;
example = lib.literalExample [ "172.23.23.1/32" ];
......@@ -62,6 +70,7 @@ in {
allowedIPs = cfg.client.allowedIPs;
endpoint = cfg.client.endpoint; # meaning: the server.
publicKey = builtins.readFile(cfg.client.endpointPublicKeyFile);
presharedKeyFile = toString cfg.client.presharedKeyFile;
}
];
};
......
......@@ -22,6 +22,14 @@ in {
File with base64 public key generated by <command>cat private.key | wg pubkey > pubkey.pub</command>.
'';
};
presharedKeyFile = lib.mkOption {
type = lib.types.path;
example = lib.literalExample /var/secrets/monitoringvpn/preshared.key;
default = /var/secrets/monitoringvpn/preshared.key;
description = ''
File with base64 preshared key generated by <command>wg genpsk</command>.
'';
};
ip = lib.mkOption {
type = lib.types.str;
example = lib.literalExample [ "172.23.23.23" ];
......@@ -50,10 +58,12 @@ in {
{ # node1
allowedIPs = [ "172.23.23.11/32" ];
publicKey = "tZ295cvD98ixt/VH4dwPKNgHf9MuhuzsossOWBOOoGU=";
presharedKeyFile = toString cfg.server.presharedKeyFile;
}
{ # node2
allowedIPs = [ "172.23.23.12/32" ];
publicKey = "zDxWTejJDXRRmUiMZPC7eVSCDdyFikN9VI6cqapQ6RY=";
presharedKeyFile = toString cfg.server.presharedKeyFile;
}
];
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment