This script is designed to help you match and analyze security policies on a firewall based on source and destination IPs, as well as services. It uses the provided inputs to fetch security rules, addresses, services, and interface information from a firewall and then matches them against the provided criteria.
- Python 3.x
- Required Python libraries (you can install them using
pip):- requests
- ipaddress
- Clone or download this repository to your local machine.
- Navigate to the repository's directory in your terminal.
- Open the
match_policy.pyfile in a text editor. - Modify the following user inputs according to your requirements:
user_source_ip: Source IP address for matching.user_destination_ip: Destination IP address for matching.user_service: Service (port) for matching.
- Open your terminal and navigate to the repository's directory.
- Run the script using the command: python match_policy.py
The script will fetch security rules, address objects, service objects, interface information, and zone information from the firewall. It will then match the provided criteria against the retrieved data and print the results.
You'll need to provide the appropriate API endpoints in the endpoints dictionary of the match_policy.py script. These endpoints should correspond to your firewall's configuration.
- The script provides comments for each function and important block of code. Make sure to read and understand the code before running it.
- This script assumes that you have the necessary permissions and access to the firewall's API.
This project is licensed under the MIT License.