Security updates

This commit is contained in:
2025-12-20 17:52:03 -07:00
parent 20fefd7813
commit 1bf4a88be0
4 changed files with 171 additions and 18 deletions

View File

@@ -1,12 +1,36 @@
{ config, pkgs, ... }:
{
# Enable the OpenSSH daemon
# Hardened OpenSSH
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
# Authentication
PermitRootLogin = "no";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitEmptyPasswords = false;
# Security hardening
X11Forwarding = false;
AllowTcpForwarding = false;
AllowAgentForwarding = false;
AllowStreamLocalForwarding = false;
# Session settings
ClientAliveInterval = 300;
ClientAliveCountMax = 2;
MaxAuthTries = 3;
MaxSessions = 2;
LoginGraceTime = 30;
};
# Use only strong key exchange algos
extraConfig = ''
KexAlgorithms curve25519-sha256@libssh.org,curve25519-sha256
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
'';
};
# Tailscale