mitre/stockpile

Missing pip requirement matplotlib?

L015H4CK opened this issue · 1 comments

Describe the bug
When running an operation using the new guided planner and enabling the debug attack graph output, the conditional matplotlib.pyplot import in line 232 of the guided planner causes a ModuleNotFoundError: No module named 'matplotlib'.

To Reproduce
Steps to reproduce the behavior:

  1. Fresh install CALDERA 4.1.0
  2. Set debug output for guided planner to True
  3. Start new operation using the guided planner

Expected behavior
The operation should run successfully and the debug output should be shown.

Screenshots

2022-10-05 09:05:56 - ERROR (c_operation.py:344 run) No module named 'matplotlib'
Traceback (most recent call last):
  File "/home/kalidera/Desktop/caldera/app/objects/c_operation.py", line 341, in run
    await self.cede_control_to_planner(services)
  File "/home/kalidera/Desktop/caldera/app/objects/c_operation.py", line 331, in cede_control_to_planner
    await planner.execute()
  File "/home/kalidera/Desktop/caldera/plugins/stockpile/app/guided.py", line 138, in execute
    await self.planning_svc.execute_planner(self)
  File "/home/kalidera/Desktop/caldera/app/service/planning_svc.py", line 135, in execute_planner
    await getattr(planner, planner.next_bucket)()
  File "/home/kalidera/Desktop/caldera/plugins/stockpile/app/guided.py", line 141, in guided
    await self.execute_subop(ability_ids=self.ability_ids, goals=self.goals)
  File "/home/kalidera/Desktop/caldera/plugins/stockpile/app/guided.py", line 153, in execute_subop
    await self._show_attack_graph(attack_graph)
  File "/home/kalidera/Desktop/caldera/plugins/stockpile/app/guided.py", line 232, in _show_attack_graph
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

Desktop (please complete the following information):

  • OS: Kali
  • Version: 4.1.0

Additional context
I did not find any information about matplotlib being a requirement, so I think this is not a desired/expected behavior.
This could be fixed by adding matplotlib to the requirements of the stockpile plugin.

Thank you for pointing this out, and apologies for the late response on it.

I opened a PR that will add the dependency to the requirements.txt. It should be approved and merged in shortly.