# samiul008ghub/soc_setup architecture

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

- Interactive diagram: https://gitdiagram.com/samiul008ghub/soc_setup
- Repository: https://github.com/samiul008ghub/soc_setup

## Overview

##### Project type and purpose
- This is an automation tool (a Bash-based setup script) for quickly configuring a unified Security Operations Center (SOC) environment on a single Ubuntu host.
- It installs and configures three core components:
- SIEM (Elasticsearch + Kibana + Filebeat)
- NIDS (Suricata)
- HIDS (Wazuh Manager)

##### File structure
- Top-level files only—no nested “src” or “lib” directories—indicating a small orchestration project rather than a multi-service codebase.
- Key scripts:
- setup_script.sh – main entry point; prompts the user and calls the component-specific scripts
- siem_setup.sh – installs Elasticsearch, Kibana, Filebeat (v7.17.13 for Wazuh 4.5 compatibility)
- suricata_setup.sh (+ suricata_temp.yaml) – installs and configures Suricata to monitor the host interface
- wazuh_setup.sh – installs and configures the Wazuh Manager (v4.5)

##### Extracted architecture information from the README
- Everything runs on one machine/VM (Ubuntu).
- Filebeat collects logs from both Suricata (eve.json) and Wazuh modules and ships them into Elasticsearch.
- Kibana (in SIEM component) provides dashboards for general event analysis, Suricata alerts, and Wazuh alerts.
- Future extensibility: Wazuh agents on other hosts send logs to the central Wazuh Manager, which feeds into Elasticsearch via Filebeat.

##### Main components and their relationships
a. Host OS (Ubuntu)
b. Orchestration layer (setup_script.sh)
c. SIEM stack
- Elasticsearch (data store + search engine)
- Kibana (visualization + dashboards)
- Filebeat (log shipper)—module configurations for Suricata and Wazuh
d. NIDS
- Suricata (sensor; writes JSON logs to /var/log/suricata/eve.json)
e. HIDS
- Wazuh Manager (central analysis)
- Wazuh filebeat module (shipped to Elasticsearch)
f. Optional external Wazuh agents
g. Networking
- Suricata monitors local interface (or TAP/SPAN)
- All components communicate over localhost or defined ports

##### Architectural patterns & design principles
- Single-node deployment (consolidation) for testing/proof-of-concept
- Modular installation scripts—each component is wrapped in its own script for separation of concerns
- Log-centralization pattern: multiple data sources → Filebeat → Elasticsearch → Kibana UI
- Extensibility: additional Wazuh agents or remote sensors simply hook into the same pipeline

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Orchestration Layer
    Setup("setup_script.sh"):::script
    Setup --> siemSetup("siem_setup.sh"):::script
    Setup --> suriSetup("suricata_setup.sh"):::script
    Setup --> wazuhSetup("wazuh_setup.sh"):::script

    subgraph "Ubuntu Host"
        direction TB

        %% SIEM Stack
        subgraph "SIEM Stack"
            direction TB
            ES["Elasticsearch<br/>(HTTP 9200)"]:::storage
            KB["Kibana<br/>(HTTP 5601)"]:::ui
            FB["Filebeat<br/>(TCP/5044)"]:::shipper
        end

        %% NIDS
        subgraph "NIDS (Suricata)"
            direction TB
            SU["Suricata"]:::sensor
            SUCFG["suricata_temp.yaml"]:::config
        end

        %% HIDS
        subgraph "HIDS (Wazuh)"
            direction TB
            WZ["Wazuh Manager"]:::manager
            WZFB["Wazuh Filebeat Module"]:::shipper
        end

        %% External Agents
        extAgent("External Wazuh Agents"):::external
    end

    %% Data Flows
    SU -->|"eve.json"| FB
    WZ -->|"alerts"| FB
    FB -->|"ingest"| ES
    ES -->|"queries"| KB
    extAgent -->|"logs"| WZ

    %% Click Events
    click Setup "https://github.com/samiul008ghub/soc_setup/blob/main/setup_script.sh"
    click siemSetup "https://github.com/samiul008ghub/soc_setup/blob/main/siem_setup.sh"
    click suriSetup "https://github.com/samiul008ghub/soc_setup/blob/main/suricata_setup.sh"
    click SUCFG "https://github.com/samiul008ghub/soc_setup/blob/main/suricata_temp.yaml"
    click wazuhSetup "https://github.com/samiul008ghub/soc_setup/blob/main/wazuh_setup.sh"

    %% Styles
    classDef script fill:#f5f5f5,stroke:#333,stroke-width:1px,shape:roundRect
    classDef storage fill:#cfe2f3,stroke:#036,stroke-width:1px
    classDef ui fill:#b6d7a8,stroke:#38761d,stroke-width:1px
    classDef shipper fill:#d9ead3,stroke:#6aa84f,stroke-width:1px
    classDef sensor fill:#f4cccc,stroke:#cc0000,stroke-width:1px
    classDef manager fill:#ffe599,stroke:#e69138,stroke-width:1px
    classDef config fill:#ead1dc,stroke:#a64d79,stroke-width:1px
    classDef external fill:#dddddd,stroke:#888888,stroke-width:1px
    class Setup,siemSetup,suriSetup,wazuhSetup script
    class ES storage
    class KB ui
    class FB,WZFB shipper
    class SU sensor
    class SUCFG config
    class WZ manager
    class extAgent external
```
