|
WSF
|
#include <WsfCyberEngagementManager.hpp>
Classes | |
| class | EngagementData |
Public Types | |
| using | EngagementMap = std::unordered_map<size_t, EngagementData> |
Public Member Functions | |
| EngagementManager () | |
| ~EngagementManager ()=default | |
| EngagementManager (const EngagementManager &aSrc)=delete | |
| const EngagementManager & | operator= (const EngagementManager &aRhs)=delete |
| Engagement * | FindEngagement (const std::string &aAttackType, const std::string &aAttacker, const std::string &aVictim) |
| Engagement * | FindEngagement (size_t aKey) |
| bool | EngagementExists (const std::string &aAttackType, const std::string &aAttacker, const std::string &aVictim) const |
| bool | EngagementExists (size_t aKey) const |
Static Public Member Functions | |
| static EngagementManager & | Get (WsfSimulation &aSimulation) |
| Returns a modifiable instance of the cyber engagement manager. | |
Friends | |
| class | Event |
Attack implementation methods | |
CyberAttackInitialize() processes any delivery delays in the cyber engagement model. CyberAttack() picks up with the exploit phase upon completion of the prior phase. CyberAttackEffect() is called on a successful attack to employ all associated effects. CyberAttackReact() is called upon the completion of the CyberAttackEffect() algorithm to model the reaction algorithm of the target.
| |
| void | CyberAttackInitialize (EngagementData &aEngagementData) |
| void | CyberAttack (EngagementData &aEngagementData) |
| void | CyberAttackEffect (EngagementData &aEngagementData) |
| void | CyberAttackDetectionDelay (EngagementData &aEngagementData) |
| void | CyberAttackRecoveryDelay (EngagementData &aEngagementData) |
CullEngagements methods | |
Removes engagements predicated by the existence of either the attacker or victim. Typically, only the victim's existence is required for an ongoing engagement. An attacker specific version of this method is also provided for use cases where users want to also end engagements where the attacker is required beyond the initiation of the engagement. | |
| void | CullVictimEngagements (const std::string &aVictim) |
| void | CullAttackerEngagements (const std::string &aAttacker) |
| bool | CyberAttack (const std::string &aAttackType, const std::string &aAttacker, const std::string &aVictim, WsfSimulation &aSimulation, AttackParameters *aParameters=nullptr) |
CyberScan method | |
Initiates a scan with the given parameters. This method initially checks for the existence of current engagement objects that match the provided arguments and ensures that a scan request is valid, while performing the necessary bookkeeping. If a scan request is valid, then the next method in the scanning chain will be called - ScanInitialize() | |
| bool | CyberScan (const std::string &aAttackType, const std::string &aAttacker, const std::string &aVictim, WsfSimulation &aSimulation) |
Cancel method | |
Stops the cyber attack progression via external request. | |
| bool | Cancel (size_t aKey) |
| EngagementMap::iterator | FindEngagementByPlatform (const std::string &aName, bool aByVictim) |
| EngagementData * | FindEngagementData (const std::string &aAttackType, const std::string &aAttacker, const std::string &aVictim) |
| EngagementData * | FindEngagementData (size_t aKey) |
Add Engagement method | |
Adds an engagement with required data to the list of maintained engagements. If an engagement already exists with these parameters, it is returned instead. Always returns a reference with the found engagement or the newly created engagement. | |
| EngagementData & | AddEngagement (const std::string &aAttackType, const std::string &aAttacker, const std::string &aVictim, WsfSimulation &aSimulation) |
Scan implementation methods | |
CyberScanInitialize() determines if a delay is required due to user input. CyberScan() implements the scan phase logic after any possible delay in execution in the previous method call.
| |
| void | CyberScanInitialize (EngagementData &aEngagementData) |
| void | CyberScan (EngagementData &aEngagementData) |
| using wsf::cyber::EngagementManager::EngagementMap = std::unordered_map<size_t, EngagementData> |
|
inline |
Referenced by EngagementManager(), Event, Get(), and operator=().
|
default |
|
delete |
References EngagementManager().
|
protected |
References FindEngagementData().
Referenced by CyberAttack(), CyberScan(), and operator=().
| bool wsf::cyber::EngagementManager::Cancel | ( | size_t | aKey | ) |
References FindEngagementData().
Referenced by wsf::cyber::EventManager::CancelEvent(), and operator=().
| void wsf::cyber::EngagementManager::CullAttackerEngagements | ( | const std::string & | aAttacker | ) |
References FindEngagementByPlatform().
Referenced by operator=().
| void wsf::cyber::EngagementManager::CullVictimEngagements | ( | const std::string & | aVictim | ) |
References FindEngagementByPlatform().
Referenced by operator=().
| bool wsf::cyber::EngagementManager::CyberAttack | ( | const std::string & | aAttackType, |
| const std::string & | aAttacker, | ||
| const std::string & | aVictim, | ||
| WsfSimulation & | aSimulation, | ||
| AttackParameters * | aParameters = nullptr ) |
Check the attack name for validity
Check that the target platform exists.
An engagement already exists for this attacker/victim/attack type combination. If an attack isn't in progress, then proceed with this attack. Otherwise, an attack is still in progress, and this call attempt will fail.
An attack was previously requested by this attacker, and the time has not elapsed since the attack has resolved. We terminate any further processing for this request, and wait for the attack to resolve. We still return true, however, as the request was valid and ongoing (from the perspective of the attacker)
No engagement object. This is a new engagement. Proceed with algorithm.
References AddEngagement(), CyberAttackInitialize(), FindEngagementData(), wsf::cyber::ScenarioExtension::Get(), WsfSimulation::GetPlatformByName(), and WsfSimulation::GetScenario().
Referenced by CyberAttackInitialize(), and operator=().
|
protected |
The target may be outright immune to the attack due to previous attacks. In this case, the attack fails.
The attack may have some resource requirement associated with it. If the attacker does not have enough resources the attack fails. If the attacker already allocated resources the attack fails.
The attack is not blocked and may proceed. Determine attack success by probabilistic draw
Mark the attack as completed and successful
Determine if the outcome of the attack is reported to the attacker.
Activate all of the effects associated with this attack
Mark the attack as completed and successful
Determine if the victim can detect the attack
Determine if the outcome of the attack is reported to the attacker.
References wsf::cyber::EventManager::AddEvent(), wsf::cyber::VisualizationManager::AttackFailed(), wsf::cyber::VisualizationManager::AttackSucceeded(), wsf::cyber::random::cATTACK_DETECTION, wsf::cyber::Event::cATTACK_DETECTION_DELAY, wsf::cyber::Engagement::cATTACK_IMMUNITY, wsf::cyber::Engagement::cATTACK_INSUFFICIENT_RESOURCES, wsf::cyber::Engagement::cATTACK_NOT_VULNERABLE, wsf::cyber::Engagement::cATTACK_RANDOM_DRAW, wsf::cyber::Event::cATTACK_RECOVERY_DELAY, wsf::cyber::random::cATTACK_SUCCESS, wsf::cyber::random::cSTATUS_REPORT, CyberAttackDetectionDelay(), CyberAttackEffect(), WsfObserver::CyberAttackFailed(), WsfObserver::CyberAttackSucceeded(), wsf::cyber::Protect::ExecuteIsVulnerable(), wsf::cyber::SimulationExtension::Get(), wsf::cyber::VisualizationManager::Get(), wsf::cyber::SimulationExtension::GetCyberEventManager(), wsf::cyber::EngagementManager::EngagementData::GetEngagement(), wsf::cyber::Engagement::GetSimulation(), wsf::cyber::EngagementManager::EngagementData::RemoveEffects(), and simTime.
|
protected |
Determine if the victim can attribute the attack to the attacking platform
References wsf::cyber::EventManager::AddEvent(), wsf::cyber::random::cATTACK_ATTRIBUTION, wsf::cyber::Event::cATTACK_RECOVERY_DELAY, WsfObserver::CyberAttackAttributed(), WsfObserver::CyberAttackDetected(), CyberAttackRecoveryDelay(), wsf::cyber::Protect::ExecuteOnAttackDetection(), wsf::cyber::SimulationExtension::Get(), wsf::cyber::SimulationExtension::GetCyberEventManager(), wsf::cyber::EngagementManager::EngagementData::GetEngagement(), wsf::cyber::Engagement::GetSimulation(), and simTime.
Referenced by CyberAttack(), and operator=().
|
protected |
Add effects and kick off each effect
References wsf::cyber::EngagementManager::EngagementData::AddEffect(), wsf::cyber::EngagementManager::EngagementData::GetEngagement(), wsf::cyber::Engagement::GetSimulation(), and simTime.
Referenced by CyberAttack(), and operator=().
|
protected |
Reset the attack failure reason from any previous attempts
Notify the observer that an attack has begun
No delivery delay. Immediately begin the attack
Model a delay for the delivery phase. Schedule the event and return to the attack algorithm upon completion
References wsf::cyber::EventManager::AddEvent(), wsf::cyber::VisualizationManager::AttackInitiated(), wsf::cyber::Event::cATTACK_DELAY, wsf::cyber::Engagement::cATTACK_NONE, CyberAttack(), WsfObserver::CyberAttackInitiated(), wsf::cyber::Constraint::Find(), wsf::cyber::SimulationExtension::Get(), wsf::cyber::VisualizationManager::Get(), wsf::cyber::SimulationExtension::GetCyberEventManager(), wsf::cyber::EngagementManager::EngagementData::GetEngagement(), and wsf::cyber::Engagement::Reset().
Referenced by CyberAttack(), and operator=().
|
protected |
References wsf::cyber::random::cFUTURE_IMMUNITY, WsfObserver::CyberAttackRecovery(), wsf::cyber::EngagementManager::EngagementData::GetEffect(), wsf::cyber::EngagementManager::EngagementData::GetEngagement(), wsf::cyber::Engagement::GetSimulation(), wsf::cyber::EngagementManager::EngagementData::RemoveEffects(), and simTime.
Referenced by CyberAttackDetectionDelay(), and operator=().
| bool wsf::cyber::EngagementManager::CyberScan | ( | const std::string & | aAttackType, |
| const std::string & | aAttacker, | ||
| const std::string & | aVictim, | ||
| WsfSimulation & | aSimulation ) |
Check the attack name for validity
Check that the target platform exists.
An engagement already exists for this attacker/victim/attack type combination. If a scan hasn't been attempted, or has and is now expired, then proceed with this scan. Otherwise, a scan is still in progress, and this call attempt will fail. Note: Clang warns about the comparison of floating point values here. This is, however, safe given the use of an internally consistent value for comparison that is not the result of computation and potential loss of precision.
No concurrent scan. Proceed with scan
A scan was previously requested by this attacker, and the time has not elapsed since the scan has resolved. We terminate any further processing for this request, and wait for the scheduled event to resolve. We still return true, however, as the request was valid and ongoing (from the perspective of the attacker)
No engagement exists. Create it, and begin scan
References AddEngagement(), CyberScanInitialize(), FindEngagementData(), wsf::cyber::ScenarioExtension::Get(), WsfSimulation::GetPlatformByName(), WsfSimulation::GetScenario(), and WsfSimulation::GetSimTime().
Referenced by CyberScanInitialize(), and operator=().
|
protected |
Determine if the victim is immune to this attack type
Determine if the victim detects the scan
If the scan is detected, it fails
Determine if the victim attributes the attacking platform
At this point, the scan is now successful.
References wsf::cyber::random::cSCAN_ATTRIBUTION, wsf::cyber::Engagement::cSCAN_DETECTED, wsf::cyber::random::cSCAN_DETECTION, wsf::cyber::Engagement::cSCAN_IMMUNITY, wsf::cyber::Engagement::cSCAN_NOT_VULNERABLE, WsfObserver::CyberScanAttributed(), WsfObserver::CyberScanDetected(), WsfObserver::CyberScanFailed(), WsfObserver::CyberScanSucceeded(), wsf::cyber::VisualizationManager::Get(), wsf::cyber::EngagementManager::EngagementData::GetEngagement(), wsf::cyber::Engagement::GetSimulation(), wsf::cyber::VisualizationManager::ScanFailed(), wsf::cyber::VisualizationManager::ScanSucceeded(), and simTime.
|
protected |
Notify the observer that a scan has begun
Reset the scan failure reason from any previous attempts
No delay. Immediately begin the scanning algorithm and record results in the engagement object
A delay is required. Schedule the event with the simulation to execute the scanning algorithm at the appropriate time
References wsf::cyber::EventManager::AddEvent(), wsf::cyber::Event::cSCAN_DELAY, wsf::cyber::Engagement::cSCAN_NONE, CyberScan(), WsfObserver::CyberScanInitiated(), wsf::cyber::SimulationExtension::Get(), wsf::cyber::VisualizationManager::Get(), wsf::cyber::SimulationExtension::GetCyberEventManager(), wsf::cyber::EngagementManager::EngagementData::GetEngagement(), wsf::cyber::Engagement::GetSimulation(), and wsf::cyber::VisualizationManager::ScanInitiated().
Referenced by CyberScan(), and operator=().
| bool wsf::cyber::EngagementManager::EngagementExists | ( | const std::string & | aAttackType, |
| const std::string & | aAttacker, | ||
| const std::string & | aVictim ) const |
References EngagementExists().
Referenced by EngagementExists(), and operator=().
| bool wsf::cyber::EngagementManager::EngagementExists | ( | size_t | aKey | ) | const |
| Engagement * wsf::cyber::EngagementManager::FindEngagement | ( | const std::string & | aAttackType, |
| const std::string & | aAttacker, | ||
| const std::string & | aVictim ) |
References FindEngagement().
Referenced by FindEngagement(), and operator=().
| Engagement * wsf::cyber::EngagementManager::FindEngagement | ( | size_t | aKey | ) |
References FindEngagementData().
|
protected |
Internal use only - wrapper for code reuse when searching for a victim or attacker by name.
Referenced by CullAttackerEngagements(), CullVictimEngagements(), and operator=().
|
protected |
References FindEngagementData().
Referenced by AddEngagement(), Cancel(), CyberAttack(), CyberScan(), FindEngagement(), FindEngagementData(), and operator=().
|
protected |
|
static |
Returns a modifiable instance of the cyber engagement manager.
References EngagementManager(), wsf::cyber::SimulationExtension::Get(), and wsf::cyber::SimulationExtension::GetCyberEngagementManager().
Referenced by Event, and wsf::cyber::Event::Execute().
|
delete |
References AddEngagement(), Cancel(), CullAttackerEngagements(), CullVictimEngagements(), CyberAttack(), CyberAttackDetectionDelay(), CyberAttackEffect(), CyberAttackInitialize(), CyberAttackRecoveryDelay(), CyberScan(), CyberScanInitialize(), EngagementExists(), EngagementManager(), FindEngagement(), FindEngagementByPlatform(), and FindEngagementData().
|
friend |
Allow the scheduled delay events to call the scan and attack methods when a delay is required. No other classes should have outside access to these methods
References EngagementManager(), Event, and Get().
Referenced by Event.