guardicore / guardicore/monkey

Setting `MONKEY_MONGO_URL` env variable to non-default value results in island exiting with error

Open
#4,170 1 comment 0 reactions 0 assignees View on GitHub
Bug
Dominant language
Python
Stars
7.1k
Forks
830
PR merge metrics
No merged PRs in 30d

Description

## Describe the bug
The mongo URL is configurable via the `MONKEY_MONGO_URL` environment variable. However, Flask-Security also has a connection to mongodb, and it uses hard-coded values instead of the connection details from `MONKEY_MONGO_URL`. Thus, if `MONKEY_MONGO_URL` differs from the defaults, the server will error out because one of the connections to mongo will fail.

Introduced in 564c15dc1cc2395151a545ea89f1d9ff9260becc #2157

## To Reproduce
Steps to reproduce the behavior:
1. Setup and run mongodb on a different port (e.g. `27019`)
2. Set MONKEY_MONGO_URL environment variable with the port (e.g. `mongodb://localhost:27019/monkey_island`)
3. Run the island
4. Observe that the island exits because it failed to connect to mongodb

## Expected behavior
I expect both connections to mongodb to use the same connection details.

## Machine version (please complete the following information):
- OS: Windows or Linux

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.