CTFd / ctfcli

ctfcli is a tool to manage Capture The Flag events and challenges
https://ctfd.io/
Apache License 2.0
165 stars 67 forks source link

Handle challenge deletion and/or name changes #115

Open pl4nty opened 1 year ago

pl4nty commented 1 year ago

I currently use ctfcli like an infrastructure-as-code provider in CI/CD pipelines. However, the following resource changes (challenges/containers/services) must be reconciled manually:

Other providers like Azure offer a "complete" mode, where resources that aren't defined in the repo are deleted. This would support the change types listed above.

Not sure whether this aligns to ctfcli's design though - maybe a Terraform provider would be a better fit, since it's common for CTF infrastructure anyway.

pl4nty commented 1 year ago

Looks like there's a Terraform version here, not sure how stable it is though: https://github.com/PsypherPunk/terraform-provider-ctfd

reteps commented 2 days ago

Would be fixed by #159

pl4nty commented 2 days ago

in my case, my CI is stateless, so #159 wouldn't work for me

reteps commented 2 days ago

I don't think you could reconcile renames with a stateless system unless you diff commit history (which in itself, is state).

This issue makes ctfcli unusable for us, as we have infrastructure changes after people solve challenges. Thus, deleting a renamed challenge and recreating it deletes solves, which we cannot do.

reteps commented 2 days ago

I am sortof suggesting a new paradigm:

reteps commented 2 days ago

Would you be able to provide more details about your usecase?

pl4nty commented 2 days ago

I suggested delete/recreate because I don't run ctfcli during competitions, to avoid any unexpected changes. but I understand that this approach might not align to ctfcli's design

I generate .ctf/config at runtime to avoid storing credentials in git, and allow challenge creation without authors needing ctfcli