# trybakov/zelk architecture

> Architecture diagram of the GitHub repository trybakov/zelk, 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/trybakov/zelk
- Repository: https://github.com/trybakov/zelk

## Overview

##### Project type and purpose
- This is an open-source automation tool whose purpose is to install and configure Zeek and the ELK stack, then process PCAP captures into JSON logs and ship them into Elasticsearch for analysis via Kibana.

##### File structure
- Top-level scripts:
- ELK-install.py – automates installation and initial configuration of Elasticsearch, Logstash, Kibana, and Zeek.
- enable-zeek.py – automates Zeek path addition, Filebeat configuration, and log shipping setup.
- README.md describes usage, dependencies (Python 3, root privileges), and manual steps for PCAP processing.

##### Detail without over-splitting
- Logical service or step in the pipeline.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors and Data Sources
    Operator["Operator"]:::actor
    README["Project Documentation (README.md)"]:::actor

    %% Automation Scripts
    subgraph "Automation Scripts"
        Install["ELK-install.py"]:::automation
        Enable["enable-zeek.py"]:::automation
    end

    %% Data Input
    PCAP["PCAP Files"]:::data

    %% Processing Layer
    Zeek["Zeek IDS Engine"]:::processing
    Filebeat["Filebeat Agent"]:::processing

    %% ELK Stack
    subgraph "ELK Stack"
        Elastic["Elasticsearch (9200)"]:::storage
        Logstash["Logstash"]:::storage
        Kibana["Kibana (5601)"]:::visualization
    end

    %% Workflow Connections
    Operator -->|"Reads documentation"| README
    Operator -->|"sudo python3 ELK-install.py"| Install
    Install -->|"installs & configures"| Elastic
    Install -->|"installs & configures"| Logstash
    Install -->|"installs & configures"| Kibana
    Install -->|"installs Zeek"| Zeek

    Operator -->|"sudo python3 enable-zeek.py"| Enable
    Enable -->|"appends Zeek to PATH"| Zeek
    Enable -->|"writes Filebeat config"| Filebeat

    PCAP -->|"zeek -C -r … LogAscii::use_json=T"| Zeek
    Zeek -->|"outputs JSON logs"| Filebeat
    Filebeat -->|"ships logs to Elasticsearch"| Elastic
    Filebeat -->|"(optional) via Logstash"| Logstash
    Logstash -->|"forwards logs"| Elastic
    Kibana -->|"queries data"| Elastic

    %% Click Events
    click Install "https://github.com/trybakov/zelk/blob/main/ELK-install.py"
    click Enable "https://github.com/trybakov/zelk/blob/main/enable-zeek.py"
    click README "https://github.com/trybakov/zelk/blob/main/README.md"

    %% Styles
    classDef actor fill:#f9f,stroke:#333,stroke-width:2px
    classDef automation fill:#bbf,stroke:#333,stroke-width:1px
    classDef processing fill:#bfb,stroke:#333,stroke-width:1px
    classDef storage fill:#fb8,stroke:#333,stroke-width:1px
    classDef visualization fill:#b8f,stroke:#333,stroke-width:1px
    classDef data fill:#eef,stroke:#333,stroke-width:1px
```
