📄 Websecmap-tool – Deployment

Websecmap-tool – Deployment


 

Inhoudstafel

1.      Verbinding met de VM

1.1        SSH-verbinding

1.2        Overschakelen naar de root‑gebruiker

2.      OS specific dependencies installeren op Linux

3.      Repository clonen

3.1        Git installeren

3.2        Repository clonen via Git

4.      Projectomgeving bouwen en opstarten

4.1        Direnv installeren

4.2        Nix configuratiebestand aanpassen

4.3        Nix‑ontwikkelomgeving activeren

4.4        Project bouwen en opstarten

5.      Adminportaal

6.      Bronnen

 


 

1.  Verbinding met de VM

 

1.1          SSH-verbinding

 

Om te starten gebruik ik PowerShell op mijn pc om via een SSH‑verbinding de virtuele machine te bereiken. Ik bevestig de fingerprint met yes en geef daarna het wachtwoord van de VM in om toegang te krijgen.

 

Commando:

PS C:\Users\ChaimaSenhaji> ssh cooperworks@192.168.60.128

Output:

The authenticity of host '192.168.60.128 (192.168.60.128)' can't be established.

ED25519 key fingerprint is SHA256:xp7YZYG7Z46s+PPqrP66xfZYX7Z8qg3Inw2+P93fCyA.

This key is not known by any other names.

Are you sure you want to continue connecting (yes/no/[fingerprint])? y

Please type 'yes', 'no' or the fingerprint: yes

Warning: Permanently added '192.168.60.128' (ED25519) to the list of known hosts.

cooperworks@192.168.60.128's password:

Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.14.0-37-generic x86_64)

...

 


 

1.2          Overschakelen naar de root‑gebruiker

 

Om volledige rechten te hebben op de VM schakel ik over naar de root‑gebruiker. Dit doe ik met het commando sudo su, waarna ik opnieuw het wachtwoord van de VM invoer.

 

Commando:

cooperworks@VM-cw-websecmap-tool:~$ sudo su

Output:

[sudo] wachtwoord voor cooperworks:

 


 

2.  OS specific dependencies installeren op Linux

 

Om de Linux‑specifieke dependencies te kunnen installeren, moet ik eerst Nix installeren. Nadat deze installatie voltooid is, voer ik het Nix‑installatiescript uit om de dependencies te installeren.

 

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks# apt install nix-bin

Output:

Pakketlijsten worden ingelezen... Klaar

...

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks# sh <(curl -L https://nixos.org/nix/install) --daemon

nix-env -iA cachix -f https://cachix.org/api/v1/install

cachix use devenv

nix-env -if https://github.com/cachix/devenv/tarball/v0.4

Output:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

...

 


 

3.  Repository clonen

 

3.1          Git installeren

 

Om de broncode van Web Security Map binnen te halen, installeer ik eerst Git.

 

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks# apt install git

Output:

Pakketlijsten worden ingelezen... Klaar

...

 

3.2          Repository clonen via Git

 

Nu clone ik het project source via git.

 

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks# git clone --recursive https://gitlab.com/internet-cleanup-foundation/web-security-map/ && cd web-security-map/

Output:

Cloning into 'web-security-map'...

warning: redirecting to https://gitlab.com/internet-cleanup-foundation/web-security-map.git/

remote: Enumerating objects: 45919, done.

...

 


 

4.  Projectomgeving bouwen en opstarten

 

4.1          Direnv installeren

 

Om ervoor te zorgen dat de projectomgeving automatisch wordt geladen zodra ik de projectmap binnenkom, installeer en activeer ik Direnv. Hierdoor wordt het .envrc‑bestand van het project automatisch ingelezen wanneer ik de map open.

 

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks/web-security-map# apt  install direnv

Output:

Pakketlijsten worden ingelezen... Klaar

...

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks/web-security-map# direnv allow

Output:

Geen output

 


 

4.2          Nix configuratiebestand aanpassen

 

Om flakes en andere experimentele functies in Nix te kunnen gebruiken, pas ik het configuratiebestand nix.conf aan.

 

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks/web-security-map# nano /etc/nix/nix.conf

Toe te voegen configuratie:

experimental-features = nix-command flakes

Output:

Geen output

 

4.3          Nix‑ontwikkelomgeving activeren

 

Om de juiste projectomgeving te laden, activeer ik de Nix‑ontwikkelomgeving.

 

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks/web-security-map# test -z "$DIRENV" && nix --extra-experimental-features nix-command develop

Output:

Virtualenv: /home/cooperworks/web-security-map/.venv

 


 

4.4          Project bouwen en opstarten

 

Met make bouw ik het project en worden alle benodigde componenten klaargezet. Zodra dit voltooid is, kan ik de applicatie starten met make run, wat de webserver, workers en proxy opstart.

 

Gebruik ADDRPORT=0.0.0.0:8000 make run om de applicatie te starten en extern bereikbaar te maken. Hiermee laat je de applicatie luisteren op alle netwerkinterfaces in plaats van enkel op localhost, waardoor externe toegang mogelijk wordt via het IP‑adres van de server.

 

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks/web-security-map# make

Output:

ℹ️ Running everything in parallel, output may be delayed

...

Run `make run` to start the web application, broker and workers 🚀🚀

...

Commando:

root@VM-cw-websecmap-tool:/home/cooperworks/web-security-map# make run

Output:

AUTORELOAD_BROWSER=1 overmind start --auto-restart=web,worker-dramatiq,worker-celery,browser,proxy system | Tmux socket name: overmind-web-security-map-WPP6xH1I8A2V3Rd0lDwny

...

web | Server is ready: 🚀

web |

web | You can visit it at: http://127.0.0.1:8000 🚀🚀

web |

web | Or directly to admin:

http://admin:faalkaart@127.0.0.1:8000/admin 🚀🚀🚀

...

5.  Adminportaal

 

Dit is het adminportaal van de websecmap‑tool, toegankelijk via http://<server-ip>:8000/admin .

 

 


 

6.  Bronnen

 

Internet Cleanup Foundation. (z.d.). Web Security Map. GitLab.

https://gitlab.com/internet-cleanup-foundation/web-security-map

 

NixOS Wiki. (z.d.). Flakes.

https://wiki.nixos.org/wiki/Flakes