# oliwave/snort-with-elk architecture

> Architecture diagram of the GitHub repository oliwave/snort-with-elk, 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/oliwave/snort-with-elk
- Repository: https://github.com/oliwave/snort-with-elk

## Overview

##### File structure
- Top‐level:
- docker-compose.yml & docker-stack.yml – orchestration definitions
- .env – environment variables
- Directories per service:
– elasticsearch/ (Dockerfile + config)
– kibana/ (Dockerfile + config)
– logstash/ (Dockerfile + pipeline config)
– snort3/ (Dockerfile, host network mode)
– extensions/ (apm-server, curator, enterprise-search, logspout – each with Dockerfile, config, compose snippet)
- CI/CD and GitHub workflows exist under .github/workflows.
- Each service directory holds its own YAML/config, indicating strong service isolation.

##### README for additional insights
- Snort3 runs in host network mode to capture all host traffic.
- Packets are analyzed by Snort3; alerts/events are forwarded into the ELK pipeline.
- Based on FaelDi’s “docker-elk” reference, standard patterns for ELK (Filebeat → Logstash → Elasticsearch → Kibana) are extended with Snort output.

## Diagram (Mermaid)

```mermaid
flowchart TD
    NT["Network Traffic"]:::external
    Snort["Snort3"]:::snort
    Logstash["Logstash"]:::elk
    ES["Elasticsearch"]:::elk
    Kibana["Kibana"]:::elk

    NT -->|"captures packets"| Snort
    Snort -->|"alerts/logs"| Logstash
    Logstash -->|"events"| ES
    ES -->|"indexes & stores"| ES
    ES -->|"queries"| Kibana

    subgraph "Extensions"
        APM["APM-Server"]:::ext
        Curator["Curator"]:::ext
        ESearch["Enterprise Search"]:::ext
        Logspout["Logspout"]:::ext
    end

    APM -->|"ships traces"| ES
    Curator -->|"manages indices"| ES
    ESearch -->|"UI layer"| ES
    Logspout -->|"collects logs"| ES

    subgraph "Orchestration Layer"
        Compose["Docker Compose"]:::orchestrator
        Stack["Docker Swarm Stack"]:::orchestrator
        Env["Environment Variables (.env)"]:::orchestrator
    end

    Compose --> Snort
    Compose --> Logstash
    Compose --> ES
    Compose --> Kibana
    Compose --> APM
    Compose --> Curator
    Compose --> ESearch
    Compose --> Logspout
    Env --> Compose
    Stack --> Snort
    Stack --> Logstash
    Stack --> ES
    Stack --> Kibana

    click Compose "https://github.com/oliwave/snort-with-elk/blob/main/docker-compose.yml"
    click Stack "https://github.com/oliwave/snort-with-elk/blob/main/docker-stack.yml"
    click Env "https://github.com/oliwave/snort-with-elk/blob/main/.env"
    click ES "https://github.com/oliwave/snort-with-elk/tree/main/elasticsearch/Dockerfile"
    click Kibana "https://github.com/oliwave/snort-with-elk/tree/main/kibana/Dockerfile"
    click Logstash "https://github.com/oliwave/snort-with-elk/tree/main/logstash/Dockerfile"
    click Snort "https://github.com/oliwave/snort-with-elk/tree/main/snort3/Dockerfile"
    click APM "https://github.com/oliwave/snort-with-elk/tree/main/extensions/apm-server/Dockerfile"
    click Curator "https://github.com/oliwave/snort-with-elk/tree/main/extensions/curator/Dockerfile"
    click ESearch "https://github.com/oliwave/snort-with-elk/tree/main/extensions/enterprise-search/Dockerfile"
    click Logspout "https://github.com/oliwave/snort-with-elk/tree/main/extensions/logspout/Dockerfile"

    classDef elk fill:#bbeeff,stroke:#333,stroke-width:1px;
    classDef snort fill:#ffcc99,stroke:#333,stroke-width:1px;
    classDef orchestrator fill:#dddddd,stroke:#333,stroke-width:1px;
    classDef ext fill:#ccffcc,stroke:#333,stroke-width:1px;
    classDef external fill:#f2f2f2,stroke:#333,stroke-width:1px;
```
