# mbaniadam/firewall-auto-add-or-remove-objects architecture

> Architecture diagram of the GitHub repository mbaniadam/firewall-auto-add-or-remove-objects, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mbaniadam/firewall-auto-add-or-remove-objects
- Repository: https://github.com/mbaniadam/firewall-auto-add-or-remove-objects

## Overview

This is a command-line firewall administration tool. An operator selects an action; the script uses IP_LIST.csv and inventory.yml to validate requested addresses and apply changes through supported vendor interfaces, or to search Fortinet policies and report matches. The principal stages are input, validation, vendor-specific operations, and policy lookup. The sampled source is one large, partially excerpted script, so the graph keeps implementation nodes on that file and omits uncertain internal call links; README-documented workflow links are cited to the README.

Main entry points: [`multivendor_add_remove_objects.py`](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py) (Interactive CLI), [`IP_LIST.csv`](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/IP_LIST.csv) (IP List), [`inventory.yml`](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/inventory.yml) (Firewall Inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and Validation"]
  node_cli["Interactive CLI"]
  node_ip_list["IP List<br/>[IP_LIST.csv]"]
  node_inventory["Firewall Inventory<br/>[inventory.yml]"]
  node_validation["IP Validation"]
end

subgraph group_changes["Address Group Changes"]
  node_junos["Juniper JunOS SSH"]
  node_screenos["Juniper ScreenOS SSH"]
  node_fortigate["FortiGate API Changes"]
  node_sophos["Sophos API Changes"]
end

subgraph group_policies["Policy Search"]
  node_policy_search["Fortinet Policy Search"]
  node_policy_report["Policy Results"]
end

node_operator(("Operator"))
node_firewalls[("Configured Firewalls")]

node_operator -->|"runs and selects"| node_cli
node_cli -->|"reads addresses"| node_ip_list
node_cli -->|"reads credentials"| node_inventory
node_cli -->|"validates IPs"| node_validation
node_cli -.->|"dispatches changes"| node_junos
node_cli -.->|"dispatches changes"| node_screenos
node_cli -.->|"dispatches changes"| node_fortigate
node_cli -.->|"dispatches changes"| node_sophos
node_junos -->|"configures by SSH"| node_firewalls
node_screenos -->|"configures by SSH"| node_firewalls
node_fortigate -->|"updates by API"| node_firewalls
node_sophos -->|"updates by API"| node_firewalls
node_cli -->|"selects lookup"| node_policy_search
node_policy_search -->|"reads addresses"| node_ip_list
node_policy_search -->|"gets API settings"| node_inventory
node_policy_search -->|"requests policies"| node_firewalls
node_policy_search -->|"writes matches"| node_policy_report

click node_cli "https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py"
click node_ip_list "https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/IP_LIST.csv"
click node_inventory "https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/inventory.yml"
click node_validation "https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py"
click node_junos "https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py"
click node_screenos "https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py"
click node_fortigate "https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py"
click node_sophos "https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py"
click node_policy_search "https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_ip_list,node_inventory,node_validation toneBlue
class node_junos,node_screenos,node_fortigate,node_sophos,node_firewalls toneAmber
class node_policy_search,node_policy_report toneMint
class node_operator toneIndigo
```

## Components

### Inputs and Validation

- [Interactive CLI](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py): `multivendor_add_remove_objects.py`
- [IP List](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/IP_LIST.csv): `IP_LIST.csv`
- [Firewall Inventory](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/inventory.yml): `inventory.yml`
- [IP Validation](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py): `multivendor_add_remove_objects.py`

### Address Group Changes

- [Juniper JunOS SSH](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py): `multivendor_add_remove_objects.py`
- [Juniper ScreenOS SSH](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py): `multivendor_add_remove_objects.py`
- [FortiGate API Changes](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py): `multivendor_add_remove_objects.py`
- [Sophos API Changes](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py): `multivendor_add_remove_objects.py`

### Policy Search

- [Fortinet Policy Search](https://github.com/mbaniadam/firewall-auto-add-or-remove-objects/blob/main/multivendor_add_remove_objects.py): `multivendor_add_remove_objects.py`
- **Policy Results**

### Other components

- **Operator**
- **Configured Firewalls**

## Connections

- Operator → Interactive CLI: runs and selects (evidence: `README.md`)
- Interactive CLI → IP List: reads addresses (evidence: `README.md`)
- Interactive CLI → Firewall Inventory: reads credentials (evidence: `README.md`)
- Interactive CLI → IP Validation: validates IPs (evidence: `README.md`)
- Interactive CLI → Juniper JunOS SSH: dispatches changes (evidence: `multivendor_add_remove_objects.py`)
- Interactive CLI → Juniper ScreenOS SSH: dispatches changes (evidence: `multivendor_add_remove_objects.py`)
- Interactive CLI → FortiGate API Changes: dispatches changes (evidence: `multivendor_add_remove_objects.py`)
- Interactive CLI → Sophos API Changes: dispatches changes (evidence: `multivendor_add_remove_objects.py`)
- Juniper JunOS SSH → Configured Firewalls: configures by SSH (evidence: `README.md`)
- Juniper ScreenOS SSH → Configured Firewalls: configures by SSH (evidence: `README.md`)
- FortiGate API Changes → Configured Firewalls: updates by API (evidence: `README.md`)
- Sophos API Changes → Configured Firewalls: updates by API (evidence: `README.md`)
- Interactive CLI → Fortinet Policy Search: selects lookup (evidence: `README.md`)
- Fortinet Policy Search → IP List: reads addresses (evidence: `README.md`)
- Fortinet Policy Search → Firewall Inventory: gets API settings (evidence: `README.md`)
- Fortinet Policy Search → Configured Firewalls: requests policies (evidence: `README.md`)
- Fortinet Policy Search → Policy Results: writes matches (evidence: `multivendor_add_remove_objects.py`)
