# alfa-group/bron architecture

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

- Interactive diagram: https://gitdiagram.com/alfa-group/bron
- Repository: https://github.com/alfa-group/bron

## Overview

##### Main Components

a. Data Sources Layer:
- External data sources (MITRE ATT&CK, CAPEC, CWE, CVE, MITRE Engage, MITRE D3FEND, MITRE CAR, exploitdb)
- As external system components

b. Data Processing Layer:
- Download Component (download_threat_information/)
- Parsing Component (parsing_scripts/)
- Processing Components:
- Offense processing (offense/)
- Mitigations processing (mitigations/)
- Corpus building (bron_corpus/)

c. Storage Layer:
- ArangoDB Graph Database (graph_db/)
- Schema definitions (graph_db/schemas/)
- Collections (both vertex and edge collections)

d. API/Interface Layer:
- Query interface (graph_db/query_graph_db.py)
- Utility functions (utils/)
- Tutorial interfaces (tutorials/)

##### Relationships to Highlight

- Data flow from external sources through the processing pipeline
- Bidirectional relationships between different node types
- Demonstrate the connection between schemas and database collections
- How the API layer interfaces with the graph database

##### Specific Implementation Details

**[External Data Sources]**
- ↓
**[Data Processing Pipeline]**
- ↓
**[Graph Database Layer]**
- ↓
**[API/Interface Layer]**

Key elements to emphasize:
- Docker deployment option (show containerization boundary)
- ArangoDB as the central storage system
- Schema validation flow
- Bidirectional relationships in the graph structure

##### Additional Elements

Annotations for:
- Environment variables (BRON_PWD, BRON_SERVER_IP)
- Port configurations (8529 for ArangoDB)
- Data validation points
- Testing interfaces

- Connection types
- Container boundaries
- External system interfaces

This system design should emphasize BRON's role as a cybersecurity knowledge graph system, highlighting how it integrates various threat and mitigation data sources into a unified, queryable graph database.

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Data Sources
    subgraph Sources["External Data Sources"]
        direction TB
        ATTACK[("MITRE ATT&CK")]:::external
        CAPEC[("CAPEC")]:::external
        CWE[("CWE")]:::external
        CVE[("CVE")]:::external
        ENGAGE[("MITRE Engage")]:::external
        D3FEND[("MITRE D3FEND")]:::external
        CAR[("MITRE CAR")]:::external
        EXPLOITDB[("ExploitDB")]:::external
    end

    %% Data Processing Layer
    subgraph Processing["Data Processing Pipeline"]
        direction TB
        Download["Download Component"]:::process
        Parser["Parsing Component"]:::process
        OffenseProc["Offense Processing"]:::offense
        MitigationProc["Mitigations Processing"]:::defense
        Corpus["Corpus Building"]:::process
        
        %% Specific Parsers
        AttackParser["ATT&CK Parser"]:::process
        CapecParser["CAPEC/CWE Parser"]:::process
        CveParser["CVE Parser"]:::process
        D3fendInt["D3FEND Integration"]:::defense
        EngageInt["Engage Integration"]:::defense
    end

    %% Storage Layer
    subgraph Storage["Graph Database Layer"]
        direction TB
        ArangoDB[("ArangoDB")]:::database
        Schemas["Schema Definitions"]:::database
        EdgeCollections["Edge Collections"]:::database
        GraphCore["Graph Database Core"]:::database
    end

    %% API Layer
    subgraph Interface["API/Interface Layer"]
        direction TB
        QueryInterface["Query Interface"]:::api
        Utils["Utility Functions"]:::api
        Tutorial["Tutorial Interface"]:::api
    end

    %% Relationships
    Sources --> Download
    Download --> Parser
    Parser --> AttackParser & CapecParser & CveParser
    AttackParser & CapecParser & CveParser --> OffenseProc
    ENGAGE --> EngageInt
    D3FEND --> D3fendInt
    EngageInt & D3fendInt --> MitigationProc
    OffenseProc & MitigationProc --> Corpus
    Corpus --> GraphCore
    GraphCore --> ArangoDB
    Schemas --> ArangoDB
    EdgeCollections --> ArangoDB
    ArangoDB --> QueryInterface
    QueryInterface --> Utils
    QueryInterface --> Tutorial

    %% Click Events
    click Download "https://github.com/ALFA-group/BRON/blob/master/download_threat_information/download_threat_data.py"
    click Parser "https://github.com/ALFA-group/BRON/tree/master/download_threat_information/parsing_scripts/"
    click OffenseProc "https://github.com/ALFA-group/BRON/blob/master/offense/build_offensive_BRON.py"
    click MitigationProc "https://github.com/ALFA-group/BRON/tree/master/mitigations/"
    click Corpus "https://github.com/ALFA-group/BRON/blob/master/bron_corpus/cybersecurity_corpus.py"
    click GraphCore "https://github.com/ALFA-group/BRON/blob/master/graph_db/bron_arango.py"
    click Schemas "https://github.com/ALFA-group/BRON/tree/master/graph_db/schemas/"
    click EdgeCollections "https://github.com/ALFA-group/BRON/tree/master/graph_db/schemas/edge_collections/"
    click QueryInterface "https://github.com/ALFA-group/BRON/blob/master/graph_db/query_graph_db.py"
    click Utils "https://github.com/ALFA-group/BRON/blob/master/utils/bron_utils.py"
    click Tutorial "https://github.com/ALFA-group/BRON/tree/master/tutorials/"
    click AttackParser "https://github.com/ALFA-group/BRON/blob/master/download_threat_information/parsing_scripts/parse_attack_tactic_technique.py"
    click CapecParser "https://github.com/ALFA-group/BRON/blob/master/download_threat_information/parsing_scripts/parse_capec_cwe.py"
    click CveParser "https://github.com/ALFA-group/BRON/blob/master/download_threat_information/parsing_scripts/parse_cve.py"
    click D3fendInt "https://github.com/ALFA-group/BRON/blob/master/mitigations/d3fend_mitigations.py"
    click EngageInt "https://github.com/ALFA-group/BRON/blob/master/mitigations/engage_mitigations.py"

    %% Styles
    classDef external fill:#f9f,stroke:#333,stroke-width:2px
    classDef process fill:#f4f4f4,stroke:#333,stroke-width:2px
    classDef offense fill:#ffb366,stroke:#333,stroke-width:2px
    classDef defense fill:#66b3ff,stroke:#333,stroke-width:2px
    classDef database fill:#f5f5f5,stroke:#333,stroke-width:2px,shape:cylinder
    classDef api fill:#90EE90,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        direction TB
        L1[("External Source")]:::external
        L2["Processing Component"]:::process
        L3["Offensive Component"]:::offense
        L4["Defensive Component"]:::defense
        L5[("Database Component")]:::database
        L6["API Component"]:::api
    end
```
