podman and opensnitch

This commit is contained in:
Sergei Poljanski 2026-01-13 17:59:24 +02:00
commit 5dadd4f858
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
5 changed files with 26 additions and 11 deletions

View file

@ -5,13 +5,10 @@
./usb-devices.nix
];
# Use the hardened kernel for better security
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_hardened;
# Only allow members of the wheel group to execute sudo
security.sudo.execWheelOnly = true;
# Linux Audit Framework
security.auditd.enable = true;
security.audit.enable = true;
security.audit.rules = [
@ -20,10 +17,8 @@
"-w /etc/shadow -p wa -k shadow_changes"
];
# Kernel Hardening
security.protectKernelImage = true;
# Sysctl hardening
boot.kernel.sysctl = {
"kernel.dmesg_restrict" = 1;
"kernel.kptr_restrict" = 2;
@ -42,13 +37,15 @@
"net.ipv6.conf.default.accept_redirects" = 0;
};
# USBGuard configuration
services.usbguard = {
enable = true;
dbus.enable = true;
implicitPolicyTarget = "block";
};
# OpenSnitch Application Firewall
services.opensnitch.enable = true;
security.pam.loginLimits = [
{ domain = "*"; item = "core"; type = "-"; value = "0"; }
];
@ -58,7 +55,7 @@
RestrictAddressFamilies = "AF_UNIX AF_NETLINK";
};
# Podman socket for all users
# Declaratively enable Podman socket for all users
systemd.user.sockets.podman.wantedBy = [ "sockets.target" ];
virtualisation = {
@ -84,5 +81,7 @@
lynis
audit
tcpdump
bandwhich
opensnitch-ui
];
}