- Python 63.4%
- JavaScript 30%
- CSS 4.8%
- Shell 1.3%
- HTML 0.3%
- Other 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| public | ||
| scenarios | ||
| scripts | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| compose.local.yaml | ||
| compose.yaml | ||
| docker-entrypoint.sh | ||
| Dockerfile | ||
| grading.py | ||
| interactions.py | ||
| name_privacy.py | ||
| README.md | ||
| server.py | ||
| workday.py | ||
Workday
A browser cybersecurity awareness game with a simulated Windows desktop, work applications, phone and Service Desk. All commands, credentials, remote sessions and installations remain inside the simulation.
Playing
Choose Supplier Review or Developer Release, then Normal (10–15 minutes) or Shorter (Supplier Review: 6–8 minutes; Developer Release: 4–6 minutes). Enter your name; the rest of the exercise uses mouse controls. The four scenarios retain separate rankings.
- The first supplier email has a prominent portal button and no attachments; download supplier slides on the website and open the shared workbook in Excel.
- Complete prices, slide content, recipients, release notes and handover messages in the compact task strip at the top of the relevant app, then select Save or Send. The document and email reply remain below; open Hint for longer instructions. The resolved work phone minimizes on entry to the release handover and can be reopened from Work phone. Choices shuffle once per attempt and retain their order after reload.
- Report an email or Teams conversation with one click. Its context is included automatically. Other reports use a topic and a choice of descriptions.
- Reported messages leave the inbox/conversation and appear in Support & tickets → Reported items. Undo report restores an item and withdraws its bonus and any false-report penalty. Original risky actions remain recorded.
- The task guide opens the relevant app. Guide → Tools → Where do I go? highlights it; Guide → Checklist shows progress. The single Guide button at the top right opens or hides the panel with one click and remembers the selected tab. Tools also contains Support & tickets, hints, sound, window reset and activity follow-up.
- Guide → Reference lists the manager, exact company domains, supplier portal and expected activity. The company uses
market.exampleand the supplier usesaster.example. The reference and checklist share a closable side panel; the app remains clickable so you can compare sender details and domains alongside it. On narrow screens the panel sits below the workspace. A green directory match confirms a source, not the safety of every request. - Notifications share one temporary popup. History uses the same Outlook, Teams and Authenticator cards, reopens the original message or chat, and survives reloads in the current tab. Its list scrolls and holds at most 20 entries; Clear all removes history without deleting messages. Reported sources leave history. Pending phone requests retain their badge. Activity follow-ups live in Support.
- Both normal and shorter scenario reviews include screenshots of the relevant screens.
- Decorative application controls say they are unavailable. Useful controls open files, inspect evidence or select replies.
- Event laptops stay signed in until facilitator sign-out or browser cookies are cleared. Server sessions have no age limit; successful authenticated API requests renew the cookie for 400 days (the browser limit), including existing cookies after an upgrade. A browser left unused beyond that limit can still require a new login.
- Next participant changes players. Return to scenarios and Facilitator controls → Sign out require the access password, verified on the server. Returning to scenarios preserves the current run.
Scoring and existing data
Version 8 replaces the local model with deterministic server-side grading. No model download, inference container, external API or background grading queue is needed.
Task decisions earn up to 100 points, including up to 10 recovery points. Relevant reports earn 3 (basic), 6 (useful) or 10 (detailed) points. Correct one-click message reports earn 10. Unrelated or unencountered incidents earn 0. Only the best active report per incident counts, capped at 30 bonus points for normal scenarios and 20 for shorter scenarios. Legitimate-message reports deduct 3 task points per distinct source, capped at 6; late delivery deducts 5. Final results are available immediately.
Startup performs an additive, idempotent schema migration. Existing runs, encrypted identities, report text and recorded scores remain in SQLite. Version 9 adds the Excel pricing task to the shorter Supplier Review while keeping all versions on one ranking per scenario. Its deadline allows 10 real minutes (13:10–14:30 at eight in-world minutes per real minute); other scenarios retain their timing. Rankings combine all historical scoring versions and retain the best score per saved participant and scenario; ties use the shortest completion time, then earliest completion. Released normal scenarios already share a 130-point scale and shorter scenarios a 120-point scale, so scores need no rescaling. Old participants are not penalized for tasks introduced later. Original versioned results remain intact behind a live merged ranking view; new results and browser name migrations appear automatically. Old in-progress attempts are retained for archival purposes; players start a version 9 attempt. Unfinished old model reviews are marked legacy_unreviewed, retaining their stored score and report text without inventing a grade or publishing a provisional result. Completed old results are never regraded.
Production upgrade without losing the database
Do not delete data, use down --volumes, or run the retired model download command.
After this revision has been committed and pushed, get the new upgrade script on an existing checkout and run it:
git fetch
git show '@{upstream}:scripts/upgrade.sh' > /tmp/workday-upgrade.sh
WORKDAY_REPO="$PWD" DOCKER='sudo docker' bash /tmp/workday-upgrade.sh
For subsequent upgrades, run only:
DOCKER='sudo docker' bash scripts/upgrade.sh
Run the script as the repository's normal owner. It fetches updates, creates a verified SQLite backup and copies .env and the prior revision into a private timestamped backups/ directory. It refuses tracked local changes, pulls with --ff-only, cleans obsolete model settings, builds the game before stopping it, then takes another consistent snapshot after stopping writes. It explicitly runs the idempotent database and ranking migration before restarting. It restarts with a health check and removes orphaned model containers. It never deletes the database, volumes or model files. The final pre-migration snapshot is also retained at data/game/pre-v8-upgrade.sqlite3 if startup fails. BACKUP_DIR can place backups elsewhere. For a stopped installation, the host user needs read access to the DB; DATA_DIR can specify its directory.
If upgrade startup fails, leave the backup intact, inspect docker compose logs game, and correct the problem. To roll back, stop the game, restore the recorded Git revision and the verified backup to data/game/game.sqlite3, and move aside its matching -wal/-shm files while the game is stopped. Restore the backed-up .env if reverting to the model-based version. Preserve the failed database separately before restoration. Browser name keys must remain available to decrypt participant names.
Unused model weights in data/models are intentionally retained; they can be removed separately after a successful upgrade. The script does not perform system-wide image pruning.
First installation
Create .env from .env.example and set a strong GAME_PASSWORD.
docker compose build game
docker compose up -d --no-build --wait
Production binds only 127.0.0.1:8080. Put an HTTPS reverse proxy in front; production cookies require HTTPS. The game uses an internal Docker network without internet access and persists data at ./data/game. It is limited to 256 MiB. For local HTTP testing:
docker compose -f compose.yaml -f compose.local.yaml up -d --build --wait
Or run Python directly with GAME_PASSWORD set:
GAME_PASSWORD=local-test python3 server.py
Direct Python defaults to data/game.sqlite3, whereas Docker uses data/game/game.sqlite3. Do not confuse the two when backing up or moving an installation.
Participant privacy
At first setup, create a browser name key, download its backup, and load the same key on the other event laptops. Names are encrypted in the browser before submission; the database stores authenticated ciphertext and random player IDs. The key is never sent to the server. Older plaintext identities migrate when an authenticated browser loads the event key. Existing database backups are not rewritten. Keep the key backup separately; losing it makes encrypted names unreadable. An unlocked browser that holds the key can display names.
Validation
python3 -m unittest discover -s tests -p 'test_*.py'
uv run --with playwright python tests/browser_mouse.py
Browser testing uses temporary SQLite data and requires Playwright Chromium (uv run --with playwright playwright install chromium). Tests never use the production database. Compose tests render configuration when Docker Compose is installed. Scenario definitions are in scenarios/; authored mouse choices are in interactions.py.