From 4dd064cab835b145e123e365d7f00eda69e5b4a5 Mon Sep 17 00:00:00 2001 From: Brian Kanyora Date: Mon, 5 Jun 2023 23:59:32 +0100 Subject: [PATCH] feature\898: Fixed the resetting operating state to set compromised or overwhelmed services or operating system back to a good state. Added a reset count that switches the node into a good state. Created a "SHUTTING DOWN" operating state to last for a (configurable) and a "BOOTING" operating state to last for a (configurable). Created a test file to test the reset changes the node to a good state when its set to a COMPROMISED state. The last two test tests makes sure that the node boots and shutdowns correctly. Lastly, updated the docs file as well. --- docs/source/about.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/about.rst b/docs/source/about.rst index 8cc08b13..766043c1 100644 --- a/docs/source/about.rst +++ b/docs/source/about.rst @@ -31,7 +31,7 @@ An inheritance model has been adopted in order to model nodes. All nodes have th * Name * Type (e.g. computer, switch, RTU - enumeration)​ * Priority (P1, P2, P3, P4 or P5 - enumeration)​ -* Hardware State (ON, OFF, RESETTING - enumeration)​ +* Hardware State (ON, OFF, RESETTING, SHUTTING_DOWN, BOOTING - enumeration)​ Active Nodes also have the following attributes (Class: Active Node):​ @@ -106,6 +106,8 @@ The status changes that can be made to a node are as follows: * ON * OFF * RESETTING - when a status of resetting is entered, the node will automatically exit this state after a number of steps (as defined by the nodeResetDuration configuration item) after which it returns to an ON state + * BOOTING + * SHUTTING_DOWN * Active Nodes and Service Nodes: @@ -259,6 +261,8 @@ For the nodes, the following values are represented: * 1 = ON * 2 = OFF * 3 = RESETTING + * 4 = SHUTTING_DOWN + * 5 = BOOTING * SoftwareState: @@ -311,7 +315,7 @@ Each ``node_info`` contains the following: .. code-block:: [ - hardware_state (0=none, 1=ON, 2=OFF, 3=RESETTING) + hardware_state (0=none, 1=ON, 2=OFF, 3=RESETTING, 4=SHUTTING_DOWN, 5=BOOTING) software_state (0=none, 1=GOOD, 2=PATCHING, 3=COMPROMISED) file_system_state (0=none, 1=GOOD, 2=CORRUPT, 3=DESTROYED, 4=REPAIRING, 5=RESTORING) service1_state (0=none, 1=GOOD, 2=PATCHING, 3=COMPROMISED)