echoCTF / echoCTF.RED

A platform to develop, run and administer CTF competitions. The online echoCTF.RED platform user interfaces and codebase
https://echoCTF.RED/
BSD 2-Clause "Simplified" License
108 stars 23 forks source link

[BUG] Multiple issues with spawning private target instances #1147

Closed sashathomas closed 4 months ago

sashathomas commented 4 months ago

Describe the bug Having a couple issues with private instances of targets. First, creating a new private target from the mUI results in a 500 error. Afterwards, both the mUI and the pUI think the private instance have been created, but the docker container is never started. Second, and this could be my fault, but there is no option from the pUI to spawn/reboot/destroy private instances, even for targets which are marked as spinnable and private instances being checked. Not sure if there is something I'm missing there.

To Reproduce Steps to reproduce the behavior:

  1. Follow the documentation for the all-in-one solution.
  2. After basic configurations, add a new target with the ability to spawn private instances.
  3. Create a new target instance in infrastructure > target instance.
  4. Observe the error response, then navigate to the pUI as the player the private instance was enabled for, and observe that the UI updates to showing that the target instance is available.
  5. From the host, run docker ps -a and observe that no container was created for the private instance.

I apologize if this isn't enough information, this is basically the out-of-the-box configuration for the all-in-one solution. Please let me know if there is anything else I can provide, thanks!

proditis commented 4 months ago

Hi @sashathomas,

Thank you for reporting this and sorry you had troubles.

  1. The error you're getting sounds like a bug, it will be fixed shortly
  2. Even though the behavior you describe is a bug, you can get private instances working by setting a dedicated server for them. You have to go to Infrastructure -> Servers in the mUI and create a server that will be responsible to host the private instances.
  3. Once this is done, assign a private instance to this server by creating a new instance from the Infrastructure -> Target instances, leaving IP octet field empty and Reboot field at Nop value (see screenshot)

screenshot

Once the Instance is created you can see the restart and destroy operations on the listing and by going to the instance view, you will see some extra operations for this instance listing actions view instance actions

I hope this helps. Let me know how it goes and i'll try to fix the bug you mentioned shortly.

sashathomas commented 4 months ago

@proditis Adding the server was the solution. Thank you! I configured a new server in the mUI and I can spawn/destroy/reboot private instances from the pUI now. Thanks for looking into that other bug as well!

proditis commented 4 months ago

Great i'm glad this was it and it worked out.

Closing this issue. Feel free to open a new one for any other problems you may have.