# sebdraven/iocmite architecture

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

- Interactive diagram: https://gitdiagram.com/sebdraven/iocmite
- Repository: https://github.com/sebdraven/iocmite

## Overview

##### Main Components

a) External Systems:
- MISP (Threat Intelligence Platform)
- Suricata (Network Security Monitoring)
- Redis (Optional Storage)

b) Core Components:
- IOC Import Module
- Sightings Module
- Dataset Manager
- Configuration Manager

**Top Level:**
- External Systems (MISP, Suricata, Redis)
**Middle Level:**
- IOCmite Core Components
**Bottom Level:**
- Storage and Datasets

##### Specific Implementation Details

Technical elements:
- Dataset Types (string) for IP, Domain, User-Agent
- File Paths for eve.json and dataset storage
- Configuration flow from settings.json

##### Component Details

IOC Import Module:
- MISP Client (misp_client.py)
- Dataset Handler (suricata_dataset.py)

Sightings Module:
- Sightings Handler (sightings.py)
- Scheduler Client (sched_client.py)

Configuration:
- Settings JSON handler
- Rule Management

##### Operational Flows

Two main operational flows:
##### Import Flow
MISP → IOC Import → Dataset Conversion → Suricata Datasets

##### Sighting Flow
Suricata Alerts → Sightings Module → MISP Updates

##### Additional Elements

Include:
- Version information
- Data type mappings (IP, Domain, User-Agent)
- Rule integration points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Systems
    subgraph External
        MISP[MISP Platform]:::external
        Suricata[Suricata IDS]:::external
        Redis[(Redis Storage)]:::external
    end

    %% Core Components
    subgraph Core
        direction TB
        IOCImport[IOC Import Module]:::core
        Sightings[Sightings Module]:::core
        Dataset[Dataset Manager]:::core
        Config[Configuration Manager]:::core
        Scheduler[Scheduler Component]:::core
        LastRun[Last Run State Manager]:::core
        Logger[Logging System]:::core
        MainApp[Main Application]:::core
    end

    %% Rules Management
    subgraph Rules
        direction TB
        RuleManager[Rule Management]:::rules
        NetworkRules[Network Rules]:::rules
        DNSRules[DNS Rules]:::rules
        HTTPRules[HTTP Rules]:::rules
        TLSRules[TLS Rules]:::rules
    end

    %% Data Storage
    subgraph Storage
        SuricataConfig[Suricata Config]:::storage
        DatasetStorage[Dataset Storage]:::storage
    end

    %% Relationships
    MISP <--> IOCImport
    IOCImport --> Dataset
    Dataset --> Suricata
    Suricata --> Sightings
    Sightings --> MISP
    Redis -.-> Core
    Config --> Core
    Scheduler --> Core
    Logger --> Core
    LastRun --> Core
    MainApp --> Core
    RuleManager --> NetworkRules
    RuleManager --> DNSRules
    RuleManager --> HTTPRules
    RuleManager --> TLSRules
    RuleManager --> Suricata
    Dataset --> DatasetStorage
    SuricataConfig --> Suricata

    %% Click Events
    click IOCImport "https://github.com/sebdraven/IOCmite/blob/main/suricata_misp/misp_client.py"
    click Sightings "https://github.com/sebdraven/IOCmite/blob/main/suricata_misp/sightings.py"
    click Dataset "https://github.com/sebdraven/IOCmite/blob/main/suricata_misp/suricata_dataset.py"
    click Config "https://github.com/sebdraven/IOCmite/blob/main/settings.json.sample"
    click Scheduler "https://github.com/sebdraven/IOCmite/blob/main/suricata_misp/sched_client.py"
    click MainApp "https://github.com/sebdraven/IOCmite/blob/main/scripts/iocmite.py"
    click RuleManager "https://github.com/sebdraven/IOCmite/tree/main/rules/"
    click NetworkRules "https://github.com/sebdraven/IOCmite/blob/main/rules/bundles.rules"
    click DNSRules "https://github.com/sebdraven/IOCmite/blob/main/rules/dns.rules"
    click HTTPRules "https://github.com/sebdraven/IOCmite/blob/main/rules/http.rules"
    click TLSRules "https://github.com/sebdraven/IOCmite/blob/main/rules/tls.rules"
    click Logger "https://github.com/sebdraven/IOCmite/blob/main/utils/logger.py"
    click LastRun "https://github.com/sebdraven/IOCmite/blob/main/suricata_misp/last_run.py"
    click SuricataConfig "https://github.com/sebdraven/IOCmite/blob/main/suricata.yaml"

    %% Styles
    classDef external fill:#2374ab,stroke:#000,stroke-width:2px,color:#fff
    classDef core fill:#57a773,stroke:#000,stroke-width:2px,color:#fff
    classDef rules fill:#ffc857,stroke:#000,stroke-width:2px,color:#000
    classDef storage fill:#ef7b45,stroke:#000,stroke-width:2px,color:#fff

    %% Legend
    subgraph Legend
        L1[External Systems]:::external
        L2[Core Components]:::core
        L3[Rules Management]:::rules
        L4[Data Storage]:::storage
    end
```
