# zeroq/kraut_salad architecture

> Architecture diagram of the GitHub repository zeroq/kraut_salad, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zeroq/kraut_salad
- Repository: https://github.com/zeroq/kraut_salad

## Overview

Kraut Salad is a proof-of-concept cyber-threat-intelligence and incident-handling platform. Its documented ingestion workflow starts with an operator supplying a STIX file to the `load_stix` management command, which parses STIX/CybOX content into relational threat-intelligence records; the README notes that unsupported elements and references are reported. The repository also provides intelligence browsing/editing, incident handling, an API, export, and OSINT/TAXII sharing. Calls between sampled components are shown where evidenced; links to unsampled web entry points are omitted.

Main entry points: [`kraut_parser/models.py`](https://github.com/zeroq/kraut_salad/blob/master/kraut_parser/models.py) (Intelligence records), [`kraut_api/serializers.py`](https://github.com/zeroq/kraut_salad/blob/master/kraut_api/serializers.py) (API serializers), [`kraut_parser/management/commands/load_stix.py`](https://github.com/zeroq/kraut_salad/blob/master/kraut_parser/management/commands/load_stix.py) (STIX loader), [`kraut_intel/views.py`](https://github.com/zeroq/kraut_salad/blob/master/kraut_intel/views.py) (Intel workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Intelligence ingestion"]
  node_load_stix["STIX loader<br/>[load_stix.py]"]
  node_cybox["CybOX handlers<br/>[cybox_functions.py]"]
  node_intel_records[("Intelligence records<br/>[models.py]")]
end

subgraph group_intel["Threat intelligence"]
  node_intel_web["Intel workspace<br/>[views.py]"]
  node_intel_forms["Intel forms<br/>[forms.py]"]
  node_intel_support[("Intel metadata<br/>[models.py]")]
end

subgraph group_incident["Incident handling"]
  node_incidents["Incident workflow<br/>[views.py]"]
  node_incident_forms["Incident forms<br/>[forms.py]"]
  node_incident_records[("Incident records<br/>[models.py]")]
end

subgraph group_interfaces["Access and exchange"]
  node_api["REST API<br/>[views.py]"]
  node_serializers["API serializers<br/>[serializers.py]"]
  node_export["STIX export<br/>[views.py]"]
  node_export_utils["Export utilities<br/>[utils.py]"]
end

subgraph group_sharing["Feed sharing"]
  node_feed_tasks["Feed polling tasks<br/>[tasks.py]"]
  node_taxii_feed["TAXII feed client<br/>[feed.py]"]
  node_sharing_records[("Feed configuration<br/>[models.py]")]
  node_osint_pull["OSINT pull command<br/>[pull_osint.py]"]
end

node_operator(("Operator"))

node_operator -->|"loads document"| node_load_stix
node_load_stix -->|"uses handlers"| node_cybox
node_load_stix -->|"creates records"| node_intel_records
node_cybox -->|"maps objects"| node_intel_records
node_intel_web -->|"uses forms"| node_intel_forms
node_intel_web -->|"reads and updates"| node_intel_records
node_intel_web -->|"uses metadata"| node_intel_support
node_incidents -->|"uses forms"| node_incident_forms
node_incidents -->|"updates records"| node_incident_records
node_api -->|"serializes responses"| node_serializers
node_api -->|"queries records"| node_intel_records
node_serializers -->|"serializes models"| node_intel_records
node_serializers -->|"serializes models"| node_incident_records
node_serializers -->|"serializes models"| node_sharing_records
node_export -->|"uses utilities"| node_export_utils
node_export -->|"reads records"| node_intel_records
node_export_utils -->|"reads records"| node_intel_records
node_feed_tasks -->|"updates feed state"| node_sharing_records
node_feed_tasks -->|"polls collections"| node_taxii_feed
node_feed_tasks -->|"invokes loader"| node_load_stix
node_osint_pull -->|"uses feed records"| node_sharing_records
node_osint_pull -->|"uses intelligence records"| node_intel_records

click node_load_stix "https://github.com/zeroq/kraut_salad/blob/master/kraut_parser/management/commands/load_stix.py"
click node_cybox "https://github.com/zeroq/kraut_salad/blob/master/kraut_parser/cybox_functions.py"
click node_intel_records "https://github.com/zeroq/kraut_salad/blob/master/kraut_parser/models.py"
click node_intel_web "https://github.com/zeroq/kraut_salad/blob/master/kraut_intel/views.py"
click node_intel_forms "https://github.com/zeroq/kraut_salad/blob/master/kraut_intel/forms.py"
click node_intel_support "https://github.com/zeroq/kraut_salad/blob/master/kraut_intel/models.py"
click node_incidents "https://github.com/zeroq/kraut_salad/blob/master/kraut_incident/views.py"
click node_incident_forms "https://github.com/zeroq/kraut_salad/blob/master/kraut_incident/forms.py"
click node_incident_records "https://github.com/zeroq/kraut_salad/blob/master/kraut_incident/models.py"
click node_api "https://github.com/zeroq/kraut_salad/blob/master/kraut_api/views.py"
click node_serializers "https://github.com/zeroq/kraut_salad/blob/master/kraut_api/serializers.py"
click node_export "https://github.com/zeroq/kraut_salad/blob/master/kraut_export/views.py"
click node_export_utils "https://github.com/zeroq/kraut_salad/blob/master/kraut_export/utils.py"
click node_feed_tasks "https://github.com/zeroq/kraut_salad/blob/master/kraut_sharing/tasks.py"
click node_taxii_feed "https://github.com/zeroq/kraut_salad/blob/master/kraut_sharing/feed.py"
click node_sharing_records "https://github.com/zeroq/kraut_salad/blob/master/kraut_sharing/models.py"
click node_osint_pull "https://github.com/zeroq/kraut_salad/blob/master/kraut_sharing/management/commands/pull_osint.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_load_stix,node_cybox,node_intel_records toneBlue
class node_intel_web,node_intel_forms,node_intel_support toneAmber
class node_incidents,node_incident_forms,node_incident_records toneMint
class node_api,node_serializers,node_export,node_export_utils toneRose
class node_feed_tasks,node_taxii_feed,node_sharing_records,node_osint_pull,node_operator toneIndigo
```

## Components

### Intelligence ingestion

- [STIX loader](https://github.com/zeroq/kraut_salad/blob/master/kraut_parser/management/commands/load_stix.py): `kraut_parser/management/commands/load_stix.py`
- [CybOX handlers](https://github.com/zeroq/kraut_salad/blob/master/kraut_parser/cybox_functions.py): `kraut_parser/cybox_functions.py`
- [Intelligence records](https://github.com/zeroq/kraut_salad/blob/master/kraut_parser/models.py): `kraut_parser/models.py`

### Threat intelligence

- [Intel workspace](https://github.com/zeroq/kraut_salad/blob/master/kraut_intel/views.py): `kraut_intel/views.py`
- [Intel forms](https://github.com/zeroq/kraut_salad/blob/master/kraut_intel/forms.py): `kraut_intel/forms.py`
- [Intel metadata](https://github.com/zeroq/kraut_salad/blob/master/kraut_intel/models.py): `kraut_intel/models.py`

### Incident handling

- [Incident workflow](https://github.com/zeroq/kraut_salad/blob/master/kraut_incident/views.py): `kraut_incident/views.py`
- [Incident forms](https://github.com/zeroq/kraut_salad/blob/master/kraut_incident/forms.py): `kraut_incident/forms.py`
- [Incident records](https://github.com/zeroq/kraut_salad/blob/master/kraut_incident/models.py): `kraut_incident/models.py`

### Access and exchange

- [REST API](https://github.com/zeroq/kraut_salad/blob/master/kraut_api/views.py): `kraut_api/views.py`
- [API serializers](https://github.com/zeroq/kraut_salad/blob/master/kraut_api/serializers.py): `kraut_api/serializers.py`
- [STIX export](https://github.com/zeroq/kraut_salad/blob/master/kraut_export/views.py): `kraut_export/views.py`
- [Export utilities](https://github.com/zeroq/kraut_salad/blob/master/kraut_export/utils.py): `kraut_export/utils.py`

### Feed sharing

- [Feed polling tasks](https://github.com/zeroq/kraut_salad/blob/master/kraut_sharing/tasks.py): `kraut_sharing/tasks.py`
- [TAXII feed client](https://github.com/zeroq/kraut_salad/blob/master/kraut_sharing/feed.py): `kraut_sharing/feed.py`
- [Feed configuration](https://github.com/zeroq/kraut_salad/blob/master/kraut_sharing/models.py): `kraut_sharing/models.py`
- [OSINT pull command](https://github.com/zeroq/kraut_salad/blob/master/kraut_sharing/management/commands/pull_osint.py): `kraut_sharing/management/commands/pull_osint.py`

### Other components

- **Operator**

## Connections

- Operator → STIX loader: loads document
- STIX loader → CybOX handlers: uses handlers (evidence: `kraut_parser/management/commands/load_stix.py`)
- STIX loader → Intelligence records: creates records (evidence: `kraut_parser/management/commands/load_stix.py`)
- CybOX handlers → Intelligence records: maps objects (evidence: `kraut_parser/cybox_functions.py`)
- Intel workspace → Intel forms: uses forms (evidence: `kraut_intel/views.py`)
- Intel workspace → Intelligence records: reads and updates (evidence: `kraut_intel/views.py`)
- Intel workspace → Intel metadata: uses metadata (evidence: `kraut_intel/views.py`)
- Incident workflow → Incident forms: uses forms (evidence: `kraut_incident/views.py`)
- Incident workflow → Incident records: updates records (evidence: `kraut_incident/views.py`)
- REST API → API serializers: serializes responses (evidence: `kraut_api/views.py`)
- REST API → Intelligence records: queries records (evidence: `kraut_api/views.py`)
- API serializers → Intelligence records: serializes models (evidence: `kraut_api/serializers.py`)
- API serializers → Incident records: serializes models (evidence: `kraut_api/serializers.py`)
- API serializers → Feed configuration: serializes models (evidence: `kraut_api/serializers.py`)
- STIX export → Export utilities: uses utilities (evidence: `kraut_export/views.py`)
- STIX export → Intelligence records: reads records (evidence: `kraut_export/views.py`)
- Export utilities → Intelligence records: reads records (evidence: `kraut_export/utils.py`)
- Feed polling tasks → Feed configuration: updates feed state (evidence: `kraut_sharing/tasks.py`)
- Feed polling tasks → TAXII feed client: polls collections (evidence: `kraut_sharing/tasks.py`)
- Feed polling tasks → STIX loader: invokes loader (evidence: `kraut_sharing/tasks.py`)
- OSINT pull command → Feed configuration: uses feed records (evidence: `kraut_sharing/management/commands/pull_osint.py`)
- OSINT pull command → Intelligence records: uses intelligence records (evidence: `kraut_sharing/management/commands/pull_osint.py`)
