fix(3078, 3079): Resolve issues in Operations API Manager and Plugin Hooks #3187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request uses the proposed fix in #3101 to address issues #3078 and #3079.
Prior to PR, adding a ability with Builder Plugin does not build Payload using Potential Links in a Operation. It requires the ability to be added to an Adversary, then creating a Operation from that Adversary. The changes made allows for dynamic compilation of Builder Plugin ability payloads when adding a Potential Link to a Operation during runtime.
Changes I Made to #3101
After testing the proposed fix, running an operation with an ability that doesn't utilize a plugin fails, and raises a AttributeError. Error Message:
The error occurs because the implementation assumes that every ability uses the Builder Plugin for dynamic compilation. However, there are abilities that do not utilize the Builder Plugin. When the builder service attempts to build these abilities, it encounters a NoneType object where a payload or plugin-related attribute is expected.
TL;DR: Required conditional to validate an ability utilizes Builder Plugin
caldera/app/api/v2/managers/operation_api_manager.py
Line 177 in de989ef
caldera/app/service/planning_svc.py
Line 395 in de989ef
Full Logs: 3101_logs.txt
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I have tested these changes in Caldera v5.3.0 with a staged SandCat agent with abilities that use and not use Builder Plugin.
Checklist: