forked from fabian/nix
		
	add vpn addresses to fail2ban whitelist
This commit is contained in:
		
							parent
							
								
									4a7bda944f
								
							
						
					
					
						commit
						7f692459a9
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		|  | @ -3,7 +3,9 @@ | |||
|   pkgs, | ||||
|   ... | ||||
| }: | ||||
| with lib; { | ||||
| with lib; let | ||||
|   inherit (config.local.sys) nets; | ||||
| in { | ||||
|   networking = { | ||||
|     nftables.enable = false; # learn how to use this later | ||||
|     firewall = { | ||||
|  | @ -52,7 +54,11 @@ with lib; { | |||
|     fail2ban = { | ||||
|       enable = true; | ||||
|       bantime = "10m"; | ||||
|       ignoreIP = ["37.205.12.34"]; # Never ban the server's own IP | ||||
|       ignoreIP = [ | ||||
|         nets.default.hosts.vps.v6.cidr | ||||
|         nets.default.hosts.vps.v4.address | ||||
|         nets.vpn.v6.cidr | ||||
|       ]; | ||||
|       bantime-increment = { | ||||
|         enable = true; | ||||
|         formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)"; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue