From 4bbac5341866a2c0c72b218cebff55911d08bec1 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Tue, 14 Dec 2021 10:09:33 +0100 Subject: [PATCH] Swimm: Remove add to configuration unit --- .swm/AzD8XysWg1BBXCjCDkfq.swm | 67 ----------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 .swm/AzD8XysWg1BBXCjCDkfq.swm diff --git a/.swm/AzD8XysWg1BBXCjCDkfq.swm b/.swm/AzD8XysWg1BBXCjCDkfq.swm deleted file mode 100644 index 3339f5178..000000000 --- a/.swm/AzD8XysWg1BBXCjCDkfq.swm +++ /dev/null @@ -1,67 +0,0 @@ -{ - "id": "AzD8XysWg1BBXCjCDkfq", - "name": "Add a new configuration setting to the Agent ⚙", - "task": { - "dod": "Make the max victim number that Monkey will find before stopping configurable by the user instead of constant.", - "tests": [], - "hints": [ - "Look for `victims_max_exploit` - it's rather similar." - ] - }, - "content": [ - { - "type": "text", - "text": "# Make something configurable\n\nIn this unit, you will learn how to add a configuration option to Monkey and how to use it in the Monkey Agent code. \n\n![computer fire](https://media.giphy.com/media/7J4P7cUur2DlErijp3/giphy.gif \"computer fire\")\n\n## Why is this important?\n\nEnabling users to configure the Monkey's behaviour gives them a lot more freedom in how they want to use the Monkey and enables more use cases.\n\n## What is \"Max victims to find\"?\n\nThe Monkey has a function which finds \"victim\" machines on the network for the Monkey to try and exploit. It's called `get_victim_machines`. This function accepts an argument which limits how many machines the Monkey should find.\n\nWe want to make that value editable by the user instead of constant in the code.\n\n## Manual testing\n\n1. After you've performed the required changes, reload the Server and check your value exists in the Internal tab of the config (see image).\n\n![](https://i.imgur.com/e0XAxuV.png)\n\n2. Set the new value to 1, and run Monkey locally (from source). See that the Monkey only scans one machine." - }, - { - "type": "snippet", - "path": "monkey/infection_monkey/config.py", - "comments": [], - "firstLineNumber": 103, - "lines": [ - " exploiter_classes = []", - " system_info_collector_classes = []", - " ", - "* # how many victims to look for in a single scan iteration", - "* victims_max_find = 100", - " ", - " # how many victims to exploit before stopping", - " victims_max_exploit = 100" - ] - }, - { - "type": "snippet", - "path": "monkey/monkey_island/cc/services/config_schema/internal.py", - "comments": [], - "firstLineNumber": 28, - "lines": [ - " \"title\": \"Monkey\",", - " \"type\": \"object\",", - " \"properties\": {", - "* \"victims_max_find\": {", - "* \"title\": \"Max victims to find\",", - "* \"type\": \"integer\",", - "* \"default\": 100,", - "* \"description\": \"Determines the maximum number of machines the monkey is \"", - "* \"allowed to scan\",", - "* },", - " \"victims_max_exploit\": {", - " \"title\": \"Max victims to exploit\",", - " \"type\": \"integer\"," - ] - }, - { - "type": "text", - "text": "* When changing config schema by adding or deleting keys, you need to update the Blackbox Test configurations as well [here](https://github.com/guardicore/monkey/tree/develop/envs/monkey_zoo/blackbox/config_templates)." - } - ], - "symbols": {}, - "file_version": "2.0.3", - "meta": { - "app_version": "0.6.6-2", - "file_blobs": { - "monkey/infection_monkey/config.py": "8f4984ba6563564343282765ab498efca5d89ba8", - "monkey/monkey_island/cc/services/config_schema/internal.py": "86318eaf19b9991a8af5de861a3eb085238e17a4" - } - } -}