npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ctfup

v1.0.19

Published

A CLI tool to deploy CTF challenges to a k8 cluster.

Downloads

37

Readme

csivit

All Contributors

Issues

Table of Contents

About The Project

ctfup is an npm package developed to streamline the deployment of CTF challenges to a kubernetes cluster.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

This package is intended to be used in your CI script, or with the appropriate Google Cloud SDK.

  • npm
npm install npm@latest -g
  • A Google Cloud account with the Kubernetes Engine enabled.
  • A Google Cloud Service account.

Installation

  1. Clone the repo
git clone https://github.com/csivitu/ctfup.git
  1. Install NPM packages
npm install

Usage

  1. Assuming you have a repository for challenges, kindly structure it as follows:
├── 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.

  1. The root directory of your repository must have a config file ctfup.yml as per the format.
categories:
  - "crypto"
  - "forensics"
  - "linux"
  - "reversing"
  - "miscellaneous"
  - "osint"
  - "pwn"
  - "web"
registry: "gcr.io/<project name>-<project id>"
  1. The format of challenge.yml is as follows:
# This file represents the base specification of your challenge. It is used by
# other tools to install and deploy your challenge.

# Required sections
name: "challenge name"
author: "author"

# Select a category from:
# - Pwn
# - Web
# - OSINT
# - Linux
# - Crypto
# - Forensics
# - Reversing
# - Miscellaneous
category: category

# This is the challenge description. Make sure you include the
# necessary URLs / netcat strings here.
description: This is a sample description

# This is the number of points awarded for the challenge.
value: 500
type: dynamic

# Number of solves it takes to reach the minimum value.
decay: 450

# Minimum value.
minimum: 100

# Flags specify answers that your challenge use. You should generally provide
# at least one.
# Can be removed if unused
# Accepts strings or dictionaries
flags:
  - csictf{this_is_a_sample_flag}
  - { type: "static", content: "csictf{another_flag}", data: "asdfasdfsdf" }

# Tags are used to classify your challenge with topics. You should provide at
# least one.
# Can be removed if unused
# Accepts strings
tags:
  - web
  - sandbox
  - js

# Provide paths to files from the same directory that this file is in
# Accepts strings
files:
  - dist/source.py

# Hints are used to give players a way to buy or have suggestions. They are not
# required but can be nice.
# Can be removed if unused
# Accepts dictionaries or strings
hints:
  - { content: "This hint costs points", cost: 10 }
  - This hint is free

# The state of the challenge.
# May be "visible" or "hidden".
# It is "visible" by default.
state: hidden

# Specifies what version of the challenge specification was used.
# Subject to change until ctfcli v1.0.0
version: "0.1"

# The ports to expose. The target port will be used to access the deployed container.
expose:
- containerPort: 9999
  targetPort: 30231
  1. The directory containing the challenge.yml file must also contain a Dockerfile which will be used by GKE.

  2. Setup your preferred CI for your project. In this case, we will use a Github Action.

- uses: actions/checkout@v2
- uses: actions/setup-node@v1
  with:
    node-version: "12"
- run: npm install -g ctfup
  1. Add the required secrets and in your yaml config file, set up the gcloud environment with
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.

  1. Additional setup
# 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 }}"
- 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 Request

You are requested to follow the contribution guidelines specified in CONTRIBUTING.md while contributing to the project :smile:.

License

Distributed under the MIT License. See LICENSE for more information.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!