REMARK: Please use the K8s installation, this is easier and way more stable
Local installation based on Ubuntu 20.04. and its possible but we do recommend to install it on a K8s Cluster as its easier and more stable.
- nginx
sudo apt install nginx
- npm
sudo apt install npm
- ng
sudo npm install -g @angular/cli
- git
sudo apt install git
- curl
sudo apt install curl
- Clone repository and install dependencies
cd /tmp; git clone git://github.com/blabla1337/skf-flask.git
cd /tmp/skf-flask; sudo pip3 install -r requirements.txt
cd /tmp/skf-flask/Angular2; npm install
cd /tmp/skf-flask/Angular2; ng build --aot
- Configure nginx
sudo rm /etc/nginx/sites-enabled/default
sudo cp /tmp/skf-flask/installations/local/site-tls.conf /etc/nginx/sites-enabled/default
mv /tmp/skf-flask /
- Configure & install RabbitMQ
sudo echo "deb http://www.rabbitmq.com/debian/ testing main" >> /etc/apt/sources.list
sudo curl http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install rabbitmq-server
# To start the service:
service rabbitmq-server start
sudo rabbitmqctl add_user admin admin-skf-secret
sudo rabbitmqctl set_user_tags admin administrator
sudo rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
- Configure kubernetes config file for Labs
For also launching the labs from the SKF application we need to create a Kubernetes cluster in one of the platforms like Google. When you created the cluster you need to place the kubernetes config file in the location ~/.kube/config of the machine you run the SKF app
#### Edit Settings
* __Change the JWT_SECRET value with below command__
```bash
perl -pi -e "s/JWT_SECRET = ''/JWT_SECRET = 'THIS_SHOULD_BE_CHANGED_AND_RANDOM'/" /skf-flask/skf/settings.py
- Change the domain value with below command
perl -pi -e "s/\*/https:\/\/demo.securityknowledgeframework.org/" /skf-flask/skf/settings.py
- Change the domain value with below command
perl -pi -e "s/http:\/\/127.0.0.1:8888\/api/https:\/\/demo.securityknowledgeframework.org\/api/" /skf-flask/Angular/src/environments/environment.prod.ts
- Change the domain value with below command
perl -pi -e "s/localhost/demo.securityknowledgeframework.org/" /skf-flask/installations/local/skf-angular.sh
- Certificates stored in /skf-flask/ dir
Put your own certificate files in the /skf-flask dir and name them like below OR if you want self signed (dunno why but hey i dont judge) do the steps below
openssl req -nodes -newkey rsa:4096 -keyout /skf-flask/server.key -out /skf-flask/server.csr -subj "/CN=OWASP-SKF"
openssl x509 -req -days 365 -in /skf-flask/server.csr -signkey /skf-flask/server.key -out /skf-flask/server.pem
- Start nginx
sudo systemctl restart nginx
cd /skf-flask/installations/local; bash wrapper.sh
Navigate to https://your_domain_value_you_used_above_commands
If you get the following error
nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/default:17
If you are not using that file just remove it: (sudo rm /etc/nginx/sites-enabled/default
)