OSCTF

module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: Apache-2.0

README

OSCTF

An open, self-hostable platform for cybersecurity competitions, labs, and training. v0.2: dynamic per-team challenge instances — each team gets its own isolated container, with its own flag, managed by a built-in scheduler.

CTFs are the entry point; the durable goal is to be the open infrastructure layer that universities, communities, and companies build their security education on. See docs/project-desc.md for the full vision and roadmap.

Quick start (golden path)

git clone <repo> && cd OSCTF
cp .env.example .env          # then edit OSCTF_ADMIN_EMAIL / OSCTF_ADMIN_PASSWORD
docker compose up -d --build

Within minutes you have authentication, teams, a challenge board with seeded examples, flag submission with scoring, a live scoreboard, and an admin panel — at http://localhost:8080. No cloud account, no license key, no external services.

Security note: the platform mounts the host Docker socket to run challenge containers, which is root-equivalent on the host. Run events on a dedicated VM. See docs/v0.1/08-challenge-runtime.md.

Local development

make setup      # install pinned tools + npm ci
make dev        # start Postgres, Redis, MinIO (compose)
make dev-api    # run the Go API on :8080
make dev-web    # run the Vite dev server on :5173 (proxies /api -> :8080)

For everything else — architecture, how to add an endpoint, how to author a challenge — read AGENTS.md and docs/.

Layout

Path What
api/ Go backend (modular monolith): HTTP, services, stores, runtime
dashboard/ React + TypeScript SPA (Vite)
examples/ Seeded example challenges (challenge.yaml format)
deploy/ Prometheus/Grafana/Caddy configs (optional compose profiles)
docs/ The build specification (docs/v0.1/) and vision (docs/project-desc.md)
scripts/ Smoke test and dev helpers

License

Apache License 2.0. Contributions are accepted under the same license (see NOTICE).

Per-team instances (v0.2)

Mark a container challenge per_team in the admin editor; participants then click Start to get their own container (own port, network-isolated, optional per-team unique flag) and Stop/Extend it. The scheduler expires instances on a TTL and tears them all down at event end. Tunable via OSCTF_INSTANCE_TTL, OSCTF_INSTANCE_EXTEND, OSCTF_INSTANCE_MAX_TTL, OSCTF_TEAM_INSTANCE_QUOTA, and OSCTF_FLAG_PREFIX (see .env.example). Every challenge container now runs read-only-rootfs with egress control; per-team instancing needs the wider OSCTF_PORT_RANGE (30000–32767) open on the host. Full spec: docs/v0.2/.

Status

v0.2, feature-complete. No API stability promises before v1.0.

Directories

Path Synopsis
examples
challenges/cookie-monster/src command
cookie-monster: sets a role=guest cookie; a role=admin cookie reveals the flag.
cookie-monster: sets a role=guest cookie; a role=admin cookie reveals the flag.
challenges/env-hunter/src command
env-hunter proves the platform injects FLAG at runtime: the image ships with no flag baked in; /debug?var=FLAG reads it from the environment.
env-hunter proves the platform injects FLAG at runtime: the image ships with no flag baked in; /debug?var=FLAG reads it from the environment.
challenges/hardening-demo/src command
hardening-demo serves its flag at / and lets players observe the v0.2 runtime hardening: a read-only rootfs with only /tmp and declared writable_paths (/data) writable, dropped capabilities, and no network egress.
hardening-demo serves its flag at / and lets players observe the v0.2 runtime hardening: a read-only rootfs with only /tmp and declared writable_paths (/data) writable, dropped capabilities, and no network egress.
challenges/per-team-pwn/src command
per-team-pwn is a tiny TCP service that hands over the per-instance FLAG once the client sends the magic word.
per-team-pwn is a tiny TCP service that hands over the per-instance FLAG once the client sends the magic word.
challenges/per-team-web/src command
per-team-web serves a per-team, per-instance flag.
per-team-web serves a per-team, per-instance flag.
challenges/robots-rule/src command
robots-rule: a tiny stateless web app.
robots-rule: a tiny stateless web app.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL