Manage blacklist in CLI
First of all, thanks for the help.
I do not use Fortinet much, but I have a problem handling a simple Blacklist.
My idea is to connect SIEM, Fail2ban, TOR exit nodes and other internal systems to Fortigate via SSH. Create a policy, a group of addresses and run, as is done with other manufacturers.
I've mounted a script that does that, it passes an ip, and creates it as an object and puts it in a group:
https://github.com/kinomakino/Ban-ip-Bash-Scripts/blob/master/ban_fortinet.sh
Now I have several problems:
1.- the maximum limits for Fortigat in groups of addresses is 300. VERY LOW.
If for example I want to block all the nodes out of the TOR network every night (one of the things I need to implement in Forti) I can not do it.
2.- In the case of making a "stack", I do not know how to list in CLI the current ip addresses in a group and have that data in bash to handle loops and conditions.
3.- I can not "remove" all the ip addresses of a group from CLI, because it tells me that they are in use (by the policy). If I follow this path, I would have to delete policy, delete group, delete ip and re-generate it All in CLI, all that in bash ... something complex. Also, I have the ID problem of the policy that would not always be the same and I would have to calculate it.
How are you doing this management? The one of maintaining an external blacklist for the typical bans of bots, portscans,etc.
Thanks for all !!!
