Skip to main content

Simple k8s yaml generator for CTF challenges

Project description

Different wrapping

Basically a glorified YAML converter aimed at CTFs. The goal is that tasks can be written using docker-compose, such that they can be easily quality tested. The docker-compose files are then converted to k8s manifests using kompose, organized neatly in folders by challenge type and challenge name.

Metadata files are also generated:

  • image_buildlist.json is a list of what containers need to be built
  • challenge_container_metadata.json explains what challenges have what kind of containers, so the frontend can show this to the user. It also contains information on what challenges have dynamic containers.

The intention of this tool is to run it in CI to generate metadata files to inform the rest of the platform. You can also run it locally, even just as a challenge linter. Run different_wrapping --help for more info.

Different wrapping is a component in an approach we are taking where instead of writing an elaborate system for deploying dynamic challenges, we try to re-use as much infrastructure between static and dynamic challenges as possible. We do this by creating "argocd-ready" kustomize projects - with the static project being actually hosted by argo and the dynamic ones being managed by a custom daemon.

Design goals

  • Use standard k8s manifests where practical
  • KISS

Requirements

  • Python
  • The requirements in pyproject.toml (pip install -e . to install the system and all dependencies so you can run it using python -m)
  • Kompose, if you are building yaml
    • Note that running different_wrapping lint <directory> is possible without installing kompose

Configuration

CLI

See different_wrapping --help. Here is a possible out of date output:

$ different_wrapping convert --help
INFO:different_wrapping.cli:Different wrapping starting
usage: different_wrapping convert [-h] [--dry] [--dns_host DNS_HOST] folder destdir

positional arguments:
  folder
  destdir

options:
  -h, --help           show this help message and exit
  --dry                Does not write anything to the destination directory. Note that it will write to a
                       temporary directory, in order to test out running kustomize
  --dns_host DNS_HOST
  --docker_image_repo DOCKER_IMAGE_REPO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

different_wrapping-1.0.31.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

different_wrapping-1.0.31-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file different_wrapping-1.0.31.tar.gz.

File metadata

  • Download URL: different_wrapping-1.0.31.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for different_wrapping-1.0.31.tar.gz
Algorithm Hash digest
SHA256 5da0fe95a429ee7b0b9d485ee64f5e1532c134a2e684b4b5b4a35feca9237295
MD5 ae1eddad393bd403a6ac5f18296c104f
BLAKE2b-256 956db375c11871be07e3dd6e4c29f0961f01a71b3afb99268b96e21ba6c6f985

See more details on using hashes here.

File details

Details for the file different_wrapping-1.0.31-py3-none-any.whl.

File metadata

File hashes

Hashes for different_wrapping-1.0.31-py3-none-any.whl
Algorithm Hash digest
SHA256 a64bc51c074f6ad509c70adac83d6c58e906b36fea7d44b897925a712077487e
MD5 1c126e52b02077b91febee701832cb9a
BLAKE2b-256 7140adaa979fa6ec27756234860e82c92405f3f6289b08fd3bf486c3c3d6c3ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page