brasky / FITS-CTFs

Ansible playbooks for FITS CTFs
1 stars 0 forks source link

FITS CTF

Current Port Ranges:

Category Port Range
Linux 6000-6999
Web 8000-8999
Binary Exploitation 9000-9999

Creating a new challenge

Dockerfiles

If your challenge is using docker, you will need a Dockerfile. It should contain most of what you need in the container for the challenge. Use challenge1's dockerfile as an example.

The dockerfile will handle setup such as:

As things come up I will make this overview more thorough.

Creating tasks in tasks/main.yml

The main ansible tasks.yml file has 2 roles:

When used with docker:

When used with a standalone VM:

TODO as this has not happened yet, but presumably ansible is now responsible for 100% of setup and you will not have a dockerfile at all.

Ansible Variables

Because prod and dev are pulling from 2 different branches for deployment, variables are used when referring to a file location on orchestrator. For example, in challenge1's tasks/main.yml there's this command to copy a dockerfile:

- name: Copy dockerfile
copy:
    src: "{{ repo_path }}/roles/challenge1/docker/Dockerfile"
    dest: /tmp/docker-challenge1/Dockerfile
    mode: '0744'
    force: yes

The src field has the variable {{repo_path}} because depending on the machine it's being deployed to (prod vs dev) the path might be /home/rundeck/FITS-CTF/ (for prod) or it might be /home/rundeck/FITS-CTF-DEV/ (for dev).

These variables are defined in group_vars and vars folders in the root of the project.

Troubleshooting Notes