Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/logalexus/ad
CLI for deploying CTF Attack-Defense competition in the Yandex Cloud with ForcAD
https://github.com/logalexus/ad
ansible attack-defense competition ctf ctf-tools infrastructure openvpn terraform vpn yandex-cloud
Last synced: 6 days ago
JSON representation
CLI for deploying CTF Attack-Defense competition in the Yandex Cloud with ForcAD
- Host: GitHub
- URL: https://github.com/logalexus/ad
- Owner: logalexus
- Created: 2024-01-21T19:23:09.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-06T19:07:06.000Z (2 months ago)
- Last Synced: 2024-09-07T16:22:27.303Z (2 months ago)
- Topics: ansible, attack-defense, competition, ctf, ctf-tools, infrastructure, openvpn, terraform, vpn, yandex-cloud
- Language: Python
- Homepage:
- Size: 9.16 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AD
CLI for deploying CTF Attack-Defense competition in the Yandex Cloud with [ForcAD](https://github.com/pomo-mondreganto/ForcAD)
## Requirements
To work with the cloud, you will need cli tool `yc` - [link](https://yandex.cloud/ru/docs/cli/quickstart)
What you need to create in Yandex Cloud:
- Service account and profile for terraform - [link](https://yandex.cloud/ru/docs/tutorials/infrastructure-management/terraform-quickstart#get-credentials)
- Any subnet - [link](https://yandex.cloud/ru/docs/vpc/operations/subnet-create)
- Private DNS zone - [link](https://yandex.cloud/ru/docs/dns/operations/zone-create-private)
- Private VPN for access to private subnet for Ansible - [link](https://yandex.cloud/ru/docs/vpc/tutorials/openvpn)Install Terraform and the provider for Yandex Cloud - [link](https://yandex.cloud/ru/docs/tutorials/infrastructure-management/terraform-quickstart#configure-provider)
Install Ansible
````
pip install --upgrade pip
pip install ansible passlib
````## Usage
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:
1. Configure the `config.yml` for the entire infrastructure
2. Run `pip install -r requirements.txt`
3. Run `./ad.py create` for create all infrastructure
4. Run `./ad.py generate-ansible` for generate Ansible inventory file
5. Run `./ad.py ping` until you get a successful ping (everything must be green)
6. Run `./ad.py provision` for provision all infrastructure
7. Run `./ad.py start-services` for start services on the vulnboxes
8. Run `./ad.py generate-result` for generate readme.txt for teams in `result` folderFor destroying all infrastructure:
1. Run `./ad.py destroy` for delete all resources in Yandex Cloud
## Configuration
ForcAD configuration part see [here](https://github.com/pomo-mondreganto/ForcAD)
There is a `config.yml` file to configure the infrastructure
* `cloud` contains cloud setting
* `subnet_id` - subnet id from Yandex Cloud
* `dns_zone_id` - dns zone id from Yandex Cloud
* `cpu` - count of cpu cores
* `mem` - memory size
* `disk` - disk size
* `teams` here you need to specify only the names of the teams, the rest will be generated