How ctfer-io/24hiut2025 works
Project type and purpose
• This is a CTF (Capture-The-Flag) repository for the “24h IUT 2025” event.
• It contains:
• A set of challenge definitions (static files, code, Dockerfiles, YAML) under challenges/.
• Infrastructure-as-code scenarios (Pulumi Go programs) for spinning up dynamic challenge instances under each challenges/*/infra/ or challenges/*/dist/.
• A top-level infra/ directory with microservices (auth, players, memes) and deployment manifests for the shared platform.
• CI/CD artifacts in .github/ and configuration files (.ctfd.yaml, Dockerfiles, docker-compose).
File structure
• Top-level:
• .github/: GitHub Actions workflows and PR templates.
• challenges/: grouped by category (crypto, forensic, infra, web, etc.), each with:
– Challenge metadata (WU.md, challenge.yaml).
– Build artifacts under dist/ or code under wu/.
– An infra/scenario/ or infra/ subfolder containing Pulumi programs (Go) or Docker Compose to launch the challenge.
• infra/: three self-contained services—auth/, players/, memes/—each with its own Dockerfile/Pulumi template or Kubernetes YAML.
• Patterns and choices:
• Microservices for platform components.
• Pulumi IaC in Go to provision both platform and per-challenge environments.
• Docker/Docker Compose and static site assets for certain challenges.
• A static web front-end for memes and challenge landing pages.
README for additional insights
• The README lists all challenges, their types (dynamic, dynamic_iac, standard), and release timeline.
• It indicates the platform uses CTFd (via .ctfd.yaml) and Pulumi as IaC.
Components
a. Source & CI/CD
• GitHub repository (code + challenges + IaC).
• GitHub Actions pipelines (build challenge images, run Pulumi deploy).
b. IaC Layer
• Pulumi controller that reads each challenges/*/infra/scenario/Pulumi.yaml + Go program to provision:
• Kubernetes Namespaces or VM instances per challenge
• Docker images pushed to registry
• Challenge containers or pods behind services
• Pulumi deployments for infra/auth, infra/players, infra/memes.
c. Runtime Cluster / Hosting Environment
• Kubernetes cluster (or Docker-Compose host)
• API Gateway / Load Balancer → routes traffic to platform and microservices
• CTFd platform service (frontend + backend)
• Database (MySQL/MariaDB) and optional Redis for session caching
• Auth microservice
• Players microservice
• Memes static-site service
• Challenge namespaces/pods: each challenge runs in its own sandbox (Docker container) exposing a port or service
d. External integrations
• Discord webhook for announcements
• Artifact registry (Docker Hub or private registry)
• Pulumi state backend (S3 / Pulumi Service)
Relationships & data flow
1. Developer pushes to GitHub → triggers GitHub Actions.
2. CI builds challenge Docker images, pushes to registry; builds microservice images.
3. CI invokes Pulumi to update infrastructure:
– Shared platform services
– Individual challenge deployments
4. Pulumi applies changes to the Kubernetes cluster.
5. Users connect via the Internet to the Load Balancer → routed to:
– CTFd web UI to select challenges
– Direct challenge endpoints (e.g., web, pwn, forensic services)
– Static site (memes)
6. CTFd backend interacts with DB and calls Auth/Players microservices as needed.
Architectural patterns & design principles
• Microservices: separate concerns (Auth, Players, Memes) as independent deployable units
• Infrastructure-as-Code: Pulumi Go programs define both platform and per-challenge environments
• Immutable infrastructure: challenge containers are built once (dist/) and deployed unchanged
• Namespace isolation: each challenge environment runs in its own namespace or Docker Compose project
• CI/CD pipeline: fully automated build and deploy on GitHub push
Technologies & frameworks
• Pulumi (Go) for IaC
• Docker / Docker Compose for challenge sandboxing
• Kubernetes for orchestration (optional, inferred from Pulumi scenario)
• CTFd (configured via .ctfd.yaml)
• Go for microservices (auth, players, Pulumi programs)
• Python / Flask for some challenge web apps
• Static HTML/CSS/JS for memes and challenge landing pages