migrate firewall config increase security
This commit is contained in:
parent
1cf7f2c054
commit
4ecc6a4ae6
4 changed files with 55 additions and 3 deletions
36
configurations/nixos/base-image/default.nix
Normal file
36
configurations/nixos/base-image/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
flake,
|
||||||
|
modulesPath,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (flake) inputs;
|
||||||
|
inherit (inputs) self;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
self.nixosModules.default
|
||||||
|
"${modulesPath}/virtualisation/lxc-container.nix"
|
||||||
|
];
|
||||||
|
deploy = {
|
||||||
|
enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
tty-ips.enable = true;
|
||||||
|
};
|
||||||
|
networking = {
|
||||||
|
yggdrasil = {
|
||||||
|
enable = true;
|
||||||
|
AllowedPublicKeys = [
|
||||||
|
"d0e265fcf663451ae9bc048dc1297749819ce9d48042a986f2866c15a779a074"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
hostName = "tofu";
|
||||||
|
};
|
||||||
|
environment.systemPackages = [
|
||||||
|
];
|
||||||
|
system.stateVersion = "25.05";
|
||||||
|
}
|
||||||
|
|
@ -14,7 +14,10 @@ in
|
||||||
self.nixosModules.default
|
self.nixosModules.default
|
||||||
"${modulesPath}/virtualisation/lxc-container.nix"
|
"${modulesPath}/virtualisation/lxc-container.nix"
|
||||||
];
|
];
|
||||||
deploy.address = "200:b938:d405:92df:a6e:1ffd:5213:26b";
|
deploy = {
|
||||||
|
enable = true;
|
||||||
|
address = "200:b938:d405:92df:a6e:1ffd:5213:26b";
|
||||||
|
};
|
||||||
services = {
|
services = {
|
||||||
tty-ips.enable = true;
|
tty-ips.enable = true;
|
||||||
uptime-kuma = {
|
uptime-kuma = {
|
||||||
|
|
@ -27,7 +30,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking = {
|
networking = {
|
||||||
firewall.enable = false;
|
|
||||||
yggdrasil = {
|
yggdrasil = {
|
||||||
enable = true;
|
enable = true;
|
||||||
AllowedPublicKeys = [
|
AllowedPublicKeys = [
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ in
|
||||||
"${modulesPath}/virtualisation/lxc-container.nix"
|
"${modulesPath}/virtualisation/lxc-container.nix"
|
||||||
];
|
];
|
||||||
deploy = {
|
deploy = {
|
||||||
|
enable = true;
|
||||||
address = "200:1978:6503:e6f0:2dbe:11fd:74b:ff64";
|
address = "200:1978:6503:e6f0:2dbe:11fd:74b:ff64";
|
||||||
};
|
};
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
|
|
@ -39,7 +40,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking = {
|
networking = {
|
||||||
firewall.enable = false;
|
|
||||||
yggdrasil = {
|
yggdrasil = {
|
||||||
enable = true;
|
enable = true;
|
||||||
AllowedPublicKeys = [
|
AllowedPublicKeys = [
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,20 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
|
firewall = {
|
||||||
|
enable = true;
|
||||||
|
interfaces = {
|
||||||
|
ygg0 = {
|
||||||
|
allowedTCPPorts = [ 22 ];
|
||||||
|
allowedUDPPorts = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Default deny policy for all interfaces (including ygg0)
|
||||||
|
allowPing = false;
|
||||||
|
allowedTCPPorts = [ ];
|
||||||
|
allowedUDPPorts = [ ];
|
||||||
|
};
|
||||||
dhcpcd.enable = false;
|
dhcpcd.enable = false;
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
useHostResolvConf = false;
|
useHostResolvConf = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue