A CLI tool to deploy CTF challenges to a k8 cluster.
npm install ctfup[![csivit][csivitu-shield]][csivitu-url]

[![Issues][issues-shield]][issues-url]
A CLI tool to deploy CTF challenges to a k8 cluster for csictf.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
- About the Project
- Built With
- Getting Started
- Prerequisites
- Installation
- Usage
- Roadmap
- Contributing
- License
- Contributors
ctfup is an npm package developed to streamline the deployment of CTF challenges to a kubernetes cluster.
- NodeJS
- Typescript
- Google Kubernetes
To get a local copy up and running follow these simple steps.
This package is intended to be used in your CI script, or with the appropriate Google Cloud SDK.
- npm
``sh`
npm install npm@latest -g
- A Google Cloud account with the Kubernetes Engine enabled.
- A Google Cloud Service account.
1. Clone the repo
`sh`
git clone https://github.com/csivitu/ctfup.git
2. Install NPM packages
`sh`
npm install
1. Assuming you have a repository for challenges, kindly structure it as follows:
`bash`
├── pwn
│ ├── pwn-challenge-1
│ │ ├── *
│ │ ├──challenge.yml
│ │ ├──Dockerfile
│ │ └──.dockerignore
│ │
│ ├── pwn-challenge-2
│ │ ├── *
│ │ ├──challenge.yml
│ │ ├──Dockerfile
│ │ └──.dockerignore
│ │
│ └── pwn-challenge-3
│
├── crypto
├── forensics
├── linux
├── reversing
├── miscellaneous
├── osint
├── pwn
├── web
└── ctfup.yml
The directories pwn , crypto etc. each have sub directories with each sub directory having a challenge.yml, a Dockerfile and corresponding .dockerignore.
2. The root directory of your repository must have a config file ctfup.yml as per the format.
`yaml`
categories:
- "crypto"
- "forensics"
- "linux"
- "reversing"
- "miscellaneous"
- "osint"
- "pwn"
- "web"
registry: "gcr.io/
3. The format of challenge.yml is as follows:
`yamlThis file represents the base specification of your challenge. It is used by
other tools to install and deploy your challenge.
4. The directory containing the
challenge.yml file must _also_ contain a Dockerfile which will be used by GKE.
5. Setup your preferred CI for your project. In this case, we will use a Github Action.
`yaml
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12"
- run: npm install -g ctfup
`6. Add the required secrets and in your
yaml config file, set up the gcloud environment with`yaml
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '290.0.1'
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}
`Note: use the latest version of the Github Action.
7. Additional setup
`yaml
Configure Docker to use the gcloud command-line tool as a credential
helper for authentication
- run: |-
gcloud --quiet auth configure-docker
Get the GKE credentials so we can deploy to the cluster
- run: |-
gcloud container clusters get-credentials "${{ secrets.GKE_CLUSTER_NAME }}" --zone "${{ secrets.GKE_CLUSTER_ZONE }}"
`
8. Deploy
`yaml
- name: Deploy
run: ctfup -c ctfup.yml .
`Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
1. Fork the Project
2. Create your Feature Branch (
git checkout -b feature/AmazingFeature)
3. Commit your Changes (git commit -m 'feat: Add some AmazingFeature')
4. Push to the Branch (git push origin feature/AmazingFeature)
5. Open a Pull RequestYou are requested to follow the contribution guidelines specified in CONTRIBUTING.md while contributing to the project :smile:.
License
LICENSE` for more information.[csivitu-shield]: https://img.shields.io/badge/csivitu-csivitu-blue
[csivitu-url]: https://csivit.com
[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=flat-square
[issues-url]: https://github.com/csivitu/ctfup/issues
Thanks goes to these wonderful people (emoji key):
Rishit Bansal 💻 🚇 | Rohan Mukherjee 💻 🚇 | theProgrammerDavid 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!