Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend generate-challenges.sh to support full automation #58

Closed
12 tasks done
netr0m opened this issue Mar 1, 2024 · 0 comments · Fixed by #59
Closed
12 tasks done

Extend generate-challenges.sh to support full automation #58

netr0m opened this issue Mar 1, 2024 · 0 comments · Fixed by #59
Assignees
Labels
💡 feature request New feature or request

Comments

@netr0m
Copy link
Contributor

netr0m commented Mar 1, 2024

Describe Problem

Currently, the generate-challenges.sh script does one thing - it generates the CTFd challenges CSV by wrapping the various steps involved in running juice-shop-ctf-cli into a single command.

  • This requires that an active instance of juice-shop is created in the multi-juicer cluster (from which the challenges are retrieved), which must be done by creating a team in the multi-juicer balancer. This currently blocks a fully automated setup.

  • When deploying the services (with manage-multijuicer.sh), the CTFd instance is deployed in an unconfigured state. This means that manual configuration has to be done, including creating the admin account. Theoretically, this could be hijacked by some other party (although we could wipe it, having control of the infrastructure/kubernetes cluster).

  • The admin must also manually import the generated challenges (as well as the guides).

Suggest Solution

Extend the generate-challenges.sh script to:

  • Support fully automated CTFd challenges generation:
    • create an instance of juice-shop by creating a team in the multi-juicer balancer
  • Support automated configuration (setup) of the CTFd instance
    • Issue an HTTP request to the /setup endpoint of CTFd, similarly to how interaction is done via the browser by an administrator configuring the instance
    • Issue an HTTP request to the /admin/import/csv endpoint, importing the generated challenges CSV
    • Automate the uploading of the custom pages containing guides, etc.
  • Allow the user (executing the script) to choose which command to run, i.e.
    • gen: generate challenges (producing a CSV)
    • import: import challenges (importing the specified CSV)
    • cfg: configure the CTFd instance
    • pages: import the custom pages, such as the guides/tips pages (./guides-and-tips)
    • run: All of the above

Additional Details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant