How jonscafe/whaley works
Whaley is a Docker-based CTF challenge instancer. Participants authenticate (or use IP-based identity), request a challenge instance, and receive isolated containers with allocated ports; administrators manage challenges and inspect instances through a separate dashboard. The graph preserves the documented flag, firewall, monitoring, forensics, and packet-capture capabilities. Several feature-specific links rely on README descriptions because their implementation was not sampled; those links are dashed where the caller is not established by the available evidence.
Main entry points: docker_manager.py Instance orchestration · monitoring.py Monitoring API · deps.py Shared dependencies · admin.py Admin API
Components 25
Web interface
- Web dashboard
app/static/app.js - Application entry
app/main.py - Instance API
app/routers/instances.py - Challenge manager API
app/routers/challenges.py - Admin API
app/routers/admin.py - Monitoring API
app/routers/monitoring.py
Instance runtime
- Shared dependencies
app/deps.py - Instance orchestration
app/docker_manager.py - Port allocation
app/port_manager.py - Runtime settings
app/config.py
Identity and flags
- Authentication
app/auth.py - Dynamic flags
app/flag_manager.py - Firewall limits
app/firewall_manager.py
Operations and forensics
- Host and container metrics
app/monitoring.py - Instance forensics
app/forensics.py - Packet capture and flows
app/pcap_manager.py - IP correlation
app/ip_correlation.py - Event logging
app/logger.py
Persistence
- Relational database
app/database/connection.py - Persistent records
app/database/models.py
Other components
- Participant
- Administrator
- Docker Engine
- CTFd
- Redis lock service
Connections 39
- Participant → Web dashboard: uses
README.md - Administrator → Web dashboard: uses
README.md - Web dashboard → Instance API: requests instances
- Web dashboard → Admin API: requests management
- Application entry → Instance API: registers routes
app/main.py - Application entry → Admin API: registers routes
app/main.py - Application entry → Challenge manager API: registers routes
app/main.py - Application entry → Monitoring API: registers routes
app/main.py - Instance API → Shared dependencies: uses shared helpers
app/routers/instances.py - Challenge manager API → Shared dependencies: uses shared helpers
app/routers/challenges.py - Admin API → Shared dependencies: uses shared helpers
app/routers/admin.py - Monitoring API → Shared dependencies: uses shared helpers
app/routers/monitoring.py - Shared dependencies → Authentication: validates access
app/deps.py - Authentication → CTFd: validates tokens
app/auth.py - Instance API → Instance orchestration: spawns and stops
- Shared dependencies → Instance orchestration: shares manager
app/deps.py - Instance orchestration → Docker Engine: manages containers
app/docker_manager.py - Instance orchestration → Port allocation: allocates ports
app/docker_manager.py - Instance orchestration → Dynamic flags: injects flags
app/docker_manager.py - Instance orchestration → Firewall limits: applies limits
app/docker_manager.py - Instance orchestration → Packet capture and flows: configures capture
app/docker_manager.py - Admin API → Dynamic flags: manages mappings
app/routers/admin.py - Dynamic flags → CTFd: registers flags
README.md - Admin API → Host and container metrics: serves monitoring
- Monitoring API → Host and container metrics: requests metrics
app/routers/monitoring.py - Monitoring API → Instance forensics: requests captures
app/routers/monitoring.py - Monitoring API → Firewall limits: reports status
app/routers/monitoring.py - Monitoring API → Packet capture and flows: searches flows
app/routers/monitoring.py - IP correlation → Packet capture and flows: correlates traffic
app/ip_correlation.py - Instance orchestration → Instance forensics: captures on termination
app/docker_manager.py - Instance orchestration → Event logging: records events
- Port allocation → Relational database: persists allocations
app/port_manager.py - Dynamic flags → Relational database: persists mappings
app/flag_manager.py - Firewall limits → Relational database: stores rule state
app/firewall_manager.py - Event logging → Relational database: persists events
app/logger.py - Relational database → Persistent records: creates schema
app/database/connection.py - Instance orchestration → Redis lock service: coordinates locks
README.md - Port allocation → Redis lock service: coordinates locks
app/port_manager.py - Runtime settings → Instance orchestration: configures runtime
app/docker_manager.py