update fail2ban

This commit is contained in:
Daylin Morgan 2023-08-07 10:57:28 -05:00
parent 0d5e55f90a
commit 7d77335e21
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -26,106 +26,124 @@
}; };
services.resolved.enable = true; services.resolved.enable = true;
services.fail2ban.enable = true;
boot.kernelPackages = pkgs.linuxPackages_latest; # fail2ban config based on:
# https://www.linode.com/docs/guides/how-to-use-fail2ban-for-ssh-brute-force-protection/
services.fail2ban {
enable = true;
maxretry = 5;
bantime = "24h";
jails = {
sshd = ''
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
findtime = 300
bantime = 3600
ignoreip = 127.0.0.1
''
}
}
boot.kernelPackages = pkgs.linuxPackages_latest;
services.cron = { # TODO: convert this to a systemd service/timer
enable = true; # services.cron = {
systemCronJobs = [ # enable = true;
# update repos # systemCronJobs = [
"0 * * * * make -C /home/daylin/git soft-repos" # # update repos
# update container so home page is semi-accurate # "0 * * * * make -C /home/daylin/git soft-repos"
"0 2 * * * make -C /home/daylin/git update-soft-serve" # # update container so home page is semi-accurate
# "0 2 * * * make -C /home/daylin/git update-soft-serve"
# ];
# };
#
networking.hostName = "algiz";
# added to make using `pip install` work in docker build
networking.nameservers = [
"8.8.8.8"
]; ];
};
networking.hostName = "algiz"; time.timeZone = "America/Chicago";
programs.zsh.enable = true;
virtualisation.docker.enable = true;
# added to make using `pip install` work in docker build programs.nix-ld.enable = true;
networking.nameservers = [ programs.nix-ld.libraries = with pkgs; [
"8.8.8.8" stdenv.cc.cc
]; curl # for choosenim
];
time.timeZone = "America/Chicago"; environment.systemPackages = with pkgs; [
programs.zsh.enable = true; zsh
virtualisation.docker.enable = true;
programs.nix-ld.enable = true; tmux
programs.nix-ld.libraries = with pkgs; [ wget
stdenv.cc.cc unzip
curl # for choosenim less
]; gnumake
gcc
gnupg
environment.systemPackages = with pkgs; [ curl
zsh
tmux git
wget
unzip
less
gnumake
gcc
gnupg
curl vim
neovim
git starship
atuin
chezmoi
bat
fzf
delta
ripgrep
lsd
vim gh
neovim lazygit
starship nixpkgs-fmt
atuin lazydocker
chezmoi
bat
fzf
delta
ripgrep
lsd
gh (python3.withPackages (ps: with ps; [ pip ]))
lazygit micromamba
nixpkgs-fmt nodejs
lazydocker go
rustup
python3 ];
micromamba
nodejs
go
rustup
];
# Use the GRUB 2 boot loader. # Use the GRUB 2 boot loader.
boot.loader.grub.enable = true; boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
enableSSHSupport = true; enableSSHSupport = true;
}; };
# allow tcp connections for git.dayl.in (gitea) # allow tcp connections for git.dayl.in (gitea)
networking.firewall = { networking.firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 80 443 ]; allowedTCPPorts = [ 80 443 ];
}; };
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh.enable = true; services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = false; services.openssh.settings.PasswordAuthentication = false;
users.mutableUsers = false; users.mutableUsers = false;
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave # on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system. # this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment? system.stateVersion = "22.11"; # Did you read the comment?
} }