CLI for deploying CTF Attack-Defense competition in the Yandex Cloud with ForcAD
To work with the cloud, you will need cli tool yc
- link
What you need to create in Yandex Cloud:
- Service account and profile for terraform - link
- Any subnet - link
- Private DNS zone - link
- Private VPN for access to private subnet for Ansible - link
Install Terraform and the provider for Yandex Cloud - link
Install Ansible
pip install --upgrade pip
pip install ansible passlib
The CLI tool ad.py
should be used to manage the entire infrastructure of the competition
Before you start working with
ad.py
, you need to connect via vpn to private subnet in the Yandex Cloud.
Starting AD:
- Configure the
config.yml
for the entire infrastructure - Run
pip install -r requirements.txt
- Run
./ad.py create
for create all infrastructure - Run
./ad.py generate-ansible
for generate Ansible inventory file - Run
./ad.py ping
until you get a successful ping (everything must be green) - Run
./ad.py provision
for provision all infrastructure - Run
./ad.py start-services
for start services on the vulnboxes - Run
./ad.py generate-result
for generate readme.txt for teams inresult
folder
For destroying all infrastructure:
- Run
./ad.py destroy
for delete all resources in Yandex Cloud
ForcAD configuration part see here
There is a config.yml
file to configure the infrastructure
cloud
contains cloud settingsubnet_id
- subnet id from Yandex Clouddns_zone_id
- dns zone id from Yandex Cloudcpu
- count of cpu coresmem
- memory sizedisk
- disk size
teams
here you need to specify only the names of the teams, the rest will be generated