Scripting source address change
I have a few hundred firewalls in place. I am changing ISPs. I need to add my new IPs, add them to an IP group, and update a pre-existing policy's source address to the name of my new IP group. I do not always know the name of the old IP group. I do not know which policy will need to be modified by it's number. My current plan is to push out a scipt via FortiCloud to make these changes.
I do know a specific set of characters that will be in the srcaddress field (IP Group) of the policy. The policy is for port forwarding to a specific internal IP that will be variable. I was wondering if it were possible to edit the srcaddress field by doing something like 'show firewall policy | grep -i abc' to pull the field I need to update and then run set srcaddress or rename in such a way that it would replace the policy's source address with my new IP group name.
Alternatively, can I append IPs to an unknown IP group name that I can character match? If so, how?
I know this won't work but this is the sort of logic I'm going for.
configure firewall policy
rename srcaddress='grep -i abc' "New IP group"
Open to other suggestions outside of this. Goal is to mass update firewalls with new WAN IP information and update an existing VIP/port forward policy of unknown name/number. Existing IP group name is variable but could be character matched via grep.
