# thinkst/opencanary architecture

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

- Interactive diagram: https://gitdiagram.com/thinkst/opencanary
- Repository: https://github.com/thinkst/opencanary

## Overview

OpenCanary is a daemon-based, multi-protocol network honeypot: operators configure deceptive services, network activity reaches those services, and detected interactions produce alerts. The graph preserves the documented protocol breadth and the major sampled implementation layers. Some protocol modules and alert integrations were not excerpted, so their links are shown only where the README documents them; unsampled implementation details are not inferred.

Main entry points: [`opencanary/modules/__init__.py`](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/__init__.py) (Service base), [`opencanary/modules`](https://github.com/thinkst/opencanary/tree/master/opencanary/modules) (Protocol emulators), [`opencanary/logger.py`](https://github.com/thinkst/opencanary/blob/master/opencanary/logger.py) (Event logger), [`opencanary/config.py`](https://github.com/thinkst/opencanary/blob/master/opencanary/config.py) (Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Daemon runtime"]
  node_daemon["Daemon entry"]
  node_configuration["Configuration<br/>[config.py]"]
end

subgraph group_protocols["Honeypot services"]
  node_protocol_family["Protocol emulators"]
  node_http_service["HTTP deception<br/>[http.py]"]
  node_mongodb_service["MongoDB deception<br/>[mongodb.py]"]
  node_mssql_service["MSSQL deception<br/>[mssql.py]"]
  node_redis_service["Redis deception<br/>[redis.py]"]
  node_ssh_service["SSH deception<br/>[ssh.py]"]
  node_tcp_service["TCP banner<br/>[tcpbanner.py]"]
  node_portscan_service["Port-scan detection<br/>[portscan.py]"]
  node_llmnr_service["LLMNR detection<br/>[llmnr.py]"]
end

subgraph group_telemetry["Detection and alerts"]
  node_event_logger["Event logger<br/>[logger.py]"]
  node_alert_destinations["Alert destinations"]
end

subgraph group_support["Shared services"]
  node_service_base["Service base<br/>[__init__.py]"]
  node_credential_checks["Honey-credentials<br/>[honeycred.py]"]
  node_ip_helpers["IP helpers<br/>[iphelper.py]"]
  node_des_crypto["DES routines<br/>[des.py]"]
end

node_operator(("Operator"))
node_network_actor(("Network visitor"))

node_operator -->|"starts"| node_daemon
node_operator -->|"configures"| node_configuration
node_daemon -.->|"loads"| node_configuration
node_daemon -.->|"runs"| node_protocol_family
node_configuration -->|"enables"| node_protocol_family
node_network_actor -->|"interacts"| node_protocol_family
node_network_actor -->|"scans"| node_portscan_service
node_protocol_family -->|"extends"| node_service_base
node_http_service -->|"extends"| node_service_base
node_mongodb_service -->|"extends"| node_service_base
node_mssql_service -->|"extends"| node_service_base
node_redis_service -->|"extends"| node_service_base
node_ssh_service -->|"extends"| node_service_base
node_tcp_service -->|"extends"| node_service_base
node_llmnr_service -->|"extends"| node_service_base
node_service_base -->|"checks credentials"| node_credential_checks
node_service_base -->|"logs events"| node_event_logger
node_protocol_family -->|"raises alerts"| node_event_logger
node_portscan_service -->|"raises alerts"| node_event_logger
node_event_logger -->|"delivers alerts"| node_alert_destinations
node_mssql_service -->|"reads settings"| node_configuration
node_des_crypto -.->|"supports crypto"| node_ssh_service
node_ip_helpers -.->|"supports address checks"| node_event_logger

click node_daemon "https://github.com/thinkst/opencanary/blob/master/bin/opencanaryd"
click node_configuration "https://github.com/thinkst/opencanary/blob/master/opencanary/config.py"
click node_protocol_family "https://github.com/thinkst/opencanary/tree/master/opencanary/modules"
click node_http_service "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/http.py"
click node_mongodb_service "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/mongodb.py"
click node_mssql_service "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/mssql.py"
click node_redis_service "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/redis.py"
click node_ssh_service "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/ssh.py"
click node_tcp_service "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/tcpbanner.py"
click node_portscan_service "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/portscan.py"
click node_llmnr_service "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/llmnr.py"
click node_service_base "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/__init__.py"
click node_credential_checks "https://github.com/thinkst/opencanary/blob/master/opencanary/honeycred.py"
click node_ip_helpers "https://github.com/thinkst/opencanary/blob/master/opencanary/iphelper.py"
click node_des_crypto "https://github.com/thinkst/opencanary/blob/master/opencanary/modules/des.py"
click node_event_logger "https://github.com/thinkst/opencanary/blob/master/opencanary/logger.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_daemon,node_configuration toneBlue
class node_protocol_family,node_http_service,node_mongodb_service,node_mssql_service,node_redis_service,node_ssh_service,node_tcp_service,node_portscan_service,node_llmnr_service toneAmber
class node_event_logger,node_alert_destinations toneMint
class node_service_base,node_credential_checks,node_ip_helpers,node_des_crypto toneRose
class node_operator,node_network_actor toneIndigo
```

## Components

### Daemon runtime

- [Daemon entry](https://github.com/thinkst/opencanary/blob/master/bin/opencanaryd): `bin/opencanaryd`
- [Configuration](https://github.com/thinkst/opencanary/blob/master/opencanary/config.py): `opencanary/config.py`

### Honeypot services

- [Protocol emulators](https://github.com/thinkst/opencanary/tree/master/opencanary/modules): `opencanary/modules`
- [HTTP deception](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/http.py): `opencanary/modules/http.py`
- [MongoDB deception](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/mongodb.py): `opencanary/modules/mongodb.py`
- [MSSQL deception](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/mssql.py): `opencanary/modules/mssql.py`
- [Redis deception](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/redis.py): `opencanary/modules/redis.py`
- [SSH deception](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/ssh.py): `opencanary/modules/ssh.py`
- [TCP banner](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/tcpbanner.py): `opencanary/modules/tcpbanner.py`
- [Port-scan detection](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/portscan.py): `opencanary/modules/portscan.py`
- [LLMNR detection](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/llmnr.py): `opencanary/modules/llmnr.py`

### Detection and alerts

- [Event logger](https://github.com/thinkst/opencanary/blob/master/opencanary/logger.py): `opencanary/logger.py`
- **Alert destinations**

### Shared services

- [Service base](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/__init__.py): `opencanary/modules/__init__.py`
- [Honey-credentials](https://github.com/thinkst/opencanary/blob/master/opencanary/honeycred.py): `opencanary/honeycred.py`
- [IP helpers](https://github.com/thinkst/opencanary/blob/master/opencanary/iphelper.py): `opencanary/iphelper.py`
- [DES routines](https://github.com/thinkst/opencanary/blob/master/opencanary/modules/des.py): `opencanary/modules/des.py`

### Other components

- **Operator**
- **Network visitor**

## Connections

- Operator → Daemon entry: starts (evidence: `README.md`)
- Operator → Configuration: configures (evidence: `README.md`)
- Daemon entry → Configuration: loads
- Daemon entry → Protocol emulators: runs
- Configuration → Protocol emulators: enables (evidence: `README.md`)
- Network visitor → Protocol emulators: interacts (evidence: `README.md`)
- Network visitor → Port-scan detection: scans (evidence: `README.md`)
- Protocol emulators → Service base: extends (evidence: `opencanary/modules/__init__.py`)
- HTTP deception → Service base: extends (evidence: `opencanary/modules/http.py`)
- MongoDB deception → Service base: extends (evidence: `opencanary/modules/mongodb.py`)
- MSSQL deception → Service base: extends (evidence: `opencanary/modules/mssql.py`)
- Redis deception → Service base: extends (evidence: `opencanary/modules/redis.py`)
- SSH deception → Service base: extends (evidence: `opencanary/modules/ssh.py`)
- TCP banner → Service base: extends (evidence: `opencanary/modules/tcpbanner.py`)
- LLMNR detection → Service base: extends (evidence: `opencanary/modules/llmnr.py`)
- Service base → Honey-credentials: checks credentials (evidence: `opencanary/modules/__init__.py`)
- Service base → Event logger: logs events (evidence: `opencanary/modules/__init__.py`)
- Protocol emulators → Event logger: raises alerts (evidence: `README.md`)
- Port-scan detection → Event logger: raises alerts (evidence: `README.md`)
- Event logger → Alert destinations: delivers alerts (evidence: `README.md`)
- MSSQL deception → Configuration: reads settings (evidence: `opencanary/modules/mssql.py`)
- DES routines → SSH deception: supports crypto
- IP helpers → Event logger: supports address checks (evidence: `opencanary/logger.py`)
