chore: security hardening
All checks were successful
/ check (push) Successful in 17m58s

This commit is contained in:
winston 2024-09-18 23:32:50 +02:00
parent af3dc8b59e
commit e94b793bc7
Signed by: winston
GPG key ID: 3786770EDBC2B481
4 changed files with 20 additions and 9 deletions

View file

@ -9,7 +9,14 @@
openssh = { openssh = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
allowSFTP = false;
challengeResponseAuthentication = false;
settings = { settings = {
AllowAgentForwarding = false;
AllowStreamLocalForwarding = false;
AllowTcpForwarding = true;
AuthenticationMethods = "publickey";
KexAlgorithms = [ KexAlgorithms = [
"curve25519-sha256" "curve25519-sha256"
"curve25519-sha256@libssh.org" "curve25519-sha256@libssh.org"
@ -19,7 +26,7 @@
]; ];
PasswordAuthentication = false; PasswordAuthentication = false;
PermitRootLogin = "prohibit-password"; PermitRootLogin = "prohibit-password";
StreamLocalBindUnlink = "yes"; X11Forwarding = false;
}; };
}; };
}; };

View file

@ -7,10 +7,8 @@
"nix-command" "nix-command"
"flakes" "flakes"
]; ];
trusted-users = [ allowed-users = [ "root" ];
"@wheel" trusted-users = [ "root" ];
"winston"
];
}; };
}; };
} }

View file

@ -22,8 +22,15 @@
modules = [ modules = [
{ {
nixpkgs = { nixpkgs = {
config.allowUnfree = true;
inherit overlays; inherit overlays;
config.allowUnfreePredicate =
pkg:
builtins.elem (nixpkgs.lib.getName pkg) [
"elasticsearch"
"satisfactory-server"
"steamworks-sdk-redist"
"valheim-server"
];
}; };
} }
./hosts/main-node ./hosts/main-node
@ -65,12 +72,10 @@
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
inherit (config.pre-commit.devShell) shellHook; inherit (config.pre-commit.devShell) shellHook;
buildInputs = [ packages = [
inputs'.agenix.packages.agenix inputs'.agenix.packages.agenix
pkgs.age-plugin-yubikey pkgs.age-plugin-yubikey
pkgs.unstable.deploy-rs pkgs.unstable.deploy-rs
pkgs.unstable.nh
pkgs.unstable.nixd
self'.formatter self'.formatter
]; ];
}; };

View file

@ -30,6 +30,7 @@ let
Group = "wakapi"; Group = "wakapi";
DynamicUser = true; DynamicUser = true;
NoNewPrivileges = true;
ProtectHome = true; ProtectHome = true;
ProtectHostname = true; ProtectHostname = true;
ProtectKernelLogs = true; ProtectKernelLogs = true;