Compose support
The platform converts the compose file into Kubernetes objects. Most of what you'd use in a challenge works, but some Compose features have no equivalent, and some are left out for security. ctfgarden lint checks all of this for you: it warns about everything the platform ignores, and fails on everything that stops the challenge from deploying.
At the top level, only services and volumes are used (plus the x-ctf- extensions). networks, secrets, configs, include and name are ignored.
Unknown fields
The platform's compose parser rejects fields it doesn't know. A typo like imgae: makes the whole challenge fail to load, so run ctfgarden lint before pushing.
Services
Supported: image, build, command, entrypoint, environment, env_file, working_dir, user, group_add, ports, expose, volumes, tmpfs, shm_size, read_only, cap_add, cap_drop, privileged, init, tty, stdin_open, stop_signal, stop_grace_period, hostname, domainname, extra_hosts, dns, dns_opt, dns_search, labels, annotations, container_name, cpus, cpu_count, mem_limit, mem_reservation, scale, deploy, runtime, pull_policy.
Some of these work a bit differently:
| Field | Notes |
|---|---|
build | The image is built by the platform (Administration → Builds) and shared by all teams. Only context, dockerfile and args are used, so the last stage of a multi-stage Dockerfile is built. If image is set too, the built image isn't used |
privileged, cap_add | The service runs in a lightweight VM (Kata Containers) instead of a container. You have the privileges inside the VM, but no access to host devices |
user | Only numeric user IDs, not user names |
volumes | Only named volumes, tmpfs, and bind mounts from the data directory. Mounts are always writable: :ro and read_only: true are ignored |
ports | Exposed over TLS, see exposing services. host_ip isn't supported, mode is ignored |
deploy | Only replicas and labels. Use cpus and mem_limit instead of deploy.resources |
labels, annotations | Set on the pods |
pull_policy | build isn't supported |
runtime | Ignored for services that run in a VM |
Ignored (they work with ctfgarden compose locally, but not on the platform):
| Field | What happens instead |
|---|---|
depends_on | All services start at the same time. Make your services retry until their dependencies are up |
restart | Containers that exit are always restarted |
healthcheck | Not converted to Kubernetes probes |
links, external_links | Services reach each other by their name anyway |
logging | Logs are collected by the cluster |
extends | Not resolved, copy the fields instead |
volumes_from | Declare the volumes on each service |
configs, secrets | Use environment variables or files |
cpu_shares, cpu_quota, cpu_period, cpu_percent, cpu_rt_period, cpu_rt_runtime, cpuset, blkio_config | Use cpus |
devices, device_cgroup_rules, cgroup, cgroup_parent, ipc, uts, userns_mode, attach, develop, credential_spec, isolation | Not available |
Not supported (the challenge can't be deployed): networks and network_mode (all services of an instance share one network, use a network policy to restrict it), sysctls, ulimits, security_opt, pid, pids_limit, platform, profiles, mac_address, mem_swappiness, memswap_limit, oom_kill_disable, oom_score_adj, storage_opt.
Volumes
Named volumes are created per instance. Set their size with x-size, everything else (driver, driver_opts, labels, name) is ignored, and external volumes aren't supported:
services:
db:
image: postgres:18
volumes:
- db-data:/var/lib/postgresql
volumes:
db-data:
x-size: 500MiThe data directory
Bind mounts only work from the data/ directory of the challenge. Its contents (with templates rendered for the team) are copied into a volume for every instance before it starts, and mounted where you bind-mount them:
services:
web:
image: nginx:alpine
volumes:
- ./data/html:/usr/share/nginx/html
- ./data/flag.txt:/flag.txt # from data/flag.txt.plfSet the size of that volume with data_pvc_size in the metadata. Changes an instance makes to it are lost when the instance stops.
Network policies
By default, services can talk to each other, to the cluster's DNS and to the internet. Restrict that with x-ctf-network-policy on a service, or at the top level for all services. As soon as you add a policy, everything it doesn't allow is dropped:
services:
bot:
image: my-admin-bot
x-ctf-network-policy:
outgoing:
rules:
- other_party: Challenge # Challenge, ClusterDns or World
- other_party: ClusterDns
ports: # optional, all ports if left out
- port: 53
protocols: [UDP, TCP]Only outgoing traffic can be restricted. An invalid policy is ignored by the platform without an error, ctfgarden lint reports it.
Extensions
The platform reads these extensions, other x- keys are allowed (for YAML anchors, for example) and ignored:
| Extension | Description |
|---|---|
x-ctf-metadata | The challenge metadata |
x-ctf-vms | Virtual machines |
x-ctf-network-policy | Network policies, on services or at the top level |
x-size | Size of a named volume |
x-username, x-password | Credentials of an SSH port |