WSF
wsf::cyber::EngagementManager Class Reference

#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 EngagementManageroperator= (const EngagementManager &aRhs)=delete
EngagementFindEngagement (const std::string &aAttackType, const std::string &aAttacker, const std::string &aVictim)
EngagementFindEngagement (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 EngagementManagerGet (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.

Note
Once updated, the attack data exists for the lifetime of the engagement object. If any subsequent attacks are attempted by the same attacker/victim/attack type combination, the completion of that attack will clobber any previous results. (We could have something like an WsfCyberEngagementHistory class in the future that could log lightweight engagement data for unique attacker/victim/attack type combinations for later recall, if this is later determined to be necessary.)
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)
EngagementDataFindEngagementData (const std::string &aAttackType, const std::string &aAttacker, const std::string &aVictim)
EngagementDataFindEngagementData (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.

EngagementDataAddEngagement (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.

Note
Once updated, the scan data exists for the lifetime of the engagement object. If any subsequent scans are attempted by the same attacker/victim/attack type combination, the completion of that scan will clobber any previous results.
void CyberScanInitialize (EngagementData &aEngagementData)
void CyberScan (EngagementData &aEngagementData)

Member Typedef Documentation

◆ EngagementMap

using wsf::cyber::EngagementManager::EngagementMap = std::unordered_map<size_t, EngagementData>

Constructor & Destructor Documentation

◆ EngagementManager() [1/2]

wsf::cyber::EngagementManager::EngagementManager ( )
inline

Referenced by EngagementManager(), Event, Get(), and operator=().

◆ ~EngagementManager()

wsf::cyber::EngagementManager::~EngagementManager ( )
default

◆ EngagementManager() [2/2]

wsf::cyber::EngagementManager::EngagementManager ( const EngagementManager & aSrc)
delete

References EngagementManager().

Member Function Documentation

◆ AddEngagement()

EngagementManager::EngagementData & wsf::cyber::EngagementManager::AddEngagement ( const std::string & aAttackType,
const std::string & aAttacker,
const std::string & aVictim,
WsfSimulation & aSimulation )
protected

References FindEngagementData().

Referenced by CyberAttack(), CyberScan(), and operator=().

◆ Cancel()

bool wsf::cyber::EngagementManager::Cancel ( size_t aKey)

◆ CullAttackerEngagements()

void wsf::cyber::EngagementManager::CullAttackerEngagements ( const std::string & aAttacker)

References FindEngagementByPlatform().

Referenced by operator=().

◆ CullVictimEngagements()

void wsf::cyber::EngagementManager::CullVictimEngagements ( const std::string & aVictim)

References FindEngagementByPlatform().

Referenced by operator=().

◆ CyberAttack() [1/2]

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=().

◆ CyberAttack() [2/2]

void wsf::cyber::EngagementManager::CyberAttack ( EngagementData & aEngagementData)
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.

◆ CyberAttackDetectionDelay()

◆ CyberAttackEffect()

void wsf::cyber::EngagementManager::CyberAttackEffect ( EngagementData & aEngagementData)
protected

◆ CyberAttackInitialize()

void wsf::cyber::EngagementManager::CyberAttackInitialize ( EngagementData & aEngagementData)
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=().

◆ CyberAttackRecoveryDelay()

◆ CyberScan() [1/2]

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=().

◆ CyberScan() [2/2]

◆ CyberScanInitialize()

void wsf::cyber::EngagementManager::CyberScanInitialize ( EngagementData & aEngagementData)
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=().

◆ EngagementExists() [1/2]

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=().

◆ EngagementExists() [2/2]

bool wsf::cyber::EngagementManager::EngagementExists ( size_t aKey) const

◆ FindEngagement() [1/2]

Engagement * wsf::cyber::EngagementManager::FindEngagement ( const std::string & aAttackType,
const std::string & aAttacker,
const std::string & aVictim )

References FindEngagement().

Referenced by FindEngagement(), and operator=().

◆ FindEngagement() [2/2]

Engagement * wsf::cyber::EngagementManager::FindEngagement ( size_t aKey)

References FindEngagementData().

◆ FindEngagementByPlatform()

EngagementManager::EngagementMap::iterator wsf::cyber::EngagementManager::FindEngagementByPlatform ( const std::string & aName,
bool aByVictim )
protected

Internal use only - wrapper for code reuse when searching for a victim or attacker by name.

Referenced by CullAttackerEngagements(), CullVictimEngagements(), and operator=().

◆ FindEngagementData() [1/2]

EngagementManager::EngagementData * wsf::cyber::EngagementManager::FindEngagementData ( const std::string & aAttackType,
const std::string & aAttacker,
const std::string & aVictim )
protected

◆ FindEngagementData() [2/2]

EngagementManager::EngagementData * wsf::cyber::EngagementManager::FindEngagementData ( size_t aKey)
protected

◆ Get()

EngagementManager & wsf::cyber::EngagementManager::Get ( WsfSimulation & aSimulation)
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().

◆ operator=()

◆ Event

friend class Event
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.


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved