class Simulation
Represents an attack simulation training campaign in Microsoft Defender for Office 365, providing access to phishing simulation exercises and training reports.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/security/attacksimulations/simulation.py
5 - 23
simple
Purpose
This class models an attack simulation training campaign within a Microsoft 365 tenant. It is part of Microsoft Defender for Office 365's security training service that allows administrators to conduct benign phishing simulations, assign security trainings, and analyze user behavior to identify security knowledge gaps. The class provides access to simulation reports and insights about user susceptibility to phishing attacks, enabling administrators to improve organizational security awareness.
Source Code
class Simulation(Entity):
"""
Represents an attack simulation training campaign in a tenant.
Attack simulation and training is a service available as part of Microsoft Defender for Office 365.
This service lets tenant users experience a realistic benign phishing attack and learn from it.
The service enables tenant administrators to simulate, assign trainings, and read derived insights into online
behaviors of users in the phishing simulations. The service provides attack simulation reports that help tenants
identify security knowledge gaps, so that they can further train their users to decrease their susceptibility
to attacks.
The attack simulation and training API enables tenant administrators to list launched simulation exercises
and trainings, and get reports on derived insights into online behaviors of users in the phishing simulations.
"""
@property
def report(self):
"""Report of the attack simulation and training campaign."""
return self.properties.get("report", SimulationReport())
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
Entity | - |
Parameter Details
__init__: Inherits constructor from Entity base class. The exact parameters depend on the Entity parent class implementation, but typically includes entity identification and properties dictionary for storing entity data.
Return Value
Instantiation returns a Simulation object representing an attack simulation campaign. The report property returns a SimulationReport object containing insights and metrics from the simulation campaign, or an empty SimulationReport() if no report data exists.
Class Interface
Methods
@property report(self) -> SimulationReport
property
Purpose: Retrieves the attack simulation and training campaign report containing insights and metrics about user behavior during the simulation
Returns: SimulationReport object containing the simulation campaign report data, or an empty SimulationReport() if no report exists in the properties
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
properties |
dict | Inherited from Entity base class. Dictionary storing the entity's data including the report information. Accessed via the report property. | instance |
Dependencies
office365.directory.security.attacksimulations.reportoffice365.entity
Required Imports
from office365.directory.security.attacksimulations.report import SimulationReport
from office365.entity import Entity
Usage Example
# Assuming Entity base class is properly configured with API connection
from office365.directory.security.attacksimulations.simulation import Simulation
from office365.directory.security.attacksimulations.report import SimulationReport
# Instantiate a simulation object (typically retrieved from API)
simulation = Simulation()
# Access the simulation report
report = simulation.report
# The report object contains insights about the simulation campaign
if report:
# Process report data (specific methods depend on SimulationReport implementation)
pass
Best Practices
- This class inherits from Entity, so ensure the Entity base class is properly initialized with required authentication and API connection details
- The report property returns an empty SimulationReport() if no report data exists in properties, so check for actual data before processing
- This class is typically instantiated through API calls rather than direct construction, as it represents data retrieved from Microsoft 365 services
- Ensure appropriate API permissions are configured in the Microsoft 365 tenant before attempting to access simulation data
- The properties dictionary (inherited from Entity) stores the underlying data; the report property is a convenience accessor
- This is a read-only representation of simulation data; modifications should be done through appropriate API calls
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class AttackSimulationRoot 83.6% similar
-
class SimulationAutomationRun 75.6% similar
-
class SimulationAutomation 74.3% similar
-
class AttackSimulationRepeatOffender 72.9% similar
-
class SimulationReport 72.7% similar