# dokanii/blue_lab_security architecture

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

- Interactive diagram: https://gitdiagram.com/dokanii/blue_lab_security
- Repository: https://github.com/dokanii/blue_lab_security

## Overview

##### Project type and purpose
- This is a small-scale “home SOC” (Security Operations Center) mini-lab.

##### File structure
- configs/ – backups of Raspberry Pi & switch configurations.
- docs/ – IP plan and network topology image.
- README.md – project goals, hardware, current state.

##### Key components
a. Network switch (Netgear GS305EP) with multiple VLANs and port-mirroring configured.
b. Raspberry Pi 5 (8 GB) hosting Docker + Suricata container(s).
c. Laptop/PC running Nmap scanning scripts and IDE for writing automation.
d. (Planned) Central logging & dashboard (OpenSearch + Kibana).

##### Relationships and data flows
- Traffic on VLANs (e.g., VLAN10 = servers, VLAN20 = workstations) flows through the switch.
- Switch mirrors all VLAN traffic to the Suricata interface on the Pi (via a mirrored port).
- Suricata inspects mirrored packets, generates alerts/logs.
- Suricata container ships logs (e.g., via Filebeat/Logstash agents) to the central OpenSearch cluster.
- The PC can trigger Nmap scans (targeting VLAN subnets), and Suricata or a script can raise alerts on scan activity.
- Administrators view alerts/dashboards in OpenSearch/Kibana.

##### Architectural patterns and design principles
- Clear separation of data-plane (mirrored traffic) and management (SSH to Pi, IDE on PC).
- Modular “log forwarder → search index → visualization” pipeline (future).
- VLAN segmentation enforces micro-perimeter within the lab.
- Containerization isolates Suricata and related services on the Pi.

##### Technologies and frameworks
- Docker (Suricata container, possibly Filebeat/Logstash).
- Suricata IDS engine.
- OpenSearch (or ElasticSearch fork) + Kibana.
- Nmap for active scanning.
- Linux networking (VLAN interfaces on Pi, switch configuration).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Network Segments
    VLAN10["VLAN10: Servers"]:::networkSegment
    VLAN20["VLAN20: Workstations"]:::networkSegment

    %% Switch
    Switch["Netgear GS305EP\n(VLANs + Port-Mirroring)"]:::networkSegment

    %% Raspberry Pi
    subgraph "Raspberry Pi 5"
        PI_mgmt["eth0 (Mgmt VLAN - SSH)"]:::management
        PI_mirror["eth1 (Mirrored Traffic)"]:::management
        subgraph "Docker Containers"
            SUR["Suricata IDS"]:::security
            FB["Filebeat/Logstash"]:::security
        end
    end

    %% Central Logging
    subgraph "OpenSearch Cluster"
        ES["OpenSearch Cluster"]:::datastore
        KB["Kibana Dashboard\n(pending)"]:::datastore
    end

    %% Management PC
    PC["Laptop/PC"]:::management
    DOC["Project README"]:::management

    %% Connections
    VLAN10 -->|“pcapStream”| Switch
    VLAN20 -->|“pcapStream”| Switch
    Switch -->|“pcapStream”| PI_mirror
    PI_mirror -->|“packetInspect”| SUR
    SUR -->|“logForward”| FB
    FB -->|“ELKIngestion”| ES
    ES -->|“visualizeAlerts”| KB

    PC -->|“SSH”| PI_mgmt
    PC -->|“NmapScan”| Switch
    SUR -->|“alerts”| KB

    DOC

    %% Click Events
    click Switch "https://github.com/dokanii/blue_lab_security/blob/main/configs/switch-GS305EP-20250731.cfg"
    click PI_mgmt "https://github.com/dokanii/blue_lab_security/blob/main/configs/baseline-net-20250731.txt"
    click VLAN10 "https://github.com/dokanii/blue_lab_security/blob/main/docs/ip_plan.md"
    click DOC "https://github.com/dokanii/blue_lab_security/blob/main/README.md"

    %% Styles
    classDef networkSegment fill:#cce5ff,stroke:#004080,color:#004080,stroke-width:1px;
    classDef security fill:#ffe5cc,stroke:#b35900,color:#663300,stroke-width:1px;
    classDef datastore fill:#e5ccff,stroke:#800080,color:#400040,stroke-width:1px;
    classDef management fill:#dddddd,stroke:#666666,color:#333333,stroke-width:1px;
```
