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

fixing systemd service definitions #104

Closed elreydetoda closed 4 years ago

elreydetoda commented 4 years ago

Observed

Solution

  1. Don't use the docker_container module to install the docker container, because that will "manage" you docker container. It will start running the docker container for you, so instead if you use the docker_image it will simply do the equivalent of docker pull
  2. the systemd service file was missing a value for the argument of --name in the mutillidae docker ExecStart command.
  3. There were actually multiple dvwa containers that were getting launched. 1 when the docker_container module was used (named dvwa) and another when the systemd service was started (name wtf-dvwa.service (because of the %n and not using %N)).
  4. The ExecStartPre and ExecStopPost were both unnecessary since we are only launching a single container with the ExecStart and aren't trying to affect any other containers.

NOTE: the docker containers names are prepended with wtf-, because that is what the service name file has in it (wtf-dvwa & wtf-mutillidae).

Extra info

So, for the longest time I was struggling to finalized the docker_image module, and I figured out that we are currently running ansible 2.7 (latest is 2.9) in the debian-10 bento box. So, we might want to figure out another method of installation, something that will grab a more up to date version: https://www.vagrantup.com/docs/provisioning/ansible_local.html