# target/strelka architecture

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

- Interactive diagram: https://gitdiagram.com/target/strelka
- Repository: https://github.com/target/strelka

## Overview

##### Project type and purpose
- Strelka is a container-based, microservice-oriented file-scanning platform.
- It provides CLI tools, a web UI, Go-based API/manager/front-end microservices, and a Python-based backend that runs a pluggable pipeline of file scanners.

##### Key architectural elements (from file tree & README)
- build/ + docker-compose/*.yaml → container definitions for each service
- configs/ → per-component YAML for Go services and Python backend (including Suricata & YARA rules)
- misc/envoy → an Envoy API gateway template
- src/go/cmd/… → Go binaries: strelka-frontend, strelka-manager, strelka-fileshot, strelka-filestream, strelka-oneshot
- src/go/api + src/python/strelka/proto → shared gRPC service definitions
- src/python/strelka → Python backend server, scanner modules, telemetry, config loaders
- misc/kubernetes → k8s manifests to deploy each container

##### Detail level
- Service container as its own component.
- Configuration mounts (configs/) feeding into services.
- Build artifacts (Docker images) in build/ → runtime containers.
- Don’t forget telemetry/traces and optional k8s overlays.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry Points
    subgraph "Entry Layer"
        direction TB
        UI["Web UI (Browser)"]:::external
        CLI["Go Oneshot CLI"]:::external
        PyCLI["Python Client CLI"]:::external
    end

    %% Ingress/API Gateway
    Envoy["Envoy API Gateway"]:::external
    click Envoy "https://github.com/target/strelka/blob/master/misc/envoy/frontend/envoy.yaml"

    UI -->|"HTTP"| Envoy
    CLI -->|"HTTP"| Envoy
    PyCLI -->|"HTTP"| Envoy

    %% Go API Layer
    subgraph "Go API Layer"
        direction TB
        GF["Go Frontend Service"]:::go
        GM["Go Manager Service"]:::go
        GFS["Go Fileshot Service"]:::go
        GFL["Go Filestream Service"]:::go
    end

    Envoy -->|"HTTP"| GF
    GF -->|"gRPC"| GM
    GM -->|"gRPC"| GFS
    GM -->|"gRPC"| GFL

    click GF "https://github.com/target/strelka/blob/master/src/go/cmd/strelka-frontend/main.go"
    click GM "https://github.com/target/strelka/blob/master/src/go/cmd/strelka-manager/main.go"
    click GFS "https://github.com/target/strelka/blob/master/src/go/cmd/strelka-fileshot/main.go"
    click GFL "https://github.com/target/strelka/blob/master/src/go/cmd/strelka-filestream/main.go"
    click CLI "https://github.com/target/strelka/blob/master/src/go/cmd/strelka-oneshot/main.go"
    click PyCLI "https://github.com/target/strelka/blob/master/misc/python-client/client.py"

    %% gRPC Layer
    GRPC["gRPC Service Definitions"]:::grpc
    GM -->|"gRPC"| GRPC
    GRPC -->|"gRPC"| PythonBackend

    %% Python Scanning Layer
    subgraph "Python Scanning Layer"
        direction TB
        PythonBackend["Strelka Python Backend"]:::python
        Scanners["Scanner Modules"]:::python
        Telemetry["Telemetry & SIEM Sink"]:::python
    end

    click PythonBackend "https://github.com/target/strelka/tree/master/src/python/bin/strelka-backend"
    click Scanners "https://github.com/target/strelka/tree/master/src/python/strelka/scanners/"
    click Telemetry "https://github.com/target/strelka/blob/master/src/python/strelka/telemetry/traces.py"

    GRPC -->|"gRPC"| PythonBackend
    PythonBackend -->|"loads pipeline"| Scanners
    PythonBackend -->|"JSON results"| GM
    PythonBackend -->|"telemetry JSON"| Telemetry

    %% Storage & Artifacts
    subgraph "Storage & Artifacts"
        direction TB
        S3["S3 / Local Volume"]:::storage
        S3Pkg["S3 Integration (tossS3 pkg)"]:::go
    end

    PythonBackend -->|"Upload"| S3
    GM -->|"persists results"| S3
    click S3Pkg "https://github.com/target/strelka/tree/master/src/go/pkg/tossS3/"

    %% Docker & Kubernetes
    subgraph "Infrastructure as Code"
        direction TB
        DockerCompose["Docker Compose Definitions"]:::infra
        K8s["Kubernetes Manifests"]:::infra
    end

    DockerCompose --> Envoy
    DockerCompose --> GF
    DockerCompose --> GM
    DockerCompose --> GFS
    DockerCompose --> GFL
    DockerCompose --> PythonBackend
    click DockerCompose "https://github.com/target/strelka/blob/master/build/docker-compose.yaml"
    click K8s "https://github.com/target/strelka/tree/master/misc/kubernetes/"

    %% Styles
    classDef go fill:#cce5ff,stroke:#004085,color:#004085;
    classDef python fill:#d4edda,stroke:#155724,color:#155724;
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
    classDef grpc fill:#fff3cd,stroke:#856404,color:#856404;
    classDef storage fill:#f8d7da,stroke:#721c24,color:#721c24;
    classDef infra fill:#d1ecf1,stroke:#0c5460,color:#0c5460;
```
