NCAE Cyber Games Infrastructure Challenges are structured as Ansible roles that can be deployed to a variety of Operating Systems (OS’s). Challenges should be tested against CentOS+ and Ubuntu


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2


,



,


>

,


,



,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

>


,


.


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

>

,


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

>


,


+ at a minimum.

To reduce setup time, Vagrant can be utilized to create test and development Virtual Machines (VM’s).

,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


>

>Getting help,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

>

>

We’re here to help! The NCAE Cyber Games maintainers and community are happy to help answer questions and debug issues, if the instructions or FAQ can not help.

We can be reached by the following means:

  • Email: opfor-content@ncaecybergames.org
  • Discord: https://discord.gg/H
    
    

    ,

    
    

    jwMxt

,


data-fontsize=”


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


” data-lineheight=”


,



,


px” class=”fusion-responsive-typography-calculated” style=”–fontSize:


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


; line-height:


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

.


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

;”>Setup Environment using Vagrant,


>

Vagrant is the recommended way to set up a local development environment, if the environment will be run on your local machine with Virtualbox or HyperV. The Dev Environment is


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

total Virtual Machines, or VMs;


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


>

,


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

>

development VM, and


,


test VMs. Using the development VM is optional. The default login to these systems is:

Username: vagrant

Password: vagrant

NOTE: By default, the VMs are configured with “Bridged” networking within VirtualBox. This means that vulnerable VMs are put on the same network as the host system, ex – your home Wifi or employer network. Use appropriate caution
when creating vulnerable systems.

,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

data-fontsize=”


,



,


” data-lineheight=”


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


px” class=”fusion-responsive-typography-calculated” style=”–fontSize:


,



,


; line-height:


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

.


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

; –minFontSize:


,



,


;”>Host System Requirements,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

>

  • 
    

    ,

    
    

    + GB RAM

  • OS with Virtualbox or Hyper-V support

,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

data-fontsize=”


,



,


” data-lineheight=”


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


px” class=”fusion-responsive-typography-calculated” style=”–fontSize:


,



,


; line-height:


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

.


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

; –minFontSize:


,



,


;”>Install host dependencies,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

>

  1. Download and Install Vagrant from https://www.vagrantup.com/downloads

    • Check here for more installation instructions and documentation:
      https://www.vagrantup.com/docs/installation
    • Note: On Debian or Ubuntu, select the “Debian” download instead of the Linux download. The “Linux”
      has some known issues with vagrant ssh, and must be installed manually.
  2. Install Virtualization Provider

    • Vagrant supports several virtualization providers, including virtualbox and Hyper-V.
      Install a supported virtualization provider according to their instructions.

      • NOTE: On Linux, virtualbox may require the package bsdtar to be installed.
        On Ubuntu, it can be installed with: sudo apt install libarchive-tools
      • NOTE: You must restart your host to finish the installation or enabling of a
        virtualization provider.

,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

data-fontsize=”


,



,


” data-lineheight=”


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


px” class=”fusion-responsive-typography-calculated” style=”–fontSize:


,



,


; line-height:


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

.


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

; –minFontSize:


,



,


;”>Create Virtual Machines,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

>

  1. Provision and Start VMs with the provision_all.sh script (or the Provision-All.ps

    
    

    ,

    ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2
    
    
    

    ,

    
    

    >

    ,

    
    

    ,

    ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2
    
    
    

    ,

    ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2
    

    >

    on Windows)

    • Virtualbox is the default provider. To use HyperV as the provider on Windows, use the commands:
      powershell -ExecutionPolicy bypass -File Provision-All.ps

      
      

      ,

      ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2
      
      
      

      ,

      
      

      >

      ,

      
      

      ,

      ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2
      
      
      

      ,

      ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2
      

      >


      Provision-All.ps

      
      

      ,

      
      
      
      

      ,

      vagrant snapshot restore centos_test clean
      vagrant snapshot restore ubuntu_test clean
      

      >

      ,

      
      

      ,

      
      
      
      

      ,

      vagrant snapshot restore centos_test clean
      vagrant snapshot restore ubuntu_test clean
      

      >

      -Provider hyperv

    • The Provision script will ask vagrant to fetch the base OS images, configure them, and provide network access.
      • NOTE if prompted for which interface the VM network should bridge to, use the one on your host machine which
        connects you to the internet. It normally is the option

        
        

        ,

        
        
        
        

        ,

        
        

        >

        ,

        
        

        ,

        
        
        
        

        ,

        ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2
        

        >

      • NOTE when using Virtualbox, VMs will be given a bridged adapter and an IP directly on the host network.
        When using HyperV, VMs will be given a private IP with internet access via NAT
    • The Provision script will take a running snapshot of each VM with the snapshot name
      “clean”, providing a clean state to test challenges against.
  2. Login to the development VM to run Ansible with the command vagrant ssh dev.

    • To log into a test VM, use vagrant ssh centos_test or vagrant ssh ubuntu_test
    • With VirtualBox, each VM is on the same network as the host (ex, if your PC is on your home WiFi, so is the VM). The
      VM will get an IP on the same network as the host, which can be used to connect to the VM.
    • The IP Address of each system is available on the TTY Login Screen.

