How awaisshakir/skills-secure-code-game works
Purpose and Operating Model
Secure Code Game is a GitHub Security Lab, repository-native security training course. Learners clone/template the repository, work through independent levels containing intentionally vulnerable code, implement a fix, and validate it with level-specific checks. It is not a unified application or service; each level is an isolated exercise.
Paths: README.md, Season-1/README.md, Season-2/README.md, Season-3/README.md.
Primary Entry Points
The root README directs learners to select a season and read its season README. Each level’s editable code.* file is the principal learner entry point; solution.* is the reference implementation, while hack.* supplies attack/exploit scenarios or adversarial inputs.
Paths: Season-1/Level-1/code.py, Season-2/Level-2/code.go, Season-3/Level-1/code.spec.js.
Season 1: Multi-language Secure-Code Exercises
Season 1 consists of five mostly Python exercises plus a C exercise. A level typically couples vulnerable source, exploit code, hints, a solution, and executable tests. One exercise includes a PDF asset; the course documentation also identifies SQLite usage in Level 4.
Paths: Season-1/Level-2/code.h, Season-1/Level-3/assets/tax_form.pdf, Season-1/Level-4/code.py.
Season 2: Platform and Application Security Exercises
Season 2 broadens the runtime and attack surface across GitHub Actions YAML, Go, Node.js, Python/templates, and browser JavaScript. Level-local dependencies and modules make exercises self-contained rather than shared through a root application package.
Paths: Season-2/Level-1/code.yml, Season-2/Level-2/go.mod, Season-2/Level-3/package.json, Season-2/Level-4/templates/index.html, Season-2/Level-5/index.html.
Season 3: AI-focused Specification Challenges
Season 3 uses Node/Vitest as a common runner. Each level is represented primarily by a JavaScript specification (code.spec.js), a textual target solution, and hints. Shared utility code provides common checking/support behavior, forming the only clear shared implementation layer among these levels.
Paths: Season-3/package.json, Season-3/vitest.config.js, Season-3/.utils/check.js, Season-3/Level-6/code.spec.js.
Validation and Control Flow
Per-level flow is: inspect vulnerable code/specification → apply a security fix → run the matching test/spec runner or adversarial hack → compare against expected secure behavior. Tests and hacks are deliberately boundary artifacts: they exercise learner code but are not production runtime components. Reference solutions preserve intended completion criteria.
Paths: Season-1/Level-5/tests.py, Season-2/Level-3/tests.js, Season-2/Level-2/hack_test.go, Season-3/Level-2/solution.txt.
Runtimes, Infrastructure, and External Dependencies
Execution requires Python, C tooling, Go, Node.js/npm, and YAML support according to level. Python dependencies are centrally declared; Node dependencies are scoped to applicable season/levels; Go Level 2 has its own modules. GitHub Codespaces/devcontainers provide a ready-to-run environment. GitHub Actions automate repository checks and CodeQL security analysis; GitHub Discussions and Slack are support channels.
Paths: requirements.txt, .devcontainer/devcontainer.json, .github/workflows/codeql-analysis.yml, .github/workflows/jarvis-code.yml.
Main entry points: README.md Season 2 guide · vitest.config.js Vitest runner · code.py Editable vulnerable code · tests.py Level tests
Components 22
Course navigation
- Root course guide · Directs learners to a season.
README.md
Season 1
Multi-language secure-code exercises.
- Season 1 guide
Season-1/README.md - Editable vulnerable code · Representative Python level entry point.
Season-1/Level-1/code.py - C exercise
Season-1/Level-2/code.h - SQLite exercise
Season-1/Level-4/code.py - Level asset
Season-1/Level-3/assets/tax_form.pdf - Level tests
Season-1/Level-5/tests.py
Season 2
Platform and application security exercises.
- Season 2 guide
Season-2/README.md - Actions YAML exercise
Season-2/Level-1/code.yml - Go module exercise · Level-local Go dependencies and adversarial tests.
Season-2/Level-2/go.mod - Node exercise · Level-local Node dependencies and tests.
Season-2/Level-3/package.json - Template exercise
Season-2/Level-4/templates/index.html - Browser exercise
Season-2/Level-5/index.html
Season 3
AI specification challenges.
- Season 3 guide
Season-3/README.md - Level specifications · Learners implement behavior specified by JavaScript tests.
Season-3/Level-1/code.spec.js - Later level spec
Season-3/Level-6/code.spec.js - Text target solution · Preserves completion criteria.
Season-3/Level-2/solution.txt - Vitest runner
Season-3/vitest.config.js - Shared check utility · Only clear shared implementation layer across Season 3 levels.
Season-3/.utils/check.js
Execution and automation
- Runtime dependencies · Python dependencies are centrally declared; other runtimes are level-scoped.
requirements.txt - Codespaces environment
.devcontainer/devcontainer.json - GitHub checks and CodeQL
.github/workflows/codeql-analysis.yml
Connections 24
- Root course guide → Season 1 guide: choose season
- Root course guide → Season 2 guide: choose season
- Root course guide → Season 3 guide: choose season
- Season 1 guide → Editable vulnerable code: introduces levels
- Editable vulnerable code → Level tests: validate fix
- C exercise → Level tests: level checks
- SQLite exercise → Level tests: level checks
- Level asset → Editable vulnerable code: exercise input
- Season 2 guide → Actions YAML exercise: introduces levels
- Season 2 guide → Go module exercise: introduces levels
- Season 2 guide → Node exercise: introduces levels
- Season 2 guide → Template exercise: introduces levels
- Season 2 guide → Browser exercise: introduces levels
- Season 3 guide → Level specifications: introduces levels
- Season 3 guide → Later level spec: introduces levels
- Level specifications → Vitest runner: run specs
- Later level spec → Vitest runner: run specs
- Vitest runner → Shared check utility: uses shared checks
- Text target solution → Level specifications: expected behavior
- Runtime dependencies → Editable vulnerable code: Python runtime
- Codespaces environment → Runtime dependencies: provisions tooling
- Codespaces environment → Vitest runner: provisions Node
- GitHub checks and CodeQL → Level tests: automates checks
- GitHub checks and CodeQL → Vitest runner: automates checks