Hello everyone,
I wanted to share with you a tool that we developed to help us automate a big part of a project.
Long story short, we needed to migrate many virtual context from ASA to VSX. As you may know adding static routes and interfaces to a VS can be cumbersome. Especially if you have firewalls with +100 interfaces and +300 routes 😀
The tool was developed in Golang and is open source.
Keep in mind that this tool was developed for our use case, maybe you need to tinker around a bit regarding interfaces names. For example, you may need to replace "bond" with "eth"
Feel free to fork it if you need.
Download: ASAtoVSX Parser - Molten Minds Github
Current features (Tested with ASA Version 9.4(4)5 and Check Point R80.30)
- Translates interfaces to vsx_provisioning_tool language
- Translates static routes to vsx_provisioning_tool language
- Marks with # when an interface is down
- Generates a vsx_provisioning_tool output with interfaces and static routes
- Generates a JSON file containing all the interfaces
- Generates a JSON file containing all the routes
Translation examples
| ASA | Check Point (vsx_provisioning_tool) |
Interface | interface Port-channelY.XX description *** nameif IFNAME security-level 30 ip address 172.**.**.** 255.255.128.0 ! | add interface name bondY.XX ip 172.**.**.** netmask 255.255.128.0 |
Interface (Shutdown) | Caso interfaz down interface Port-channelY.XX description IFNAME shutdown nameif IFNAME security-level 30 ip address 10.**.**.** 255.255.255.248 ! | #add interface name bondY.XX ip 10.**.**.** netmask 255.255.255.248 |
Static route | route IFNAME 10.**.**.** 255.255.255.255 10.**.**.** 1 | add route destination 10.**.**.** netmask 255.255.255.255 next_hop 10.**.**.** |
Default route | route OUTSIDE 0.0.0.0 0.0.0.0 181.**.**.** 1 | add route destination default next_hop 186.**.**.** |
Usage
Usage is really simple.
1) Download the executable file from Github or compile the code yourself
2) Extract running config and save it as a text file with UTF-8 format . At the moment the tool only allow inputs in this format.
![parser1.png parser1.png](https://community.checkpoint.com/t5/image/serverpage/image-id/4070iB7006ACCAFC483F7/image-size/large?v=v2&px=999)
3) Using PowerShell execute the program command with the desired input file.
![parser2.png parser2.png](https://community.checkpoint.com/t5/image/serverpage/image-id/4071iF619FBA4B7E09422/image-size/large?v=v2&px=999)
4) Check the output files
![parser3.png parser3.png](https://community.checkpoint.com/t5/image/serverpage/image-id/4072iD9B9F72CF627A577/image-size/large?v=v2&px=999)
vsx_provisioning_tool sample output
![parser4.png parser4.png](https://community.checkpoint.com/t5/image/serverpage/image-id/4073i3E903E5F74A14194/image-size/large?v=v2&px=999)
Interfaces JSON output
![parser5.png parser5.png](https://community.checkpoint.com/t5/image/serverpage/image-id/4074iF5FB25DBA3364C7D/image-size/large?v=v2&px=999)
Routes JSON output
![parser6.png parser6.png](https://community.checkpoint.com/t5/image/serverpage/image-id/4075i14574159CE955379/image-size/large?v=v2&px=999)
5) Add the desired header on the VSX output for vsx_provisioning_tool to create de VS. Example: add vd name VS-Name vsx VSX-FW instances 1 main_ip 172.1.2.3
6) Put the script in the management server that manages the involved VSX and use vsx_provisioning_tool to execute it
7) Verify the new VS and push policy.
Lab
Sample VSX Lab prior script
![Example1.png Example1.png](https://community.checkpoint.com/t5/image/serverpage/image-id/4076i559AA6B8BB9C3F3A/image-size/large?v=v2&px=999)
After we move the generated script to the management server we execute it.
If any of the commands fail then the transaction will be canceled and reversed.
User and passwords are for demonstration purposes only 😀
![example2.png example2.png](https://community.checkpoint.com/t5/image/serverpage/image-id/4077i86CF75C6DE128E3E/image-size/large?v=v2&px=999)
Now check your VS and push policy
![example3.png example3.png](https://community.checkpoint.com/t5/image/serverpage/image-id/4078iEC85B41C9F971881/image-size/large?v=v2&px=999)
____________
https://www.linkedin.com/in/federicomeiners/