SamuraiWTF / samuraiwtf

The main SamuraiWTF collaborative distro repo.
https://owasp.org/www-project-samuraiwtf/#SamuraiWTF_Project
GNU Lesser General Public License v3.0
462 stars 119 forks source link

Fix Dojo DB connection issues #99

Closed corysabol closed 5 years ago

corysabol commented 5 years ago

Change Log

samurai-dojo-tasks.yml was starting dojo using docker-compose and then again using the systemd service descriptor which seemed to cause issues with provisioning the databases. Removing the ansible tasks which started dojo using docker-compose appears to have fixed the issue.

Additionally commented out the provisioning of Zap proxy as it was failing on my end confounding the root cause of the DB issues. This may need to be a separate issue if it's reproducible.

Reviewer instructions

  1. checkout the dojo_db_conn_fix branch
  2. backup any current versions of samurai (or don't)
  3. run vagrant destroy -f and then vagrant up
  4. Log into the vm as samurai
  5. browse to http://dojo-basic.wtf and http://dojo-scavenger.wtf and make sure the DB seems to be working
  6. If you want to be extra certain run sudo docker exec -it samuraidojo_basicdb_1 /bin/bash then mysql -uroot -psamurai and finally show databases; to see if the database was actually created.
  7. Do the above again but replace samuraidojo_basicdb_1 with samuraidojo_scavengerdb_1