Integrate with a CTF platform

Tips, tricks and guidelines on the integration of Chall-Manager in a CTF platform.

So you want to integrate chall-manager with a third-party ? Good job, you are contributing to the ecosystem !

Here are the known integrations:

The design

The API is split in two services:

  • the ChallengeStore to handle the CRUD operations on challenges (ids, scenarios, etc.).
  • the InstanceManager to handle players CRUD operations on instances.

You’ll have to handle both services as part of the chall-manager API if you want proper integration.

We encourage you to add additional efforts around this integration, with for instance:

  • management views to monitor which challenge is started for every players ;
  • pre-provisionning and/or pools to better handle load spikes at the beginning of the event ;
  • add rate limiting through a mana ;
  • the support of OpenTelemetry for distributed tracing, that could ease understanding production workloads and debugging the distributed systems.

Use the proto

Chall-Manager was conceived using Model-Based Systems Engineering, so models were first designed then manually translated (MTT) into .proto pseudo-code. This pseudo-code then generates the API code (TTT).

This makes the .proto files the perfect candidate to communicate with Chall-Manager. Those could be found in the subdirectories here. Refer the your proto-to-code tool for generating a client from those.

If you are using Golang, you can directly use the generated clients for the ChallengeStore and InstanceManager services API.

If you cannot or don’t want to use the proto files, you can use the HTTP gateway.

Use the gateway

Because some languages don’t support gRPC, or you don’t want to, you can simply communicate with chall-manager through its JSON REST API.

Chall-Manager has a gRPC+HTTP API, so you don’t have to update deployment to use it. Nevertheless, for development purposes, we recommend you use the swagger that could be turned on with either --gw-swagger as an arg or GATEWAY_SWAGGER=true as a varenv.

You can then reach the Swagger at /swagger, which should show you the following.

The chall-manager REST JSON API Swagger.

Use this Swagger to understand the API, and build your language-specific client in order to integrate chall-manager. We do not provide official language-specific REST JSON API clients.