podman and opensnitch
This commit is contained in:
parent
23ca86c7d5
commit
ba643a09b2
4 changed files with 14 additions and 11 deletions
|
|
@ -88,7 +88,7 @@
|
||||||
awscli2
|
awscli2
|
||||||
# azure-cli
|
# azure-cli
|
||||||
google-cloud-sdk
|
google-cloud-sdk
|
||||||
docker-compose
|
podman-compose
|
||||||
argocd
|
argocd
|
||||||
fluxcd
|
fluxcd
|
||||||
kubectx # switch between contexts/namespaces
|
kubectx # switch between contexts/namespaces
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,10 @@
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
programs.virt-manager.enable = true;
|
programs.virt-manager.enable = true;
|
||||||
|
|
||||||
# Docker
|
# Container Runtimes
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.podman = {
|
||||||
|
enable = true;
|
||||||
|
dockerCompat = true;
|
||||||
|
defaultNetwork.settings.dns_enabled = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,10 @@
|
||||||
./usb-devices.nix
|
./usb-devices.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the hardened kernel for better security
|
|
||||||
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_hardened;
|
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_hardened;
|
||||||
|
|
||||||
# Only allow members of the wheel group to execute sudo
|
|
||||||
security.sudo.execWheelOnly = true;
|
security.sudo.execWheelOnly = true;
|
||||||
|
|
||||||
# Linux Audit Framework
|
|
||||||
security.auditd.enable = true;
|
security.auditd.enable = true;
|
||||||
security.audit.enable = true;
|
security.audit.enable = true;
|
||||||
security.audit.rules = [
|
security.audit.rules = [
|
||||||
|
|
@ -20,10 +17,8 @@
|
||||||
"-w /etc/shadow -p wa -k shadow_changes"
|
"-w /etc/shadow -p wa -k shadow_changes"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Kernel Hardening
|
|
||||||
security.protectKernelImage = true;
|
security.protectKernelImage = true;
|
||||||
|
|
||||||
# Sysctl hardening
|
|
||||||
boot.kernel.sysctl = {
|
boot.kernel.sysctl = {
|
||||||
"kernel.dmesg_restrict" = 1;
|
"kernel.dmesg_restrict" = 1;
|
||||||
"kernel.kptr_restrict" = 2;
|
"kernel.kptr_restrict" = 2;
|
||||||
|
|
@ -42,13 +37,15 @@
|
||||||
"net.ipv6.conf.default.accept_redirects" = 0;
|
"net.ipv6.conf.default.accept_redirects" = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
# USBGuard configuration
|
|
||||||
services.usbguard = {
|
services.usbguard = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dbus.enable = true;
|
dbus.enable = true;
|
||||||
implicitPolicyTarget = "block";
|
implicitPolicyTarget = "block";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# OpenSnitch Application Firewall
|
||||||
|
services.opensnitch.enable = true;
|
||||||
|
|
||||||
security.pam.loginLimits = [
|
security.pam.loginLimits = [
|
||||||
{ domain = "*"; item = "core"; type = "-"; value = "0"; }
|
{ domain = "*"; item = "core"; type = "-"; value = "0"; }
|
||||||
];
|
];
|
||||||
|
|
@ -58,7 +55,7 @@
|
||||||
RestrictAddressFamilies = "AF_UNIX AF_NETLINK";
|
RestrictAddressFamilies = "AF_UNIX AF_NETLINK";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Podman socket for all users
|
# Declaratively enable Podman socket for all users
|
||||||
systemd.user.sockets.podman.wantedBy = [ "sockets.target" ];
|
systemd.user.sockets.podman.wantedBy = [ "sockets.target" ];
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
|
|
@ -84,5 +81,7 @@
|
||||||
lynis
|
lynis
|
||||||
audit
|
audit
|
||||||
tcpdump
|
tcpdump
|
||||||
|
bandwhich
|
||||||
|
opensnitch-ui
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
users.users.asxpi = {
|
users.users.asxpi = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Sergei P";
|
description = "Sergei P";
|
||||||
extraGroups = [ "networkmanager" "wheel" "dialout" "libvirtd" "docker" ];
|
extraGroups = [ "networkmanager" "wheel" "dialout" "libvirtd" "podman" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
# Internet
|
# Internet
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue