# cayu/network-tools architecture

> Architecture diagram of the GitHub repository cayu/network-tools, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cayu/network-tools
- Repository: https://github.com/cayu/network-tools

## Overview

##### Project type and purpose
- This is a collection of networking‐maintenance and security‐auditing tools (a CLI “toolkit”) rather than a classic front-end/back-end application.
- It bundles three main components:
- auditoria: Python/Rust scripts for device inventory and compliance checks (e.g., Fortigate SOX audits, MAC‐to‐vendor lookup)
- minicom: serial‐port configuration profiles for connecting to various network devices (Cisco, Aruba, Fortinet, etc.)
- wazuh: custom decoders and rules to feed device logs into a Wazuh SIEM manager

##### Main components
a. User Workstation (where the CLI tools and configs live)
b. auditoria module
- FortigateSOX.py (Python script)
- inventario/mac_fabricante_pcap.rs (Rust‐based PCAP parser for inventory)
c. minicom profiles
- Serial console settings for each vendor
d. Network Devices
- Firewalls (Fortigate), switches (Cisco, Aruba, Extreme…), other vendors
e. Wazuh Manager
- custom_fortigate_decoders.xml
- custom_fortigate_rules.xml
f. Centralized SIEM / Log Storage (could be Elasticsearch, Splunk, etc.)

##### Relationships and data flows
- The User Workstation invokes auditoria scripts over SSH or API to network devices → gathers configurations, PCAPs, compliance status → optionally stores local reports.
- For out‐of‐band console access, the User Workstation uses minicom with the appropriate profile → serial connection to devices.
- Devices forward syslogs or audit logs to the Wazuh Manager → Wazuh applies the custom decoders/rules → alerts and parsed events are sent onward to the SIEM/Log Storage.

##### Architectural patterns & design principles
- Modular CLI toolkit: each folder is a standalone “plugin” or profile set.
- Separation of concerns:
- auditoria for active audits/inventory
- minicom for interactive console access
- wazuh for passive log‐analysis integration
- Configuration‐as‐code: profiles and rules are versioned alongside scripts.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User workstation orchestrator
    WS["User Workstation\n(CLI Orchestrator)"]:::workstation

    %% Auditoria module
    subgraph "auditoria Module" 
        direction TB
        AF["Fortigate SOX Audit Script\n(Python)"]:::python
        AP["Rust PCAP Inventory Parser\n(mac_fabricante_pcap.rs)"]:::rust
    end

    %% Minicom profiles
    subgraph "Serial Console Profiles\n(minicom)" 
        direction TB
        M1["3Com 5500 Profile"]:::profile
        M2["3Com 7700 Profile"]:::profile
        M3["Aruba Switch Profile"]:::profile
        M4["Check Point Profile"]:::profile
        M5["Cisco 2960 Profile"]:::profile
        M6["Cisco SF300 Profile"]:::profile
        M7["Dinstar Profile"]:::profile
        M8["Extreme Profile"]:::profile
        M9["Fortinet Profile"]:::profile
    end

    %% Wazuh integration configs
    subgraph "Wazuh-SIEM Integration\n(wazuh)" 
        direction TB
        WZ1["Custom Fortigate Decoders\n(XML)"]:::xml
        WZ2["Custom Fortigate Rules\n(XML)"]:::xml
    end

    %% External systems
    subgraph "Network Devices" 
        direction TB
        ND1["Firewalls\n(Fortigate)"]:::device
        ND2["Switches\n(Cisco, Aruba, Extreme…)"]:::device
        ND3["Other Vendors"]:::device
    end

    WSMgmt["Wazuh Manager"]:::external
    SIEM["SIEM / Log Storage\n(Elasticsearch, Splunk)"]:::storage

    %% Connections from workstation to modules
    WS --> AF
    WS --> AP
    WS --> M1
    WS --> M2
    WS --> M3
    WS --> M4
    WS --> M5
    WS --> M6
    WS --> M7
    WS --> M8
    WS --> M9
    WS --> WZ1
    WS --> WZ2

    %% Data flows
    AF -->|"SSH/API calls"| ND1
    AF -->|"SSH/API calls"| ND2
    AF -->|"SSH/API calls"| ND3
    AP -->|"SSH/API calls"| ND1
    AP -->|"SSH/API calls"| ND2
    AP -->|"SSH/API calls"| ND3
    M1 -->|"Serial RS-232"| ND1
    M2 -->|"Serial RS-232"| ND2
    M3 -->|"Serial RS-232"| ND2
    M4 -->|"Serial RS-232"| ND3
    M5 -->|"Serial RS-232"| ND2
    M6 -->|"Serial RS-232"| ND2
    M7 -->|"Serial RS-232"| ND3
    M8 -->|"Serial RS-232"| ND2
    M9 -->|"Serial RS-232"| ND1

    %% Devices to Wazuh Manager
    ND1 -->|"Syslog"| WSMgmt
    ND2 -->|"Syslog"| WSMgmt
    ND3 -->|"Syslog"| WSMgmt

    %% Wazuh configs to Wazuh Manager
    WZ1 --> WSMgmt
    WZ2 --> WSMgmt

    %% Wazuh Manager to SIEM
    WSMgmt -->|"Alerts & Parsed Events"| SIEM

    %% Click events
    click WS "https://github.com/cayu/network-tools/blob/master/README.md"
    click AF "https://github.com/cayu/network-tools/blob/master/auditoria/FortigateSOX.py"
    click AP "https://github.com/cayu/network-tools/blob/master/auditoria/inventario/mac_fabricante_pcap.rs"
    click M1 "https://github.com/cayu/network-tools/blob/master/minicom/minirc.3com-5500"
    click M2 "https://github.com/cayu/network-tools/blob/master/minicom/minirc.3com-7700"
    click M3 "https://github.com/cayu/network-tools/blob/master/minicom/minirc.aruba-switch"
    click M4 "https://github.com/cayu/network-tools/blob/master/minicom/minirc.checkpoint"
    click M5 "https://github.com/cayu/network-tools/blob/master/minicom/minirc.cisco-2960"
    click M6 "https://github.com/cayu/network-tools/blob/master/minicom/minirc.cisco-sf300"
    click M7 "https://github.com/cayu/network-tools/blob/master/minicom/minirc.dinstar"
    click M8 "https://github.com/cayu/network-tools/blob/master/minicom/minirc.extreme"
    click M9 "https://github.com/cayu/network-tools/blob/master/minicom/minirc.fortinet"
    click WZ1 "https://github.com/cayu/network-tools/blob/master/wazuh/custom_fortigate_decoders.xml"
    click WZ2 "https://github.com/cayu/network-tools/blob/master/wazuh/custom_fortigate_rules.xml"

    %% Styles
    classDef workstation fill:#D6EAF8,stroke:#2980B9,color:#17202A;
    classDef python fill:#FADBD8,stroke:#E74C3C,color:#641E16;
    classDef rust fill:#E8DAEF,stroke:#8E44AD,color:#4A235A;
    classDef xml fill:#FEF9E7,stroke:#F1C40F,color:#7D6608;
    classDef profile fill:#D5F5E3,stroke:#27AE60,color:#145A32;
    classDef device fill:#F5B7B1,stroke:#C0392B,color:#641E16;
    classDef external fill:#D5DBDB,stroke:#566573,color:#1B2631;
    classDef storage fill:#FCF3CF,stroke:#F39C12,color:#784212;
```
