Fortigate scripting

I'm looking to create a script to add ip addresses to an existing block list on a fortigate.  I believe I need to do it is bash or possibly perl.  I'm running alienvault and am trying to execute an action to block an ip as a result of an alarm event.  It would need to connect to the fortigate via ssh and run the script with variables pulled from alienvault
bsjj2727Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

btanExec ConsultantCommented:
May consider
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.
Ref the CLI guide (old though) - see "config firewall" http://ftp.tc.edu.tw/TC_public/conference/product/wp_FortiGate_v2_80_cli_ref_guide.pdf
This example shows how to create an address called User_Network, with an IP address and mask,
and create an address called User_Range, with an IP address range.

config firewall address
edit User_Network
set type ipmask
set subnet 192.168.1.0 255.255.255.0
next
edit User_Range
set type iprange
set start_ip 13.1.1.10
set end_ip 13.1.1.30
end

This example shows how to display the firewall address list.
get firewall address

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.