This project is a proof-of-concept for an AI-powered agent that analyzes the health of IPsec tunnels from a FortiGate firewall. It provides a user-friendly web interface built with Gradio to display the analysis, summarize the tunnel status, and suggest actions.
- Tunnel Health Analysis: Fetches IPsec tunnel data from a FortiGate firewall.
- AI-Powered Summary: Uses a large language model to generate a human-readable summary of the tunnel status.
- Action Proposals: Suggests actions to be taken based on the analysis.
- Web-Based UI: Provides a simple and interactive web interface for analysis and actions.
-
Prerequisites:
- Python 3.x
- Access to a FortiGate firewall with the REST API enabled.
- Access to a Large Language Model (LLM) with an API endpoint.
-
Installation:
-
Clone the repository:
git clone https://github.com/GauravASY/IPSec_Tunnel_Agent_v2.git cd IPSec_Tunnel_Agent_v2 -
Create a virtual environment:
python -m venv .venv
-
Activate the virtual environment:
- On Windows:
.venv\Scripts\activate
- On macOS and Linux:
source .venv/bin/activate -
Install the required Python packages:
pip install -r requirements.txt
-
-
Environment Variables:
- Create a
.envfile in the root of the project and add the following environment variables:FW_HOST=<your-firewall-host> FW_TOKEN=<your-firewall-api-token> LMAAS_URL=<your-llm-api-url> LMAAS_KEY=<your-llm-api-key> MODEL=<your-llm-model-name>
- Create a
-
Running the Application:
- Execute the
main.pyscript:python main.py
- Open your web browser and navigate to the URL provided by Gradio (usually
http://127.0.0.1:7860).
- Execute the
- The application fetches IPsec tunnel data from the FortiGate firewall's API.
- The data is then sent to a large language model to generate a summary of the tunnel health.
- The application also uses the LLM to propose actions based on the status of the tunnels.
- The summary and proposed actions are displayed in a Gradio web interface.
- The user can approve or deny the proposed actions from the UI.