mirror of
https://github.com/blahai/nyx.git
synced 2025-02-23 12:15:09 +00:00
Networking: add ssh and more firewall rules
This commit is contained in:
parent
6fc5cef4cb
commit
2a57b163e6
3 changed files with 25 additions and 3 deletions
|
@ -1,5 +1,30 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkForce;
|
||||||
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./fail2ban.nix
|
./fail2ban.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
networking.firewall = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.iptables;
|
||||||
|
|
||||||
|
allowedTCPPorts = [
|
||||||
|
443
|
||||||
|
80
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [];
|
||||||
|
|
||||||
|
# make a much smaller and easier to read log
|
||||||
|
logReversePathDrops = true;
|
||||||
|
logRefusedConnections = false;
|
||||||
|
|
||||||
|
checkReversePath = mkForce false;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
startWhenNeeded = true;
|
|
||||||
settings = {
|
settings = {
|
||||||
PermitRootLogin = "no";
|
PermitRootLogin = "no";
|
||||||
PasswordAuthentication = false;
|
PasswordAuthentication = false;
|
||||||
|
|
|
@ -5,8 +5,6 @@ in {
|
||||||
enableIPv6 = true;
|
enableIPv6 = true;
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
80 # HTTP
|
|
||||||
443 # HTTPS
|
|
||||||
25565 # minecraft
|
25565 # minecraft
|
||||||
25566 # minecraft
|
25566 # minecraft
|
||||||
25567 # minecraft
|
25567 # minecraft
|
||||||
|
|
Loading…
Add table
Reference in a new issue