Blocking a list of IP addresses?
FortiOS 5.2.2 on an FWF40
I'm looking for a way to block a fairly large, and dynamic, list of IP addresses, managed from the CLI. There will probably be 1000 or more individual IP addresses, in various places all over the Internet. The use case is that I want to use the denyhosts script on my Linux servers to detect brute-force attempts, and block the IP addresses it collects not just within the server, but at the Fortigate level.
With a small and static list of IP addresses, this is of course fairly straightforward:
- config firewall address for each of the addresses
- config firewall addrgroup and add each of the addresses to the group
- config firewall policy to deny all traffic from that group.
I don't think this approach scales well to a large list of IP addresses, nor does it lend itself to frequent updates.
Is there a better way I could accomplish the same thing?
