Skip to content

User is asked to submit config even with no changes if certain config tabs are opened #1324

@shreyamalviya

Description

@shreyamalviya

Describe the bug

The user is asked to submit configuration if they open the "Network" or "Ransomware" tab, even if they make no changes to the configuration, while changing configuration tabs.

To Reproduce

Steps to reproduce the behavior:

  1. Run the Island.
  2. Go to the configuration page.
  3. Click on the "Network" or "Ransomware" tab.
  4. Click on the "ATT&CK" tab.
  5. See the pop-up asking you to submit your changes (even though you made none).

Expected behavior

It should not show the pop-up if no config changes were made.

Screenshots

island-config-info-box-bug.mp4

Findings

This happens because of the info box and README note in the "Network" and "Ransomware".
The following line resolves to false which is why the Island thinks the config has changed. This happens because this.state.configuration contains the info_box and readme fields, but this.initialConfig does not.

if (JSON.stringify(this.state.configuration) === JSON.stringify(this.initialConfig)) {

image


My guess is that this has something to do with the fact that in the schema, info_box and readme are of type object but have no properties, which all other objects do.

image


If my guess is correct, a quick hack would be to change the type to string (or some other field type). We're already overriding the component (see code snippet below), so it won't show the input field. However, by my experimentation, input field types must have a title. I can't leave it blank and if I don't define it, it picks up the key value. It's possible to just define it as one whitespace but that leaves an awkward gap in the UI.


What to try next: One thing that I didn't spend a lot of time on was understanding the difference between custom widgets and custom fields. Maybe there's a workaround there. Also see this comment.

(All screenshots and code snippets are only about the "Network" tab.)

Note

If you click "Reset to defaults", you can then go back to the Attack config screen without getting a warning. After switching to the Attack config screen, you cannot go to any other tab until you refresh

Tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugAn error, flaw, misbehavior or failure in the Monkey or Monkey Island.Complexity: HighImpact: CriticalUIUser Interface

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions