Skip to content

DSP Lab Directory Structure

Gaetano Perrone edited this page Dec 14, 2019 · 1 revision

When the user installs DSP he select the mainDir directory that is the “root” directory for all DSP repositories. Main DSP_Projects is downloaded during installation.

Each repository is a git repository that contains network security labs and it’s structured as follows:

Packages are directories, while class are files.

Root directory contains lab_states.json that keep track about lab states, the file structure is the following:

Each lab is indexed by repository name and lab name (this is because two same names in different repositories are allowed). Each repository contains:

  • labels.json that contains all the repository labels; each repository has it labels.json that is created during the installation inside the user repository ( other repositories has labels.json created by their owners ); “repository labels.json” is used during the lab description creation to select labels to associate with the lab.

It’s a JSON array that contains all the labels. Each label has a name, a description and a color.

  • Labs, that are created by user. DSP_Projects is the official GitHub repository for DSP application; it is downloaded when the user installs the application for the first time.

Structure of a lab

Each lab contains:

  • labels.json file that contains all the labels selected by user during the lab creation. Its structure is equal to repository labels.json;

  • informations.json: that contains the lab description (created during the lab creation);

  • network.json: that contains the graphic network description for the lab (created by using the docker_graph_editor.html page)

  • docker-compose.yml file: that is created when the user save the graphic network description.

A thorough analysis of the composition of a lab is showed in the following class diagram: In this class diagram it’s possible to observe the complete data structure of DSP. The more complex file that this diagram shows is the network.json file: this file describes the network rappresentation of a lab, with all graphic and docker-relevant informations.

newtork.json is generated when the user

network.json is composed by three json array:

  • listDrawed, that is the list of drawed containers, i.e. containers that have been converted in docker-compose services (by the docker-converter module) and are present in the docker-compose file;

  • listNotDrawed: the list of not drawed containers, i.e. containers that have been created in graphic network description but that are not drawed on canvas, so they are not present in docker-compose file;

  • networkList: the list of subnets that the user has created, each subnet has a name, a list of available IP addresses, a color and a subnet IP that identifies the subnet.

Each container in the list of containers has various docker-has attributes, such as environments, volumes. User creates containers in the docker_graph_editor.html page; by using Angular GUI interface he creates containers, configure the subnets and set these docker-compose options. Container has also actions that user has chosen. These actions are chosen among the docker image actions, by following the DockerWrapperImage convention, then each action has a bash command, a description, a name and a set of arguments. Each argument of an action has a rule that defines the controls to do client-side ( for example a rule could be a pattern rule, that defines a pattern that client side have to check), a type that defines which type of input the angular interface have to show in add_element.html view of the docker_graph_editor.html page.