f5devcentral / f5-automation-config-converter

Convert BIG-IP configs to AS3 and DO declarations
https://clouddocs.f5.com/products/extensions/f5-automation-config-converter/latest/
Apache License 2.0
35 stars 14 forks source link

Firewall policy causing failures in ACC - DO conversion - adding config for workaround #95

Open samualblair opened 1 year ago

samualblair commented 1 year ago

Environment

Summary

A clear and concise description of what the bug is. Please also include information about the reproducibility and the severity/impact of the issue.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Convert following config:

    security firewall policy /Common/Test {
    rules {
        block_ping {
            action drop
            ip-protocol icmp
            log yes
        }
    }
    }
  2. Observe the following error message:

    
    26 [2023-01-16T17:54:54.549Z] [ERROR]: f5.chariot.convertDO failed with [TypeError: Cannot read properties of undefined (reading 'addressLists')
    at /Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/node_modules/f5-automation-config-converter/src/lib/DO/doCustomMaps.js:131:36
    at Array.forEach (<anonymous>)
    at /Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/node_modules/f5-automation-config-converter/src/lib/DO/doCustomMaps.js:130:60
    at Array.forEach (<anonymous>)
    at /Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/node_modules/f5-automation-config-converter/src/lib/DO/doCustomMaps.js:129:37
    at Array.map (<anonymous>)
    at Object.customHandling (/Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/node_modules/f5-automation-config-converter/src/lib/DO/doCustomMaps.js:121:52)
    at /Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/node_modules/f5-automation-config-converter/src/engines/doConverter.js:210:64
    at Array.forEach (<anonymous>)
    at /Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/node_modules/f5-automation-config-converter/src/engines/doConverter.js:116:21
    at Array.forEach (<anonymous>)
    at module.exports (/Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/node_modules/f5-automation-config-converter/src/engines/doConverter.js:112:26)
    at mainRunner (/Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/node_modules/f5-automation-config-converter/src/main.js:42:22)
    at Object.mainAPI (/Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/node_modules/f5-automation-config-converter/src/main.js:136:30)
    at /Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/out/extension.js:122:61
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /Users/michaelj/.vscode/extensions/f5devcentral.vscode-f5-chariot-1.21.0/out/extension.js:113:20]

### Expected Behavior
This (and others) taken from a running F5.
Expected behavior would be to be able to run a conversion and receive output.
Possibly using defaults or empty blocks that need to be filled in. Instead no conversion happens.

### Actual Behavior
Conversion fails, no output is generated.

As a workaround it appears several fields need to be added for a conversion to not to completely fail.

For example this modified configuration does not fail (added description, source list and destination list).

security firewall address-list /Common/temp_source__fw_address_list_for_acc_conversion { addresses { 1.1.1.1/32 { } 1.1.1.2/32 { } } }

security firewall address-list /Common/temp_dest_fw_address_list_for_acc_conversion { addresses { 1.1.1.3/32 { } 1.1.1.4/32 { } } } security firewall policy /Common/Test { rules { block_ping { action drop ip-protocol icmp log yes description "temp placeholder description" source { address-lists { temp_source__fw_address_list_for_acc_conversion } } destination { address-lists { temp_dest_fw_address_list_for_acc_conversion } } } } }