Skip to content

minaa66/Morad_same_firewall_migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Firewall Configuration Migration Tool

A Flask-based web application that automates the migration of firewall configurations across different vendors. This tool simplifies the complex process of translating network interface mappings and firewall rules from one platform to another.

Overview

The Firewall Configuration Migration Tool provides a user-friendly interface for:

  • Configuration Parsing: Automatically parse firewall configurations from multiple vendors
  • Interface Mapping: Interactively map interfaces from old firewalls to new hardware
  • Configuration Generation: Generate new configurations with updated interface mappings
  • Export: Download the migrated configuration ready for deployment

Supported Firewall Vendors

  • Cisco (IOS, ASA)
  • Fortinet FortiGate
  • Palo Alto Networks
  • Check Point
  • Juniper Networks
  • SonicWall
  • pfSense

Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Installation

  1. Clone the repository

    git clone https://github.com/minaa66/Morad_same_firewall_migration.git
    cd Morad_same_firewall_migration
  2. Create a virtual environment (recommended)

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt

Running the Application

Linux/macOS:

python app.py

Windows:

python app.py

Or use the provided batch script:

start_firewall_tool.bat

The application will be available at: http://localhost:5000

Features

✨ Multi-Vendor Support: Parse and migrate configurations from 7 different firewall vendors

πŸ”„ Automatic Interface Mapping: Intelligent algorithms for suggesting interface mappings based on configuration analysis

🎨 Interactive Web UI: Intuitive step-by-step workflow for configuration migration

πŸ“Š Session Management: Secure file-based session storage for handling large configurations

βœ… Validation: Built-in validation checks to warn about potential issues

πŸ“₯ Bulk Upload: Support for multiple file formats (.txt, .cfg, .conf, .config)

πŸ“€ Export Ready: Download migrated configurations in standard format

Project Structure

β”œβ”€β”€ app.py                          # Main Flask application
β”œβ”€β”€ requirements.txt                # Python dependencies
β”œβ”€β”€ core/                           # Core migration logic
β”‚   β”œβ”€β”€ config_generator.py         # Configuration generation engine
β”‚   β”œβ”€β”€ interface_mapper.py         # Interface mapping logic
β”‚   └── session_manager.py          # File-based session management
β”œβ”€β”€ parsers/                        # Vendor-specific parsers
β”‚   β”œβ”€β”€ cisco_parser.py
β”‚   β”œβ”€β”€ fortigate_parser.py
β”‚   β”œβ”€β”€ paloalto_parser.py
β”‚   β”œβ”€β”€ checkpoint_parser.py
β”‚   β”œβ”€β”€ juniper_parser.py
β”‚   β”œβ”€β”€ sonicwall_parser.py
β”‚   └── pfsense_parser.py
β”œβ”€β”€ templates/                      # HTML templates for web interface
β”œβ”€β”€ uploads/                        # Temporary file storage
β”œβ”€β”€ sample_configs/                 # Example configuration files
β”œβ”€β”€ create_shortcut.bat             # Windows shortcut creation script
β”œβ”€β”€ start_firewall_tool.bat         # Windows startup script
└── python-3.14.0-amd64.exe        # Python runtime (Windows)

Migration Workflow

  1. Upload Configurations - Upload old and new firewall configuration files
  2. Select Vendor - Choose the firewall vendor type
  3. Map Interfaces - Review and adjust automatic interface mappings
  4. Validate - Verify all mappings are correct
  5. Preview - Review the generated configuration
  6. Export - Download the migrated configuration file

Key Components

app.py

Main Flask application handling:

  • Routes and request processing
  • File upload management
  • Session management
  • Configuration workflow orchestration

core/interface_mapper.py

Handles:

  • Automatic interface mapping generation
  • Mapping validation
  • Conflict detection and warnings

core/config_generator.py

Responsible for:

  • Reading original configurations
  • Applying interface mappings
  • Generating new firewall configurations

core/session_manager.py

Manages:

  • File-based session storage
  • Large configuration data handling
  • Session cleanup and lifecycle

parsers/

Vendor-specific parser modules:

  • Parse interface configurations
  • Extract relevant network settings
  • Standardize data format for processing

Configuration Files

  • requirements.txt - Python package dependencies (Flask, Werkzeug, etc.)
  • Sample configurations in sample_configs/ directory for testing

Supported File Formats

  • .txt - Text files
  • .cfg - Configuration files
  • .conf - Configuration files
  • .config - Configuration files

Maximum file size: 10MB

Error Handling

The application includes comprehensive error handling for:

  • Invalid file formats
  • Missing interface data
  • File size violations
  • Session expiration
  • Configuration parsing errors

Security Features

  • Secure filename handling
  • File upload validation
  • Session-based data storage
  • File size limits (10MB)
  • Temporary file cleanup

Browser Compatibility

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

API Endpoints

Endpoint Method Description
/ GET Main landing page
/upload GET, POST Upload old and new configuration files
/mapping GET Interactive interface mapping interface
/update_mapping POST Update interface mappings via AJAX
/validate_mappings GET Validate current mappings
/preview GET Preview generated configuration
/export GET Export final configuration file
/cleanup_session GET Clean up session data

Troubleshooting

Port Already in Use

If port 5000 is already in use, modify the port in app.py:

app.run(debug=True, host='0.0.0.0', port=5001)

Missing Dependencies

Ensure all requirements are installed:

pip install --upgrade -r requirements.txt

File Upload Issues

  • Verify file format is supported (.txt, .cfg, .conf, .config)
  • Check file size is under 10MB
  • Ensure both old and new configuration files are selected

Performance

  • Handles configurations up to 10MB
  • File-based session storage for scalability
  • Optimized interface mapping algorithms
  • Real-time validation feedback

Future Enhancements

  • Database-backed session storage
  • Advanced configuration validation rules
  • Support for additional firewall vendors
  • Batch processing capabilities
  • Configuration comparison tools
  • API endpoints for programmatic access

License

This project is provided as-is for firewall configuration migration purposes.

Support

For issues, questions, or contributions, please open an issue on GitHub.

Author

Created by minaa66


Last Updated: 2026-03-20 16:13:56

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors