# awmoha/automated-threat-analysis-with-python-and-ai architecture

> Architecture diagram of the GitHub repository awmoha/automated-threat-analysis-with-python-and-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/awmoha/automated-threat-analysis-with-python-and-ai
- Repository: https://github.com/awmoha/automated-threat-analysis-with-python-and-ai

## Overview

Det här är en Streamlit-baserad hotanalysprodukt. Huvudflödet startar i dashboarden: den hämtar hot genom insamlaren, sparar poster, låter analytikern klassificera valda poster med Gemini och visar resultat från lagringen. Källorna omfattar RSS, CISA KEV och NIST NVD; dashboarden erbjuder även filtrering, risköversikt och logggranskning. Koden för dessa vyer ligger i samma dashboardmodul. Logggranskningen framgår av utdraget, men den exakta loggfilssökvägen är inte fastställd i trädet.

Main entry points: [`dashboard.py`](https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/dashboard.py) (Dashboard och filtrering), [`collector.py`](https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/collector.py) (Hotinsamling), [`logger_setup.py`](https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/logger_setup.py) (Loggkonfiguration), [`analyzer.py`](https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/analyzer.py) (AI-analys och parsning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard och gränssnitt"]
  node_dashboard["Dashboard och filtrering<br/>[dashboard.py]"]
end

subgraph group_collection["Hotinsamling"]
  node_collector["Hotinsamling<br/>[collector.py]"]
  node_rss["RSS-flöden"]
  node_cisa["CISA KEV"]
  node_nvd["NIST NVD"]
end

subgraph group_analysis["Analys och lagring"]
  node_analyzer["AI-analys och parsning<br/>[analyzer.py]"]
  node_storage[("ThreatStorage<br/>[storage.py]")]
end

subgraph group_observability["Loggning"]
  node_logger["Loggkonfiguration<br/>[logger_setup.py]"]
  node_logfiles["Systemloggar"]
end

node_analyst(("Hotanalytiker"))
node_gemini["Google Gemini"]

node_analyst -->|"använder"| node_dashboard
node_dashboard -->|"hämtar genom"| node_collector
node_collector -->|"hämtar från"| node_rss
node_collector -->|"hämtar från"| node_cisa
node_collector -->|"hämtar från"| node_nvd
node_dashboard -->|"sparar och läser"| node_storage
node_dashboard -->|"analyserar poster med"| node_analyzer
node_analyzer -->|"skickar analysförfrågan"| node_gemini
node_dashboard -->|"sparar analysresultat"| node_storage
node_collector -->|"konfigurerar loggning"| node_logger
node_analyzer -->|"konfigurerar loggning"| node_logger
node_storage -->|"konfigurerar loggning"| node_logger
node_dashboard -->|"läser loggar"| node_logfiles
node_logger -->|"skriver loggar"| node_logfiles

click node_dashboard "https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/dashboard.py"
click node_collector "https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/collector.py"
click node_analyzer "https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/analyzer.py"
click node_storage "https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/storage.py"
click node_logger "https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/logger_setup.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard toneBlue
class node_collector,node_rss,node_cisa,node_nvd toneAmber
class node_analyzer,node_storage toneMint
class node_logger,node_logfiles toneRose
class node_analyst,node_gemini toneIndigo
```

## Components

### Dashboard och gränssnitt

- [Dashboard och filtrering](https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/dashboard.py): `dashboard.py`

### Hotinsamling

- [Hotinsamling](https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/collector.py): `collector.py`
- **RSS-flöden**
- **CISA KEV**
- **NIST NVD**

### Analys och lagring

- [AI-analys och parsning](https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/analyzer.py): `analyzer.py`
- [ThreatStorage](https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/storage.py): `storage.py`

### Loggning

- [Loggkonfiguration](https://github.com/awmoha/automated-threat-analysis-with-python-and-ai/blob/master/logger_setup.py): `logger_setup.py`
- **Systemloggar**

### Other components

- **Hotanalytiker**
- **Google Gemini**

## Connections

- Hotanalytiker → Dashboard och filtrering: använder (evidence: `README.md`)
- Dashboard och filtrering → Hotinsamling: hämtar genom (evidence: `dashboard.py`)
- Hotinsamling → RSS-flöden: hämtar från (evidence: `collector.py`)
- Hotinsamling → CISA KEV: hämtar från (evidence: `collector.py`)
- Hotinsamling → NIST NVD: hämtar från (evidence: `collector.py`)
- Dashboard och filtrering → ThreatStorage: sparar och läser (evidence: `dashboard.py`)
- Dashboard och filtrering → AI-analys och parsning: analyserar poster med (evidence: `dashboard.py`)
- AI-analys och parsning → Google Gemini: skickar analysförfrågan (evidence: `analyzer.py`)
- Dashboard och filtrering → ThreatStorage: sparar analysresultat (evidence: `dashboard.py`)
- Hotinsamling → Loggkonfiguration: konfigurerar loggning (evidence: `collector.py`)
- AI-analys och parsning → Loggkonfiguration: konfigurerar loggning (evidence: `analyzer.py`)
- ThreatStorage → Loggkonfiguration: konfigurerar loggning (evidence: `storage.py`)
- Dashboard och filtrering → Systemloggar: läser loggar (evidence: `dashboard.py`)
- Loggkonfiguration → Systemloggar: skriver loggar (evidence: `logger_setup.py`)
