Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure MongoDB on Monkey Island initialization #1148

Closed
10 tasks done
mssalvatore opened this issue May 6, 2021 · 0 comments
Closed
10 tasks done

Configure MongoDB on Monkey Island initialization #1148

mssalvatore opened this issue May 6, 2021 · 0 comments
Labels
Complexity: Medium Enhancement Issue that describes an enhancement to a current feature. Impact: High

Comments

@mssalvatore
Copy link
Collaborator

mssalvatore commented May 6, 2021

Monkey Island needs to write runtime artifacts to a writable location and assume that the source code directory is read-only. Currently, MongoDB is started by the linux/run.sh, windows\run_mongodb.bat, and appimage/run_appimage.sh. These scripts do not have access to the data_dir property in server_config.json, and giving them access would add even more redundant functionality to all of these scripts.

  • Add a "mongodb" section to the server_config.json with a "start_mongodb" boolean. (0) - @VakarisZ
{
    "log_level": "debug",
    "data_dir": "$HOME/.monkey_island",
    "environment": {
        "server_config": "password",
        "deployment": "development",
        "user": "my_user",
        "password_hash": "DEADBEEF"
    }
    "mongodb" {
        "start_mongodb": true
    }
}
  • Make sure this section exists and is correct for the default server_config.json, the docker server_config.json, the windows installer server_config.json, and the AppImage server_config.json

  • If "start_mongodb": true, then monkey_island.py will start the mongodb process and set it's --dbpath argument to data_dir/db. (0d) - @VakarisZ

  • Refactor the data dir folder creation and permission setting into a separate function and re-use it to create db dir with relevant permissions as well (0d).

  • Refactor mongodb initialization to be decoupled from environment config (0d) - @VakarisZ

  • Remove the code that starts mongodb from appimage/run_appimage.sh. If this script no longer serves any purpose, remove it and modify the AppImage to run without it. (0d) - @VakarisZ

  • Remove linux/run.sh. Modify documentation with new instructions on how to start monkey island. (0d) - @VakarisZ

  • Remove code that creates db dir from deployment scripts, mongodb install scripts, docs, etc. (0) - @VakarisZ

  • Remove the code that starts mongodb from monkey_island/windows/*. If any of these scripts no longer serves a purpose, remove them.(0d) - @VakarisZ

  • Ensure the mongodb process is properly cleaned up when Monkey Island exits (0d)

  • Review PR and fix (0d)

@mssalvatore mssalvatore added Feature Issue that describes a new feature to be implemented. Complexity: Medium Enhancement Issue that describes an enhancement to a current feature. Impact: High python and removed Feature Issue that describes a new feature to be implemented. labels May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium Enhancement Issue that describes an enhancement to a current feature. Impact: High
Projects
None yet
Development

No branches or pull requests

2 participants