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

Handle challenge deletion and/or name changes #115

Open
pl4nty opened this issue Mar 13, 2023 · 7 comments
Open

Handle challenge deletion and/or name changes #115

pl4nty opened this issue Mar 13, 2023 · 7 comments

Comments

@pl4nty
Copy link
Contributor

pl4nty commented Mar 13, 2023

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:

  • Name changes, as it's the sync anchor
  • Resource deleted from repo

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
Copy link
Contributor Author

pl4nty commented Mar 13, 2023

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

@reteps
Copy link
Contributor

reteps commented Sep 11, 2024

Would be fixed by #159

@pl4nty
Copy link
Contributor Author

pl4nty commented Sep 11, 2024

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

@reteps
Copy link
Contributor

reteps commented Sep 11, 2024

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
Copy link
Contributor

reteps commented Sep 11, 2024

I am sortof suggesting a new paradigm:

  • You use your CI pipeline to commit the .ctf/config file to git
  • The CI is no longer stateless

@reteps
Copy link
Contributor

reteps commented Sep 11, 2024

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

@pl4nty
Copy link
Contributor Author

pl4nty commented Sep 11, 2024

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

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

No branches or pull requests

2 participants