Untangle Configuration Using Scripts - micahgrinnell/CC-Capstone-Project GitHub Wiki

Overview

This page is for those who wish to configure Untangle's NG Firewall using scripts rather than the GUI. The guide for configuration using the web interface can be found at Untangle Configuration Using GUI. After using both the GUI and scripts, I strongly recommend using the web interface due to its simplicity and accessibility. NGFW doesn't really directly support automation or Ansible, but the resources for using python scripts are available on the NGFW Github. I spent much time trying to understand how to use these python files but failed to arrive at something substantial. I also tried writing a bash script, but bash and JSON don't get along very well so I decided on Powershell as that's where most of my experience lies.

Configuring the device via scripts that are run from the router seemed out of scope and extremely underdocumented. Instead, I decided using scripts to create configuration files seemed much more useful. The final script I came up with takes IPs from a CSV, converts the information into the JSON rule format, and then saves the list of rules to a JSON file. It offers 3 rule types to choose from in a formated menu: Firewall, NAT, and Filter. The user can then import these files directly to the Untangle web GUI.

Powershell script:

ngfwfiles.ps1