# nativelogxd/repositorio-pipeline-kitsune architecture

> Architecture diagram of the GitHub repository nativelogxd/repositorio-pipeline-kitsune, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nativelogxd/repositorio-pipeline-kitsune
- Repository: https://github.com/nativelogxd/repositorio-pipeline-kitsune

## Overview

Kitsune-py is an online network intrusion detector. Its main workflow accepts a packet capture or TSV, extracts packet features and incremental network statistics, then passes each feature vector through KitNET’s feature-mapping, training, and anomaly-scoring stages. The README also documents a Mirai demonstration that fits a log-score distribution and plots results. The sampled source supports the principal calls; unsampled feature-extraction details are represented only where the README or excerpts establish them.

Main entry points: [`FeatureExtractor.py`](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/FeatureExtractor.py) (Feature extractor), [`KitNET/KitNET.py`](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/KitNET/KitNET.py) (KitNET orchestrator), [`Kitsune.py`](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/Kitsune.py) (Kitsune facade), [`netStat.py`](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/netStat.py) (Traffic statistics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Packet ingestion"]
  node_extractor["Feature extractor"]
end

subgraph group_statistics["Network statistics"]
  node_netstat["Traffic statistics<br/>[netStat.py]"]
  node_afterimage["Incremental statistics<br/>[AfterImage.py]"]
end

subgraph group_detection["Anomaly detection"]
  node_facade["Kitsune facade<br/>[Kitsune.py]"]
  node_kitnet["KitNET orchestrator<br/>[KitNET.py]"]
  node_corclust["Feature clustering<br/>[corClust.py]"]
  node_autoencoder["Denoising autoencoder<br/>[dA.py]"]
  node_utils["Model utilities<br/>[utils.py]"]
  node_demo["Demo and score analysis<br/>[example.py]"]
end

node_capture(("Capture or TSV"))
node_tshark["tshark"]
node_scapy["Scapy"]

node_capture -->|"provides packets"| node_extractor
node_extractor -->|"parses capture"| node_tshark
node_extractor -->|"parses fallback"| node_scapy
node_extractor -->|"updates statistics"| node_netstat
node_netstat -->|"uses stream stats"| node_afterimage
node_facade -->|"initializes and reads"| node_extractor
node_facade -->|"processes vectors"| node_kitnet
node_kitnet -->|"updates and clusters"| node_corclust
node_kitnet -->|"trains and executes"| node_autoencoder
node_autoencoder -->|"uses activations"| node_utils
node_demo -->|"runs packet loop"| node_facade

click node_extractor "https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/FeatureExtractor.py"
click node_netstat "https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/netStat.py"
click node_afterimage "https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/AfterImage.py"
click node_facade "https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/Kitsune.py"
click node_kitnet "https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/KitNET/KitNET.py"
click node_corclust "https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/KitNET/corClust.py"
click node_autoencoder "https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/KitNET/dA.py"
click node_utils "https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/KitNET/utils.py"
click node_demo "https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/example.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_extractor toneBlue
class node_netstat,node_afterimage toneAmber
class node_facade,node_kitnet,node_corclust,node_autoencoder,node_utils,node_demo toneMint
class node_capture,node_tshark,node_scapy toneIndigo
```

## Components

### Packet ingestion

- [Feature extractor](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/FeatureExtractor.py): `FeatureExtractor.py`

### Network statistics

- [Traffic statistics](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/netStat.py): `netStat.py`
- [Incremental statistics](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/AfterImage.py): `AfterImage.py`

### Anomaly detection

- [Kitsune facade](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/Kitsune.py): `Kitsune.py`
- [KitNET orchestrator](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/KitNET/KitNET.py): `KitNET/KitNET.py`
- [Feature clustering](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/KitNET/corClust.py): `KitNET/corClust.py`
- [Denoising autoencoder](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/KitNET/dA.py): `KitNET/dA.py`
- [Model utilities](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/KitNET/utils.py): `KitNET/utils.py`
- [Demo and score analysis](https://github.com/nativelogxd/repositorio-pipeline-kitsune/blob/main/example.py): `example.py`

### Other components

- **Capture or TSV**
- **tshark**
- **Scapy**

## Connections

- Capture or TSV → Feature extractor: provides packets (evidence: `README.md`)
- Feature extractor → tshark: parses capture (evidence: `FeatureExtractor.py`)
- Feature extractor → Scapy: parses fallback (evidence: `FeatureExtractor.py`)
- Feature extractor → Traffic statistics: updates statistics (evidence: `FeatureExtractor.py`)
- Traffic statistics → Incremental statistics: uses stream stats (evidence: `netStat.py`)
- Kitsune facade → Feature extractor: initializes and reads (evidence: `Kitsune.py`)
- Kitsune facade → KitNET orchestrator: processes vectors (evidence: `Kitsune.py`)
- KitNET orchestrator → Feature clustering: updates and clusters (evidence: `KitNET/KitNET.py`)
- KitNET orchestrator → Denoising autoencoder: trains and executes (evidence: `KitNET/KitNET.py`)
- Denoising autoencoder → Model utilities: uses activations (evidence: `KitNET/dA.py`)
- Demo and score analysis → Kitsune facade: runs packet loop (evidence: `example.py`)
