更新模拟

命名空间:microsoft.graph

更新租户的攻击模拟活动。

此 API 可用于以下国家级云部署

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国

权限

为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) AttackSimulation.ReadWrite.All 不可用。
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 AttackSimulation.ReadWrite.All 不可用。

HTTP 请求

PATCH /security/attackSimulation/simulations/{simulationId}

请求标头

标头
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权
Content-Type application/json

请求正文

在请求正文中,提供应更新的属性的值。 请求正文中未包含的现有属性会保留其以前的值,或者根据对其他属性值的更改重新计算。

下表指定可更新的属性。

属性 类型 说明
attackTechnique simulationAttackTechnique 用于攻击模拟和训练运动的社会工程技术。 支持 $filter$orderby。 可取值为:unknowncredentialHarvestingattachmentMalwaredriveByUrllinkInAttachmentlinkToMalwareFileunknownFutureValueoAuthConsentGrant。 请注意,必须使用 Prefer: include-unknown-enum-members 请求标头从此 可演变枚举中获取以下值: oAuthConsentGrant。 有关社会工程攻击技术类型的详细信息,请参阅 模拟
attackType simulationAttackType 攻击模拟和训练活动的攻击类型。 支持 $filter$orderby。 可取值为:unknownsocialcloudendpointunknownFutureValue
displayName String 攻击模拟和训练活动的显示名称。 支持 $filter$orderby
durationInDays Int32 模拟持续时间(天)。
excludedAccountTarget accountTargetContent 从模拟中排除的用户。
includedAccountTarget accountTargetContent 模拟中面向的用户。
payload 负载 与模拟关联的有效负载。
status simulationStatus 攻击模拟和训练活动的状态。 支持 $filter$orderby。 可取值为:unknowndraftrunningscheduledsucceededfailedcancelledexcludedunknownFutureValue

响应

如果成功,此方法将 202 Accepted 返回响应代码和响应中名为 location 的跟踪标头。

示例

示例 1:更新攻击模拟活动

以下示例演示如何更新租户的攻击模拟活动。

请求

以下示例显示了一个请求。

PATCH https://graph.microsoft.com/v1.0/security/attackSimulation/simulations/2f5548d1-0dd8-4cc8-9de0-e0d6ec7ea3dc
Content-type: application/json

{
  "@odata.etag": "\"0100aa9b-0000-0100-0000-6396fa270000\"",
  "displayName": "Graph Simulation",
  "payload@odata.bind":"https://graph.microsoft.com/v1.0/security/attacksimulation/payloads/12345678-9abc-def0-123456789a",
  "durationInDays": 7,
  "attackTechnique": "credentialHarvesting",
  "attackType": "social",
  "status": "scheduled",
  "includedAccountTarget": {
    "@odata.type": "#microsoft.graph.addressBookAccountTargetContent",
    "type" : "addressBook",
    "accountTargetEmails" : [
        "faiza@contoso.com"
    ]
  },
  "excludedAccountTarget": {
    "@odata.type": "#microsoft.graph.addressBookAccountTargetContent",
    "type" : "addressBook",
    "accountTargetEmails" : [
        "sam@contoso.com"
    ]
  }
}

响应

以下示例显示了相应的响应。

HTTP/1.1 202 Accepted

示例 2:将攻击模拟活动从草稿更新为计划

以下示例演示如何计划攻击模拟活动。 在计划模拟时验证模拟请求。 所有必需的参数都需要在此类请求中传播。

请求

以下示例显示了一个请求。

PATCH https://graph.microsoft.com/v1.0/security/attackSimulation/simulations/2f5548d1-0dd8-4cc8-9de0-e0d6ec7ea3dc
Content-type: application/json

{
  "@odata.etag": "\"0100aa9b-0000-0100-0000-6396fa270000\"",
  "id": "2f5548d1-0dd8-4cc8-9de0-e0d6ec7ea3dc",
  "displayName": "Graph Simulation",
  "payload@odata.bind":"https://graph.microsoft.com/v1.0/security/attacksimulation/payloads/12345678-9abc-def0-123456789a",
  "durationInDays": 7,
  "attackTechnique": "credentialHarvesting",
  "attackType": "social",
  "status": "scheduled",
  "includedAccountTarget": {
    "@odata.type": "#microsoft.graph.addressBookAccountTargetContent",
    "type" : "addressBook",
    "accountTargetEmails" : [
        "faiza@contoso.com"
    ]
  },
  "excludedAccountTarget": {
    "@odata.type": "#microsoft.graph.addressBookAccountTargetContent",
    "type" : "addressBook",
    "accountTargetEmails" : [
        "sam@contoso.com"
    ]
  }
}

响应

以下示例显示了相应的响应。

HTTP/1.1 202 Accepted

示例 3:取消攻击模拟活动

以下示例演示如何取消租户的攻击模拟活动。 当模拟状态为 scheduledrunning时,可以取消模拟。

请求

以下示例显示了一个请求。

PATCH https://graph.microsoft.com/v1.0/security/attackSimulation/simulations/2f5548d1-0dd8-4cc8-9de0-e0d6ec7ea3dc
Content-type: application/json

{
  "@odata.etag": "\"0100aa9b-0000-0100-0000-6396fa270000\"",
  "id": "2f5548d1-0dd8-4cc8-9de0-e0d6ec7ea3dc",
  "status": "cancelled"
}

响应

以下示例显示了相应的响应。

HTTP/1.1 202 Accepted

示例 4:排除攻击模拟活动

以下示例演示如何排除租户的攻击模拟活动。 当模拟状态为 cancelled时,只能从任何报表中排除模拟。

请求

以下示例显示了一个请求。

PATCH https://graph.microsoft.com/v1.0/security/attackSimulation/simulations/2f5548d1-0dd8-4cc8-9de0-e0d6ec7ea3dc
Content-type: application/json

{
  "@odata.etag": "\"0100aa9b-0000-0100-0000-6396fa270000\"",
  "id": "2f5548d1-0dd8-4cc8-9de0-e0d6ec7ea3dc",
  "status": "excluded"
}

响应

以下示例显示了相应的响应。

HTTP/1.1 202 Accepted