guardicore / monkey

Infection Monkey - An open-source adversary emulation platform
https://www.guardicore.com/infectionmonkey/
GNU General Public License v3.0
6.56k stars 765 forks source link

Monkey Island should report Timing for each request #547

Closed ShayNehmad closed 4 years ago

ShayNehmad commented 4 years ago

Is your feature request related to a problem? Please describe. I want to measure how long different operations take for the Island

Describe the solution you'd like The Island already logs how long requests take:

image

I want it to send this info in the JSON response as well for testing purposes

Describe alternatives you've considered Parsing the log, but that seems worse

ShayNehmad commented 4 years ago

After @danielguardicore's review, instead of doing this 424784e We'll do it in the BB code instead.

ShayNehmad commented 4 years ago

Design after consulting with @VakarisZ:

Island changes

Support DELETE report to clear all caches:

BB changes

  1. Add "get_all_report_pages" to the MonkeyIslandClient class - will return dict of page to response time (response time via response.elapsed)
  2. Add ReportPerformenceAnalyzer which checks the dict against configured maximum times allowed per page (e.g. report/security 3s, report/zt (all of them) 3s, report/mitre 3s)
  3. Add a test to test_blackbox which has both the Comm Analyzer and the ReportPerformence analyzer. Config should be 10 machines (we might need to add them in TerraForm) and some segmentation + exploits + PBAs which create content in the reports