OpenAttackDefenseTools / tulip

Network analysis tool for Attack Defence CTF
GNU General Public License v3.0
264 stars 36 forks source link

Define services in config and add Docker workflow #41

Open iamsilk opened 5 months ago

iamsilk commented 5 months ago

This PR makes two additions:

  1. Services are defined via the config instead of code. This works by adding two environment variables: VM_IP and TULIP_SERVICES_PATH. The TULIP_SERVICES_PATH variable specifies the path to a JSON file with the services.
  2. Adds a GitHub workflow to build and publish each Docker image, removing the need to build the images on the deployment machine.

This PR publishes the Docker images to the GitHub Container Registry, not Docker Hub. My use case used GHCR, but feel free to adjust the workflow to your needs.

If merging, make sure to change the image links in the docker-compose.prod.yml file from ghcr.io/iamsilk to ghcr.io/OpenAttackDefenseTools.

meme-lord commented 3 months ago

This is great, you can make it cleaner by just putting the json data into the .env file:

# The services and ports
SERVICES_JSON='[
    {
        "port": 9876,
        "name": "cc_market"
    },
    {
        "port": 80,
        "name": "maze"
    },
    {
        "port": 8080,
        "name": "scadent"
    },
    {
        "port": 5000,
        "name": "starchaser"
    },
    {
        "port": 1883,
        "name": "scadnet_bin"
    },
    {
        "port": -1,
        "name": "other"
    }
]'