mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
nebula: Enable firewall and restrict ssh access by role
This commit is contained in:
parent
382dae6cbb
commit
61f5c54196
5 changed files with 69 additions and 46 deletions
|
|
@ -16,14 +16,25 @@ in
|
|||
config = lib.mkIf (cfg.enable && cfg.sshd.enable) {
|
||||
meta.ports.tcp = [ cfg.sshd.port ];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = false;
|
||||
ports = [ ];
|
||||
listenAddresses = lib.singleton {
|
||||
addr = cfg.address;
|
||||
inherit (cfg.sshd) port;
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
openFirewall = false;
|
||||
ports = [ ];
|
||||
listenAddresses = lib.singleton {
|
||||
addr = cfg.address;
|
||||
inherit (cfg.sshd) port;
|
||||
};
|
||||
};
|
||||
|
||||
nebula.networks.mesh.firewall.inbound =
|
||||
config.custom.services.nebula.peers
|
||||
|> lib.filter (node: node.isClient)
|
||||
|> lib.map (nebula: {
|
||||
port = "22";
|
||||
proto = "tcp";
|
||||
host = nebula.name;
|
||||
});
|
||||
};
|
||||
|
||||
systemd.services.sshd = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue