Installing the cyrange Cyber Range platform

Feb 18, 2021 by Thibault | 213 views

Cyber Range

https://cylab.be/blog/132/installing-the-cyrange-cyber-range-platform

cyrange is a Cyber Range platform built on top of VirtualBox. Like some other tools, it has a web interface that allows to deploy and manage virtual machines. But cyrange has some additional features dedicated to education and training:

  • possibility to configure the guest system during deployment;
  • possibility to perform bulk deployments, for all trainees of a class for example;
  • built-in integration with Apache Guacamole web interface.

The easiest way to install cyrange is using Docker and docker-composer. Hence in this tutorial we will walk the different steps required to run cyrange:

  • install VirtualBox;
  • install Docker and docker-compose;
  • download and tune the appropriate docker-compose.yml .

All this was tested on Ubuntu 20.04 server.

VirtualBox

Download and install VirtualBox and dependencies:

## install required packages
sudo apt-get install build-essential dkms

 ## downaload and install 
wget https://download.virtualbox.org/virtualbox/6.1.18/virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb
sudo dpkg -i virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb

## install dependencies
sudo apt install -f

Download and install VirtualBox extension pack:

wget https://download.virtualbox.org/virtualbox/6.1.18/Oracle_VM_VirtualBox_Extension_Pack-6.1.18.vbox-extpack
sudo vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.18.vbox-extpack

Create a dedicated user, and don't forget to write down the password:

sudo adduser vbox

## add the user to the group vboxusers so he will be allowed
## to run virtual machines
sudo adduser vbox vboxusers

To enable virtualbox-webservice, create the file /etc/default/virtualbox with following content:

VBOXWEB_USER=vbox
VBOXWEB_TIMEOUT=600
VBOXWEB_HOST=0.0.0.0

Start virtualbox-webservice and check it is correctly running:

sudo service vboxweb-service start
sudo ss -ltpn | grep vbox

If vboxwebsrv does not appear, you can simply try to restart the service:

sudo service vboxweb-service restart

Docker

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates \
    curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo adduser `whoami` docker

After login out and back in, you can test docker is correctly installed:

docker run hello-world

Download and install docker-compose:

wget https://github.com/docker/compose/releases/download/1.28.3/docker-compose-Linux-x86_64
mv docker-compose-Linux-x86_64 docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/bin/

cyrange

Finally, we can download the docker-compose.yml file that will run the different containers of cyrange:

mkdir cyrange
cd cyrange
wget https://artifacts.cylab.be/cyrange-web/latest/docker-compose.yml

Now open and modify the docker-compose.yml. You must add an environment variable called VBOX_PASSWORD with the password of the vbox user that you created earlier. You must add this variable for the 3 containers: cyrange, queue and scheduler.

Now you can start the containers:

docker-compose up

First steps

After a few seconds, the web interface will be available on port 8080. The default credentials are:

  • E-mail: cyrange@example.com
  • Password: admin

As first, you should head to the Settings page and select the default network interface on which the virtual machines will be deployed.

To test your installation, you can now import your first image. For example, you can use our Damn Small Linux image: https://cloud.cylab.be/s/EYHMd9N3Y3dJZNZ/download

Once the image is downloaded, you can create a template based on this image

Once the template is ready, you can deploy a virtual machine.

Once again, after a few seconds, the machine will be up and running.