glennake / DirectFire_Converter

DirectFire Firewall Converter - Network Security, Next-Generation Firewall Configuration Conversion, Firewall Syntax Translation and Firewall Migration Tool - supports Cisco ASA, Fortinet FortiGate (FortiOS), Juniper SRX (JunOS), SSG / Netscreen (ScreenOS) and WatchGuard (support for further devices in development). Similar to FortiConverter, SmartMove, Expedition etc.
GNU General Public License v3.0
50 stars 17 forks source link

Watchguard error #4

Closed rackbreaker closed 3 years ago

rackbreaker commented 3 years ago

Hi. I started to use the tool to migrate a configuration from watchguard to fortigate, but I get this error:

python3 converter.py -c XTM850-backup-convertido3.xml -s watchguard -d fortigate Traceback (most recent call last): File "converter.py", line 236, in main(src_format=args.source, dst_format=args.destination, routing_info=args.routing) File "converter.py", line 212, in main parsed_data = parse( File "converter.py", line 110, in parse parsed_data = parse(logger, src_config, routing_info) File "/Users/rackbreaker/DirectFire_Converter/DirectFire/Converter/parsers/watchguard.py", line 134, in parse if physical_interface.find("ip-node-type").text == "IP4_ONLY": AttributeError: 'NoneType' object has no attribute 'text'

I'm trying to figure out what's going on. Thank you very much for your work

glennake commented 3 years ago

Hi @rackbreaker,

Thanks for raising this.

Ive added some additional logging in the code, can you pull the latest from git and run again?

Then share your latest log from: /Users/rackbreaker/DirectFire_Converter/logs/yyyymmdd_hhmmss_watchguard_fortigate.log

Thanks, Glenn

rackbreaker commented 3 years ago

Hello!

I pull the new version, in console:

python3 converter.py -c XTM850-backup-convertido3.xml -s watchguard -d fortigate Traceback (most recent call last): File "converter.py", line 236, in main(src_format=args.source, dst_format=args.destination, routing_info=args.routing) File "converter.py", line 222, in main dst_config = generate(dst_format=dst_format, parsed_data=parsed_data) File "converter.py", line 151, in generate dst_config = generate(logger, parsed_data) File "/Users/rackbreaker/DirectFire_Converter/DirectFire/Converter/generators/fortigate.py", line 68, in generate if attributes["type"] == "interface": KeyError: 'type'

And Log is attached

glennake commented 3 years ago

@rackbreaker

Thank you.

It's still not clear what the issue is. I have improved logging across the modules, so if you can pull the latest code, install the new requirements, run the converter and share the logs again that would be helpful.

The logs may contain some sensitive info, and the source configuration would be useful if possible too. Feel free to email them to glennake [at] live.co.uk

Thanks, Glenn

rackbreaker commented 3 years ago

Mail send!

glennake commented 3 years ago

Thanks, I have added some more fixes and replied to your email

Commit 1d306d78a9fd654e4f336c41b81501634ab331fc

glennake commented 3 years ago

Confirmed now working by email