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
|
||||
"${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 = {
|
||||
tty-ips.enable = true;
|
||||
uptime-kuma = {
|
||||
|
|
@ -27,7 +30,6 @@ in
|
|||
};
|
||||
};
|
||||
networking = {
|
||||
firewall.enable = false;
|
||||
yggdrasil = {
|
||||
enable = true;
|
||||
AllowedPublicKeys = [
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ in
|
|||
"${modulesPath}/virtualisation/lxc-container.nix"
|
||||
];
|
||||
deploy = {
|
||||
enable = true;
|
||||
address = "200:1978:6503:e6f0:2dbe:11fd:74b:ff64";
|
||||
};
|
||||
sops.secrets = {
|
||||
|
|
@ -39,7 +40,6 @@ in
|
|||
};
|
||||
};
|
||||
networking = {
|
||||
firewall.enable = false;
|
||||
yggdrasil = {
|
||||
enable = true;
|
||||
AllowedPublicKeys = [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,20 @@
|
|||
};
|
||||
|
||||
networking = {
|
||||
firewall = {
|
||||
enable = true;
|
||||
interfaces = {
|
||||
ygg0 = {
|
||||
allowedTCPPorts = [ 22 ];
|
||||
allowedUDPPorts = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
# Default deny policy for all interfaces (including ygg0)
|
||||
allowPing = false;
|
||||
allowedTCPPorts = [ ];
|
||||
allowedUDPPorts = [ ];
|
||||
};
|
||||
dhcpcd.enable = false;
|
||||
useDHCP = false;
|
||||
useHostResolvConf = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue