# kolide/launcher architecture

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

- Interactive diagram: https://gitdiagram.com/kolide/launcher
- Repository: https://github.com/kolide/launcher

## Overview

##### Main Components

a. Core Components:
- Launcher Agent (Main Application)
- Osquery Integration
- Control Server Communication Layer
- TUF (The Update Framework) System
- Desktop Integration Components
- Storage Systems (SQLite, BBolt)

b. Supporting Systems:
- Authentication & Security Layer
- Logging System
- Table Extensions
- Debug & Monitoring Components

**┌─ Host System ──────────────────────────────────────────┐**

- ┌─ Kolide Agent ─────────────────────────────────┐   │

- ┌─ Core Services ─┐  ┌─ Extension Tables ─┐   │   │

- Osquery      │  │ - Custom Tables    │   │   │
- TUF Updates  │  │ - Platform Tables  │   │   │
- Control      │  └────────────────────┘   │   │
- ┘                          │   │

- ┌─ Storage ──────┐  ┌─ Communication ────┐   │   │
- SQLite       │  │ - Control Server   │   │   │
- BBolt        │  │ - gRPC/JSON-RPC    │   │   │
- ┘  └──────────────────┘   │   │

- ┘   │

- ┘

##### Key Relationships to Highlight

- Bidirectional communication between the Agent and Control Server
- Update flow through TUF
- Interaction between osquery and custom tables
- Storage system integration points
- Platform-specific components

##### Important Details

a. Component Labels:
- Version information
- Platform support indicators
- Security boundaries

b. Data Flow Indicators:
- Authentication paths
- Update channels
- Log shipping routes
- Query execution paths

##### Implementation Notes

- Version/platform compatibility notes
- Document security boundaries and trust relationships

##### Additional Sections

- Detailed update flow
- Security model
- Table extension architecture
- Desktop integration components

- Secure automatic updates
- Extended table capabilities
- Device identification
- Integration with the Kolide service

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Host["Host System"]
        subgraph Agent["Kolide Agent"]
            subgraph Core["Core Services"]
                Osquery["Osquery Integration"]:::core
                TUF["TUF Updates"]:::core
                Control["Control Service"]:::core
            end

            subgraph Extensions["Extension Tables"]
                Tables["Custom Tables"]:::extension
                PlatformTables["Platform Tables"]:::extension
            end

            subgraph Storage["Storage Layer"]
                SQLite["SQLite DB"]:::storage
                BBolt["BBolt DB"]:::storage
            end

            subgraph Comm["Communication Layer"]
                ControlServer["Control Server"]:::comm
                GRPC["gRPC/JSON-RPC"]:::comm
            end

            subgraph Desktop["Desktop Integration"]
                UI["User Interface"]:::desktop
                Notify["Notifications"]:::desktop
                Runner["Desktop Runner"]:::desktop
            end

            subgraph Security["Security Components"]
                Auth["Authentication"]:::security
                Crypto["Crypto Info"]:::security
            end

            subgraph Debug["Debug & Monitoring"]
                Checkups["System Checkups"]:::debug
                DebugShip["Debug Shipper"]:::debug
            end

            subgraph Logging["Logging System"]
                LocalLog["Local Logger"]:::logging
                LogShip["Log Shipper"]:::logging
                MultiLog["Multi Logger"]:::logging
            end
        end
    end

    %% Relationships
    Osquery --> Tables
    Osquery --> PlatformTables
    Control --> ControlServer
    ControlServer --> GRPC
    TUF --> ControlServer
    Control --> SQLite
    Control --> BBolt
    UI --> Notify
    UI --> Runner
    LogShip --> ControlServer
    DebugShip --> ControlServer
    Auth --> ControlServer
    
    %% Click Events
    click Agent "https://github.com/kolide/launcher/tree/main/cmd/launcher/"
    click Osquery "https://github.com/kolide/launcher/tree/main/pkg/osquery/"
    click Control "https://github.com/kolide/launcher/blob/main/ee/control/control.go"
    click TUF "https://github.com/kolide/launcher/tree/main/ee/tuf/"
    click UI "https://github.com/kolide/launcher/tree/main/ee/desktop/user/"
    click Notify "https://github.com/kolide/launcher/tree/main/ee/desktop/user/notify/"
    click Runner "https://github.com/kolide/launcher/tree/main/ee/desktop/runner/"
    click SQLite "https://github.com/kolide/launcher/tree/main/ee/agent/storage/sqlite/"
    click BBolt "https://github.com/kolide/launcher/tree/main/ee/agent/storage/bbolt/"
    click Tables "https://github.com/kolide/launcher/tree/main/ee/tables/"
    click LocalLog "https://github.com/kolide/launcher/tree/main/pkg/log/locallogger/"
    click LogShip "https://github.com/kolide/launcher/tree/main/pkg/log/logshipper/"
    click MultiLog "https://github.com/kolide/launcher/tree/main/pkg/log/multislogger/"
    click Checkups "https://github.com/kolide/launcher/tree/main/ee/debug/checkups/"
    click DebugShip "https://github.com/kolide/launcher/tree/main/ee/debug/shipper/"
    click Auth "https://github.com/kolide/launcher/tree/main/pkg/authedclient/"
    click Crypto "https://github.com/kolide/launcher/tree/main/ee/cryptoinfo/"

    %% Styles
    classDef core fill:#2374ab
    classDef extension fill:#57a773
    classDef storage fill:#7b2cbf
    classDef comm fill:#ff8c42
    classDef desktop fill:#45b7d1
    classDef security fill:#e63946
    classDef debug fill:#ffb703
    classDef logging fill:#4a4e69

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Extensions"]:::extension
        L3["Storage"]:::storage
        L4["Communication"]:::comm
        L5["Desktop"]:::desktop
        L6["Security"]:::security
        L7["Debug"]:::debug
        L8["Logging"]:::logging
    end
```
