diff --git a/README.md b/README.md index 5a9ef25..cbd2b9f 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,30 @@ -This is a docker-compose repository for a quick&easy start if you want to play around with the SecurityRAT tool (otherwise available at https://github.com/SecurityRAT/SecurityRAT). + +# SecurityRAT (v1.7.x) Docker Compose + +This repository is a docker-compose setup for a quickstart with the [SecurityRAT](https://github.com/SecurityRAT/SecurityRAT) tool (**Version 1.7.x**). **Important: the setup is not suitable for a production environment!** +## How to run + +1. Clone this project +1. [Optional] You can modify the database settings as described in the **Configuration** section below. +1. Run `docker-compose up --remove-orphans` from the project's root directory. +1. After all services have started, navigate to http://localhost:9002 in your browser. +1. Authenticate with one of the default users `admin/admin` or `user/user` +1. Update the database with the requirements set included as SQL dump ([OWASP ASVS 3.0.1 set](https://github.com/SecurityRAT/Security-Requirements/blob/master/owasp_asvs_3_0_1.sql)) in the _mariadb-service_ image. Do this by running this command in a new terminal: + + ```sh + docker exec securityrat-mariadb sh -c './var/dumpRequirements.sh' + ``` + ## Configuration -Configuration wise, nothing must be done since the application can be as well started with the default settings. The means that the following configurations are optional: +The docker-compose file already contains default configuration, hence the following settings are optional: ### Database settings -1. First change the appropriate value in the mysql-service: +1. Change the default database settings using the following environment variables in the **docker-compose.yml**. ```yaml environment: @@ -18,38 +34,15 @@ Configuration wise, nothing must be done since the application can be as well st MYSQL\_PASSWORD: #Password of the MYSQL\_USER ``` -1. Change the values in the _securiryrat_ service to match does made above +1. Change the _securiryrat_ service configuration in **docker-compose.yml** to match the modifications from the previous step. ```yaml environment: - - SPRING\_DATASOURCE\_URL=jdbc:mysql://mysql-service:3306/${MYSQL\_DATABASE}?useUnicode=true&characterEncoding=utf8&useSSL=false + - SPRING\_DATASOURCE\_URL=jdbc:mysql://mariadb-service:3306/${MYSQL\_DATABASE}?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true - SPRING\_DATASOURCE\_USERNAME=${MYSQL\_USER} - SPRING\_DATASOURCE\_PASSWORD=${MYSQL\_PASSWORD} ``` -## How to run - -1. Clone this project -1. Before running a new version of SecurityRAT, make sure you remove the old latest docker image. You can achieve this by running `docker rmi securityrat/securityrat:latest`. Alternatively, you could set the desired version of SecurityRAT you want to use by specifying the tag name in the _docker-compose.yml file_ as follows: - - ```yaml - securityrat: - container_name: securityrat - image: securityrat/securityrat:${image_tag_name} - ``` - -1. Open a terminal and run `docker-compose build` from the project's root directory. This will build the latest mysql image which shall be used by the _mysql-service_. -1. Run `docker-compose up --remove-orphans` from the project's root directory. -1. After all services have started, navigate to http://localhost:9002 in your browser -1. Authenticate with one of the default users `admin/admin` or `user/user` -1. Update the database with the requirements set included as SQL dump ([OWASP ASVS 3.0.1 set](https://github.com/SecurityRAT/Security-Requirements/blob/master/owasp_asvs_3_0_1.sql)) in the _mysql-service_ image. Do this by running this command in a new terminal: - - ```sh - docker exec securityrat-mysql sh -c './var/dumpRequirements.sh' - ``` - ## Cleaning up After stopping the app, run `docker-compose down` from the project's root directory to remove the created containers. - - diff --git a/docker-compose.yml b/docker-compose.yml index 607ca40..ef57c59 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: command: mysqld --skip-ssl securityrat: container_name: securityrat - image: securityrat/securityrat + image: securityrat/securityrat:1.7.13 links: - mysql-service environment: