security-summer-school / template-internal

Private/Internal template repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Port distribution for each activity / challenge

gabrielmocanu opened this issue · comments

We may end up in some situations where we have only one VM available to deploy the activities and we have to use different ports.
We need to find a way for each activity / challenge on each track to use a different port, given that we have a fairly large range, we should not worry that we will have more than 10k activities / challenges, but depending on the distribution we can lose many ports.

My proposed solution was:
XYYZZ

  • X -> Track Id
  • YY -> Session Id
  • ZZ -> Challenge Id

@teodutu has identified a problem in this algorithm, the fact that we cannot have more than 6 tracks.

Another issue: a challenge can require more than one (exposed) port.

If coming up with an algorithm seems like overengineering, I don't see the problem with just assigning ports as they go, without an algorithm, as long as they are properly stated somewhere.