,


data-fontsize=”


,



,


” data-lineheight=”


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


px” class=”fusion-responsive-typography-calculated” style=”–fontSize:


,



,


; line-height:


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

.


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

; –minFontSize:


,



,


;”>Start Virtual Machines,


>

  1. Change directories into setup_dev_environment
  2. Start all test and dev VMs vagrant up or start individual VMs by specifying their names: dev/ubuntu_test/centos_test
    vagrant up ubuntu_test
  3. Restore Test VMs to their clean snapshot
    vagrant snapshot restore clean ubuntu_test centos_test

,


data-fontsize=”


,



,


” data-lineheight=”


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


px” class=”fusion-responsive-typography-calculated” style=”–fontSize:


,



,


; line-height:


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

.


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

; –minFontSize:


,



,


;”>Stop Virtual Machines,


>

  1. Change directories into setup_dev_environment
  2. Stop all test and dev VMs vagrant halt or stop individual VMs by specifying their names: dev/ubuntu_test/centos_test
    vagrant halt ubuntu_test

,


data-fontsize=”


,



,


” data-lineheight=”


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


px” class=”fusion-responsive-typography-calculated” style=”–fontSize:


,



,


; line-height:


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

.


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

; –minFontSize:


,



,


;”>Gather the IPs of the Test VMs,


>

To deploy an ansible role, you will have to know the IP address’ of the test VMs
you are deploying to.

vagrant ssh -c "ip addr" ubuntu_test will run the ip addr command within the ubuntu_test VM over SSH.

,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

data-fontsize=”


,



,


” data-lineheight=”


,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

,


px” class=”fusion-responsive-typography-calculated” style=”–fontSize:


,



,


; line-height:


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

.


,

vagrant snapshot restore centos_test clean
vagrant snapshot restore ubuntu_test clean

; –minFontSize:


,



,


;”>Develop,

ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2

>

  1. Start developing on your host system with your favorite editor.

    • The infrastructure-examples/ directory on the host is synced to the folder
      /home/vagrant/c

      
      

      ,

      
      

      games within the development VM. All changes made on the host and
      synced to the Development VM, leaving the Development environment disposable.
      Development should be performed on the host system, and will automatically be synced into the VM.

    • See [Development Environment](TODO LINK) for more information about editors, extensions, and more.
  2. Test an Ansible Role by executing the Ansible Playbook with the following command from within the
    Development System, where IP_ADDR_

    
    

    ,

    
    
    
    

    ,

    
    

    >

    ,

    
    

    ,

    
    
    
    

    ,

    vagrant snapshot restore centos_test clean
    vagrant snapshot restore ubuntu_test clean
    

    >

    and IP_ADDR_

    
    

    ,

    
    

    are replaced with the IP addresses of the test
    systems.

    
    

    ,

    
    
    
    

    ,

    
    

    >

    ,

    
    

    ,

    
    
    
    

    ,

    ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2
    

    >

    >

  3. Revert your VMs to the clean snapshot state to re-test roles from a clean state.

    • VMs can be restored using the Virtualization Provider or using Vagrant.
      To use vagrant, run the following commands on the host system:
    
    

    ,

    
    
    
    

    ,

    
    

    >

    ,

    
    

    ,

    
    
    
    

    ,

    ansible-playbook playbook.yml -i IP_ADDR_1,IP_ADDR_2
    

    >

    >

To delete all VMs using vagrant, use the command vagrant destroy. The VMs can also be managed using the Virtualization Provider (ex, the VirtualBox or HyperV interface).