ArmyCyberInstitute / cmgr

CTF Challenge Manager
Apache License 2.0
17 stars 9 forks source link

Templating - Port assignment #13

Closed boomcan90 closed 2 years ago

boomcan90 commented 3 years ago

I am trying to build an android application that will connect to the port exposed by cmgr. Templating it as follows (as supported by hacksport):

tcpParameters.setPort({{port}});

However, this causes a build failure, since the {{port}} is not being templated. Am I going about this in a wrong manner?

jrolli commented 3 years ago

First, sorry for the delayed response.

Right now, we only assign ports when an instance of a challenge is actually spun-up which means port information is not available at build time. And in fact, the challenge server does not template {{port}} in the details/hints either - that is left up to the frontend to provide flexibility for proxies or other middleware.

I'll look at what it would take to allow "binding" of a port at build time and exposing that to the builds, but it is probably a long shot. My primary concern is that injecting a port number at build time is making a promise that the underlying may not be able to keep in the future (particularly after a reboot).

A second concern I have is that this would effectively allow challenges to mandate allowing direct connections to the challenges on the server. One of our goals in the refactor was to make it possible to implement a challenge server that could be more easily instrumented for collecting metrics for research (such as per-user interaction times and time-to-solve) which would likely require a specialized proxy between users and the challenges themselves.

jrolli commented 2 years ago

Closing this as outside the design goals of cmgr. Once #31 is addressed, there are some better stability guarantees on ports then what we currently have and is probably the most cmgr will be able to support.