about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2020-03-22 08:31:50 +0000
committerGitHub <noreply@github.com>2020-03-22 08:31:50 +0000
commit2edf67b62f91f2e51ae53f692ae113a23beee039 (patch)
treecedcaba027578c562dec591c9d4f1f7bbb6c56f4 /nixos
parentbb9cf0f369a329606c9584fcc56e1f31cf3007e6 (diff)
parentc75398b10a23fe19408026b455b20a1961af3917 (diff)
downloadnixlib-2edf67b62f91f2e51ae53f692ae113a23beee039.tar
nixlib-2edf67b62f91f2e51ae53f692ae113a23beee039.tar.gz
nixlib-2edf67b62f91f2e51ae53f692ae113a23beee039.tar.bz2
nixlib-2edf67b62f91f2e51ae53f692ae113a23beee039.tar.lz
nixlib-2edf67b62f91f2e51ae53f692ae113a23beee039.tar.xz
nixlib-2edf67b62f91f2e51ae53f692ae113a23beee039.tar.zst
nixlib-2edf67b62f91f2e51ae53f692ae113a23beee039.zip
Merge pull request #82801 from Izorkin/fail2ban
nixos/fail2ban: add warning if work fail2ban without firewall
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/security/fail2ban.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/services/security/fail2ban.nix b/nixos/modules/services/security/fail2ban.nix
index cb748c93d24e..976b01fd10ee 100644
--- a/nixos/modules/services/security/fail2ban.nix
+++ b/nixos/modules/services/security/fail2ban.nix
@@ -216,6 +216,10 @@ in
 
   config = mkIf cfg.enable {
 
+    warnings = mkIf (config.networking.firewall.enable == false || config.networking.nftables.enable == false) [
+      "fail2ban can not be used without a firewall"
+    ];
+
     environment.systemPackages = [ cfg.package ];
 
     environment.etc = {