guardicore / monkey

Infection Monkey - An open-source adversary emulation platform
https://www.guardicore.com/infectionmonkey/
GNU General Public License v3.0
6.56k stars 765 forks source link

Unexpected Island mode crashes configuration page #2583

Closed shreyamalviya closed 1 year ago

shreyamalviya commented 1 year ago

Describe the bug

If the frontend gets an unexpected Island mode from the backend (not "advanced", "ransomware", or "unset"), the configuration page crashes.

To Reproduce

Steps to reproduce the behavior:

  1. Run the Island with any mode.
  2. Modify the mode field in simulation_state.json (in the data directory) to something other than "advanced", "ransomware", or "unset".
  3. Go to the configuration page on the Island.

Expected behavior

It shouldn't crash and should probably default to "unset" if the mode isn't recognised. This should be changed in the backend. If the mode is not recognised, the endpoint should return "unset". If this seems more like something that the frontend should handle, we should add the condition to the logic to set the mode as "unset" if it's not recognised.

Screenshots

https://user-images.githubusercontent.com/44770317/201920306-6d7d6890-e726-429c-b766-e0fcd3026236.mp4

mssalvatore commented 1 year ago

This should be changed in the backend. If the mode is not recognised, the endpoint should return "unset".

If the mode is not recognized, something has gone horribly wrong. Who knows what other data has been corrupted. The backend should probably crash to avoid doing further damage.

shreyamalviya commented 1 year ago

Island modes were removed in #3400.