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
Possible fix to Issue #2315 (affects templates/abilities.html
)
#2321
Conversation
The REST API expects an ability object in which the cleanup field is an array (list) of strings. Currently, the "Create Ability" UI saves the cleanup command as a string, causing an Unprocessable Entity response status code (422) when executing the PUT request in API v2. This commit includes a slight change to the cleanup field in the Create Ability modal which converts a line-break separated list of cleanup commands to the correct type. The net effect of the change is to enable users to create and edit abilities which include cleanup commands through the UI and API v2.
Ensure correct typing in `transformCleanup` under the Alpine.js framework.
Redone cleanup commands to enable easy and intuitive addition and removal of cleanup commands.
Propagate change to ability modal to `profiles.html`.
Changes to create ability modal incorporating Adam's UI fixes and backend change to the cleanup field.
Incorporate the changes to the create ability modal to the `profiles.html` template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CDJellen LGTM.
Lets have @argaudreau have final review of HTML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as intended and HTML is super clean! I hope alpine and bulma were easy to pick up.
d718e37
Kudos, SonarCloud Quality Gate passed! |
Possible fix to Issue #2315 (unable to create new ability)
Affects:
templates/abilities.html
Change: ensure the executor.cleanup object conforms to the type expected by API v2.
Description
The REST API expects an ability object in which the cleanup field is an array (list) of strings. Currently, the "Create Ability" UI saves the cleanup command as a string, causing an Unprocessable Entity response status code (422) when executing the
PUT
request in API v2.This commit includes a slight change to the cleanup field in the Create Ability modal which converts a line-break separated list of cleanup commands to the correct type. The net effect of the change is to enable users to create and edit abilities which include cleanup commands through the UI and API v2.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
My test ability
in accordance with the User Certificate in thetraining
plugin which:discovery
tactic,sandcat.go-darwin
as an executor,whoami
command,ifconfig -a
as a cleanup command;rm
;GET
request, verifying the changes to both abilities.Checklist: