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

Feature - Manage payloads #54

Merged
merged 11 commits into from
Jul 15, 2024

Conversation

jbaptperez
Copy link
Contributor

This is the GUI part of the payload management, which depends on the Caldera PR #2989.

  • Adds a payload view:
    • Accessible from the navigation menu,
    • Handles payload file upload to data/payloads (and deletion),
    • Plugins payloads are excluded and left intact,
  • Optional: Removes some white spaces in Navigation.vue,
  • Optional: Excludes JavaScript generated files form the Docker context:
    • Lighten the Docker context when building a Caldera image, when some generated JavaScript files are present (local development),
    • Exclude such files as the Dockerfile handles itself the Vue.js file compilation.

@elegantmoose elegantmoose self-requested a review June 7, 2024 16:46
@elegantmoose elegantmoose self-assigned this Jun 7, 2024
@elegantmoose elegantmoose requested a review from clenk June 7, 2024 16:46
@jbaptperez jbaptperez changed the title Feature - manage payloads Feature - Manage payloads Jun 17, 2024
@elegantmoose
Copy link
Collaborator

@jbaptperez reviewing and testing today. Apologies for delay.

@elegantmoose
Copy link
Collaborator

elegantmoose commented Jul 1, 2024

@jbaptperez How hard would it be also show all the payloads loaded in the Caldera, and then have just the local ones the user uploaded have the the ability to delete?

*might be useful to show all the payloads (and their source plugins) in the table as well. Or we should make it clear on the payloads view, that it is ignoring all loaded payloads from plugins.

@elegantmoose
Copy link
Collaborator

Tested on Mac. All functionality works as described.

@jbaptperez
Copy link
Contributor Author

jbaptperez commented Jul 2, 2024

@jbaptperez How hard would it be also show all the payloads loaded in the Caldera, and then have just the local ones the user uploaded have the the ability to delete?

*might be useful to show all the payloads (and their source plugins) in the table as well. Or we should make it clear on the payloads view, that it is ignoring all loaded payloads from plugins.

@elegantmoose, I made the changes you asked for.

  • I updated the payload view description to explicitly say that only local payloads can be uploaded or deleted (vs. plugin payloads),
  • I split the table into 2 tables: Local editable payloads and plugin payloads (read-only). Only payloads of enabled plugins appear in the second table.

Technically, I had to use complete relative paths to payloads returned by the API (the GET new parameters I added in the previous caldera PR).
Then, I processed the returned paths at the frontend side to properly extract the plugins name, whether the payload belongs or not to a plugin, etc.
This kind of data process may be directly done at the backend side, but this would imply an API breaking change and (above all) a new PR on both caldera and magma repository: Too long.

@elegantmoose
Copy link
Collaborator

This LGTM, just that one new comment I left above, and then the move the payloads under the Configuration menu.

@jbaptperez jbaptperez force-pushed the feature/manage-payloads branch from 84deb7f to 1295456 Compare July 11, 2024 18:34
@jbaptperez jbaptperez force-pushed the feature/manage-payloads branch from e71d726 to 81c90e1 Compare July 11, 2024 21:19
@jbaptperez
Copy link
Contributor Author

jbaptperez commented Jul 11, 2024

This LGTM, just that one new comment I left above, and then the move the payloads under the Configuration menu.

@elegantmoose, done and rebased.

I also fixed the upload modal width (insufficient when using files with long names) and, as I just discovered there were another existing upload modal in the adversaries view, I adapted the payload one for consistency.

@elegantmoose elegantmoose merged commit 47613a8 into mitre:master Jul 15, 2024
1 check failed
@elegantmoose
Copy link
Collaborator

@jbaptperez Thank you. 👏 Great PR.

@jbaptperez jbaptperez deleted the feature/manage-payloads branch July 15, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants