Skip to content

Commit

Permalink
update installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Limmen committed Feb 9, 2024
1 parent e455312 commit 42c78fa
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
16 changes: 13 additions & 3 deletions docs/_docs/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Below are a list of dependencies that will be installed with CSLE (unless they a
- Python 3.9+;
- Python libraries: `torch`, `numpy`, `gym`, `docker`, `paramiko`, `stable-baselines3`, `psycopg`, `pyglet`, `flask`, `click`, `waitress`, `scp`, `psutil`, `grpcio`, `grpcio-tools`, `scipy`, `confluent-kafka`, `requests`, `pyopenssl`, `sphinx`, `mypy`, `mypy-extensions`, `mypy-protobuf`, `types-PyYAML`, `types-protobuf`, `types-paramiko`, `types-requests`, `types-urllib3`, `flake8`, `pytest`, `gevent`, `eventlet`, `dnspython`, `csle-ryu-fork`, `gpytorch`, `pulp`, `Bayesian optimization`, `emukit`, `cma`, `pycryptodome`.
- PostgreSQL 12+;
- `make`, `git`, `bzip2`;
- `make`, `git`, `bzip2`, `build-essential`;
- Prometheus 2.23+;
- Node exporter 1.0.1+;
- cAdvisor (any version);
Expand All @@ -52,6 +52,7 @@ configuration parameters are set, and tools required in later steps of the insta
Start with installing the necessary build tools and version management tools by running the following commands:

```bash
apt install build-essential
apt install make
apt install git
apt install bzip2
Expand Down Expand Up @@ -130,6 +131,9 @@ Listing 10: Commands to setup the directory where CSLE log files will be stored
</p>

Next, add the following line to the `sudoers` file using `visudo` (change `my_user` to your username):

| WARNING: take care when editing the sudoers file. If the sudoers file becomes corrupted it can make the system unusable. |
| --- |
```bash
my_user ALL = NOPASSWD: /usr/sbin/service docker stop, /usr/sbin/service docker start, /usr/sbin/service docker restart, /usr/sbin/service nginx stop, /usr/sbin/service nginx start, /usr/sbin/service nginx restart, /usr/sbin/service postgresql start, /usr/sbin/service postgresql stop, /usr/sbin/service postgresql restart, /bin/kill, /usr/bin/journalctl -u docker.service -n 100 --no-pager -e
```
Expand All @@ -140,7 +144,8 @@ Listing 11: Line to add to the sudoers file.

By adding the above line to the `sudoers` file, CSLE will be able to view logs and start and stop management services without requiring a password to be entered. (Note that the exact paths used above may differ on your system, very the paths by running the command `whereis service`, `whereis journalctl`, etc.)

Next, setup SSH keys so that all servers (leader and workers) have SSH access to each other without requiring a password. To do this, generate an SSH key pair with the command `ssh-keygen` on each server and copy the public key (e.g., `id_rsa.pub`) to the file `.ssh/authorized_keys`.
Next, setup SSH keys so that all servers (leader and workers) have SSH access to each other without requiring a password.
To do this, generate an SSH key pair with the command `ssh-keygen` on each server and copy the public key (e.g., `id_rsa.pub`) to the file `.ssh/authorized_keys`.

Lastly, define default username and password to the management system by editing the file: `csle/config.json`.

Expand Down Expand Up @@ -625,7 +630,8 @@ e.g., specific vulnerabilities. To install the emulation system,
the configuration files must be inserted into the metastore and
the Docker images must be built or downloaded.

Start with adding Docker's official GPG key to Ubuntu's package manager by running the commands:
Start with adding Docker's official GPG key to Ubuntu's package manager by running the commands (you can also follow
the instructions for installing Docker at `https://docs.docker.com/engine/install/ubuntu/`):

```bash
sudo mkdir -p /etc/apt/keyrings
Expand Down Expand Up @@ -662,6 +668,10 @@ docker swarm join --token <my_roken> leader_ip:2377
<p class="captionFig">
Listing 59: Commands to add a worker node to the Docker swarm.
</p>

| Note: If you forget the swarm token, you can display it by running the following command on the leader: `docker swarm join-token worker`. |
|-----------------------------------------------------------------------------------------------------------------------|

You can verify the Docker swarm configuration by running `docker node ls`.

After completing the Docker installation, pull the base images of CSLE from DockerHub by running the commands:
Expand Down
1 change: 1 addition & 0 deletions docs/_docs/installing_devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ csle/simulation-system/libs/csle-tolerance; pip install -r requirements_dev.txt
<p class="captionFig">
Listing 123: Command to install the Python build tool.
</p>
It is also possible to install all development tools at once by running the script `simulation-system/libs/local_install_dev.sh`

Alternatively, install each development library separately by following the commands below.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
if __name__ == '__main__':
# ImportUtil.import_emulation_traces_from_disk_json(input_file="/media/lagring/traces_31_oct/1.json",
# emulation_name="csle-level9-030")
for i in range(52, 64):
for i in range(0, 64):
ImportUtil.import_emulation_traces_from_disk_json(
input_file=f"/media/lagring/traces_31_oct/{i}.json", emulation_name="csle-level9-040")
18 changes: 18 additions & 0 deletions simulation-system/libs/local_install_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

cd csle-base; pip install -r requirements_dev.txt; cd ..
cd csle-collector; pip install -r requirements_dev.txt; cd ..
cd csle-ryu; pip install -r requirements_dev.txt; cd ..
cd csle-common; pip install -r requirements_dev.txt; cd ..
cd csle-cluster; pip install -r requirements_dev.txt; cd ..
cd csle-attacker; pip install -r requirements_dev.txt; cd ..
cd csle-defender; pip install -r requirements_dev.txt; cd ..
cd gym-csle-intrusion-response-game; pip install -r requirements_dev.txt; cd ..
cd csle-system-identification; pip install -r requirements_dev.txt; cd ..
cd gym-csle-stopping-game; pip install -r requirements_dev.txt; cd ..
cd gym-csle-apt-game; pip install -r requirements_dev.txt; cd ..
cd gym-csle-cyborg; pip install -r requirements_dev.txt; cd ..
cd csle-tolerance; pip install -r requirements_dev.txt; cd ..
cd csle-agents; pip install -r requirements_dev.txt; cd ..
cd csle-rest-api; pip install -r requirements_dev.txt; cd ..
cd csle-cli; pip install -r requirements_dev.txt; cd ..

0 comments on commit 42c78fa

Please sign in to comment.