From 65f5189eb153d889e130173796c9797a3775bd12 Mon Sep 17 00:00:00 2001 From: Mike Salvatore <mike.s.salvatore@gmail.com> Date: Wed, 13 Oct 2021 13:27:36 -0400 Subject: [PATCH 1/3] Docs: Fix broken "data directory" links in FAQ --- docs/content/FAQ/_index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/FAQ/_index.md b/docs/content/FAQ/_index.md index bec25b6b6..3a7d7b2b8 100644 --- a/docs/content/FAQ/_index.md +++ b/docs/content/FAQ/_index.md @@ -54,7 +54,7 @@ Monkey in the newly created folder. When you first access the Monkey Island server, you'll be prompted to create an account. To reset the credentials, edit the `server_config.json` file manually -(located in the [data directory](/reference/data_directory)). +(located in the [data directory]({{< ref "/reference/data_directory" >}})). {{% notice warning %}} If you reset the credentials, the database will be cleared. Any findings of the Infection Monkey from previous runs will be lost. <br/><br/> @@ -125,7 +125,7 @@ You can download the Monkey Island's log file directly from the UI. Click the "l  It can also be found as a local file on the Monkey Island server system in the specified -[data directory](/reference/data_directory). +[data directory]({{< ref "/reference/data_directory" >}}). The log enables you to see which requests were requested from the server and extra logs from the backend logic. The log will contain entries like these: @@ -161,7 +161,7 @@ The logs contain information about the internals of the Infection Monkey agent's ### How do I change the log level of the Monkey Island logger? The log level of the Monkey Island logger is set in the `log_level` field -in the `server_config.json` file (located in the [data directory](/reference/data_directory)). +in the `server_config.json` file (located in the [data directory]({{< ref "/reference/data_directory" >}})). Make sure to leave everything else in `server_config.json` unchanged: ```json From 67a7fb66c54176244be89b2c3854642d77430679 Mon Sep 17 00:00:00 2001 From: Mike Salvatore <mike.s.salvatore@gmail.com> Date: Wed, 13 Oct 2021 13:35:39 -0400 Subject: [PATCH 2/3] Docs: Fix numbering in password reset FAQ --- docs/content/FAQ/_index.md | 50 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/content/FAQ/_index.md b/docs/content/FAQ/_index.md index 3a7d7b2b8..52d888fca 100644 --- a/docs/content/FAQ/_index.md +++ b/docs/content/FAQ/_index.md @@ -64,33 +64,33 @@ However, you can save the Monkey's existing configuration by logging in with you In order to reset the credentials, the following edits need to be made: 1. Delete the `user` field. It will look like this: -```json -{ - ... - "user": "username", - ... -} -``` + ```json + { + ... + "user": "username", + ... + } + ``` 1. Delete the `password_hash` field. It will look like this: -```json -{ - ... - "password_hash": "$2b$12$d050I/MsR5.F5E15Sm7EkunmmwMkUKaZE0P0tJXG.M9tF.Kmkd342", - ... -} -``` + ```json + { + ... + "password_hash": "$2b$12$d050I/MsR5.F5E15Sm7EkunmmwMkUKaZE0P0tJXG.M9tF.Kmkd342", + ... + } + ``` 1. Set `server_config` to `password`. It should look like this: -```json -{ - ... - "environment": { - ... - "server_config": "password", - ... - }, - ... -} -``` + ```json + { + ... + "environment": { + ... + "server_config": "password", + ... + }, + ... + } + ``` Then, reset the Monkey Island process. On Linux, use `sudo systemctl restart monkey-island.service`. On Windows, restart the program. From 6b672fb45100cbfecae46a3a7523bc73c1a04f6d Mon Sep 17 00:00:00 2001 From: Mike Salvatore <mike.s.salvatore@gmail.com> Date: Wed, 13 Oct 2021 13:47:41 -0400 Subject: [PATCH 3/3] Docs: Reword password reset instructions * Write instuctions for Docker * Add a note to try deleting the entire data_directory --- docs/content/FAQ/_index.md | 57 +++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/docs/content/FAQ/_index.md b/docs/content/FAQ/_index.md index 52d888fca..ef25cc4f7 100644 --- a/docs/content/FAQ/_index.md +++ b/docs/content/FAQ/_index.md @@ -52,15 +52,17 @@ Monkey in the newly created folder. ## Reset/enable the Monkey Island password -When you first access the Monkey Island server, you'll be prompted to create an account. -To reset the credentials, edit the `server_config.json` file manually -(located in the [data directory]({{< ref "/reference/data_directory" >}})). {{% notice warning %}} If you reset the credentials, the database will be cleared. Any findings of the Infection Monkey from previous runs will be lost. <br/><br/> However, you can save the Monkey's existing configuration by logging in with your current credentials and clicking on the **Export config** button on the configuration page. {{% /notice %}} +### On Windows and Linux (AppImage) + +When you first access the Monkey Island server, you'll be prompted to create an account. +To reset the credentials, edit the `server_config.json` file manually +(located in the [data directory]({{< ref "/reference/data_directory" >}})). In order to reset the credentials, the following edits need to be made: 1. Delete the `user` field. It will look like this: @@ -91,10 +93,51 @@ In order to reset the credentials, the following edits need to be made: ... } ``` - Then, reset the Monkey Island process. - On Linux, use `sudo systemctl restart monkey-island.service`. - On Windows, restart the program. - Finally, go to the Monkey Island's URL and create a new account. +1. Restart the Monkey Island process: + * On Linux, simply kill the Monkey Island process and execute the AppImage. + * On Windows, restart the program. + +1. Go to the Monkey Island's URL and create a new account. + +If you are still unable to log into Monkey Island after following the above +steps, you can perform a complete factory reset by removing the entire [data +directory]({{< ref "/reference/data_directory" >}}) and then restarting the +Monkey Island process. + +### On Docker +When you first access the Monkey Island server, you'll be prompted to create an account. +To reset the credentials, you'll need to perform a complete factory reset: + +1. Kill the Monkey Island container: + ```bash + sudo docker kill monkey-island + ``` +1. Kill the MongoDB container: + ```bash + sudo docker kill monkey-mongo + ``` +1. Remove the MongoDB volume: + ```bash + sudo docker volume rm db + ``` +1. Restart the MongoDB container: + ```bash + sudo docker run \ + --name monkey-mongo \ + --network=host \ + --volume db:/data/db \ + --detach \ + mongo:4.2 + ``` +1. Restart the Monkey Island container + ```bash + sudo docker run \ + --name monkey-island \ + --network=host \ + guardicore/monkey-island:VERSION + ``` +1. Go to the Monkey Island's URL and create a new account. + ## Should I run the Infection Monkey continuously?