How legendop4/spemcs works
SPEMCS centrally manages secure, proctored exams across Windows lab workstations. Operators use the web console to manage devices, policies, and exams; the backend enrolls endpoints, compiles and signs policies, distributes them over authenticated WebSockets, and gates activation on enforcement readiness. The endpoint service verifies policy and applies firewall controls while monitoring processes and network activity, then uploads telemetry. The README documents this end-to-end workflow and the dashboard’s major capabilities; source excerpts and the index support several internal links, but not every route or runtime integration was sampled.
Main entry points: AgentWorker.cs Privileged agent service · main.py Backend API · agent_ws.py Agent WebSocket · EventUploaderWorker.cs Telemetry uploader
Components 24
Operator console
- Management dashboard
frontend/src/App.tsx - Exam management
frontend/src/pages/ExamShieldPage.tsx - Dashboard API client
frontend/src/services/api.ts
Backend control plane
- Backend API
backend/backend/app/main.py - Agent endpoints
backend/backend/routes/agent_api.py - Policy compilation
backend/backend/services/policy_compiler.py - Policy signing
backend/backend/services/signing_key_manager.py - Activation readiness
backend/backend/services/enforcement_readiness.py - Exam lifecycle
backend/backend/services/exam_service.py
Realtime and persistence
- Agent WebSocket
backend/backend/websocket/agent_ws.py - Connection manager
backend/backend/websocket/manager.py - Relational database
backend/backend/app/database.py - Device records
backend/backend/models/device.py
Endpoint agent
- Privileged agent service
Endpoint-agent/src/Spemcs.Agent.Service/AgentWorker.cs - Central WebSocket client
Endpoint-agent/src/Spemcs.Agent.Service/CentralWebSocketWorker.cs - Policy verification
Endpoint-agent/src/Spemcs.Agent.Core/Network/PolicyReceiver.cs - Process monitoring
Endpoint-agent/src/Spemcs.Agent.Core/Monitoring.cs - Network telemetry
Endpoint-agent/src/Spemcs.Agent.Core/NetworkCollector.cs - Telemetry uploader
Endpoint-agent/src/Spemcs.Agent.Core/EventUploaderWorker.cs - Local agent store
Endpoint-agent/src/Spemcs.Agent.Core/SqliteAgentStore.cs
Policy enforcement
- Enforcement state machine
Endpoint-agent/src/Spemcs.Agent.Core/Network/EnforcementStateMachine.cs - Windows firewall
Endpoint-agent/src/Spemcs.Agent.Core/Network/WindowsFirewallAdapter.cs
Other components
- Exam operator
- Windows workstation
Connections 27
- Exam operator → Management dashboard: manages exams
- Management dashboard → Exam management: routes to
frontend/src/App.tsx - Exam management → Dashboard API client: requests operations
- Dashboard API client → Backend API: calls API
- Windows workstation → Agent endpoints: enrolls
- Agent endpoints → Relational database: persists records
- Backend API → Policy compilation: routes policy operations
- Policy compilation → Policy signing: signs policy
- Backend API → Exam lifecycle: manages exams
- Exam lifecycle → Activation readiness: checks readiness
- Activation readiness → Connection manager: checks presence
- Policy signing → Agent WebSocket: distributes signed policy
- Agent WebSocket → Connection manager: registers connections
backend/backend/websocket/agent_ws.py - Agent WebSocket → Relational database: reads device state
backend/backend/websocket/agent_ws.py - Relational database → Device records: stores device records
backend/backend/models/device.py - Privileged agent service → Central WebSocket client: hosts worker
Endpoint-agent/src/Spemcs.Agent.Service/AgentWorker.cs - Central WebSocket client → Policy verification: validates policy
Endpoint-agent/src/Spemcs.Agent.Service/CentralWebSocketWorker.cs - Policy verification → Enforcement state machine: verified policy
- Enforcement state machine → Windows firewall: enforces rules
Endpoint-agent/src/Spemcs.Agent.Core/Network/EnforcementStateMachine.cs - Windows workstation → Process monitoring: runs monitoring
- Windows workstation → Network telemetry: audits connections
- Privileged agent service → Process monitoring: coordinates monitoring
Endpoint-agent/src/Spemcs.Agent.Service/AgentWorker.cs - Privileged agent service → Network telemetry: coordinates collection
Endpoint-agent/src/Spemcs.Agent.Service/AgentWorker.cs - Privileged agent service → Telemetry uploader: starts uploader
Endpoint-agent/src/Spemcs.Agent.Service/AgentWorker.cs - Telemetry uploader → Local agent store: reads queued events
Endpoint-agent/src/Spemcs.Agent.Core/EventUploaderWorker.cs - Telemetry uploader → Agent WebSocket: uploads telemetry
- Backend API → Management dashboard: serves management data