-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(3078, 3079): Resolve issues in Operations API Manager and Plugin Hooks #3187
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
Conversation
* Planning Services attempts to fcall() and assume all abilities utilizes Builder Plugin and attempts to build payload.
…Runtime * Conditional required to validate that only abilities utilizing builder plugin is used. * Required encoded_command before building of ability and executor
Added EOF new line to fix linting issue
no longer able to use event_loop replaced all instances of event_loop with loop
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.
Pull Request Overview
This pull request resolves issues with the Operations API Manager and Plugin Hooks by implementing conditional validation to ensure abilities that utilize the Builder Plugin are properly handled during dynamic compilation. The main problem was that the original implementation assumed all abilities use the Builder Plugin, causing AttributeError exceptions when processing abilities that don't utilize plugins.
Key changes:
- Added conditional validation before calling plugin hooks to prevent errors with non-plugin abilities
- Refactored hook calling logic into dedicated methods for better maintainability
- Updated test fixtures to use consistent parameter naming
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| app/service/planning_svc.py | Refactored plugin hook calling into a dedicated method with proper conditional validation |
| app/api/v2/managers/operation_api_manager.py | Added plugin hook calling functionality to the potential link creation process |
| tests/conftest.py | Updated test fixture parameter names from event_loop to loop for consistency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|



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: