你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Alerts - List For Scope

获取资源范围的警报。

GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleManagementAlerts?api-version=2022-08-01-preview

URI 参数

名称 必需 类型 说明
scope
path True

string

警报的范围。

api-version
query True

string

要用于此操作的 API 版本。

响应

名称 类型 说明
200 OK

AlertListResult

正常 - 返回警报数组。

Other Status Codes

CloudError

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

GetAlerts

示例请求

GET https://management.azure.com/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlerts?api-version=2022-08-01-preview

示例响应

{
  "value": [
    {
      "properties": {
        "scope": "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f",
        "incidentCount": 1,
        "lastModifiedDateTime": "2022-04-05T03:04:06.467+00:00",
        "lastScannedDateTime": "2022-04-06T18:25:00.38+00:00",
        "isActive": true,
        "alertDefinition": {
          "properties": {
            "displayName": "Too many permanent owners assigned to a resource",
            "scope": "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f",
            "description": "The number of users set to never expire is too high. To enhance the security of your resources, we recommend requiring activation for role use. Take a moment to review the list of users, and suggested changes here.",
            "severityLevel": "Medium",
            "securityImpact": "Providing users permanent access in a role may leave resources vulnerable to accidental or malicious activity.",
            "mitigationSteps": "To mitigate this issue, require the user to activate the role before use.",
            "howToPrevent": "Enable “Activation Required” in the role settings menu. This will ensure newly added users must activate their role.",
            "isRemediatable": true,
            "isConfigurable": true
          },
          "name": "TooManyPermanentOwnersAssignedToResource",
          "id": "/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlertDefinitions/TooManyPermanentOwnersAssignedToResource",
          "type": "Microsoft.Authorization/roleManagementAlertDefinitions"
        },
        "alertIncidents": [
          {
            "properties": {
              "alertIncidentType": "TooManyPermanentOwnersAssignedToResourceAlertIncident",
              "assigneeName": "testUser",
              "assigneeType": "User"
            },
            "name": "a9f38501-74ec-43ea-8663-6c538602150d",
            "type": "Microsoft.Authorization/roleManagementAlerts/alertIncidents",
            "id": "/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlerts/TooManyPermanentOwnersAssignedToResource/alertIncidents/a9f38501-74ec-43ea-8663-6c538602150d"
          }
        ],
        "alertConfiguration": {
          "properties": {
            "alertConfigurationType": "TooManyPermanentOwnersAssignedToResourceAlertConfiguration",
            "alertDefinitionId": "TooManyPermanentOwnersAssignedToResource",
            "scope": "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f",
            "isEnabled": true,
            "thresholdNumberOfPermanentOwners": 10,
            "thresholdPercentageOfPermanentOwnersOutOfAllOwners": 10
          },
          "name": "TooManyPermanentOwnersAssignedToResource",
          "id": "/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlertConfigurations/TooManyPermanentOwnersAssignedToResource",
          "type": "Microsoft.Authorization/roleManagementAlertConfigurations"
        }
      },
      "name": "TooManyPermanentOwnersAssignedToResource",
      "id": "/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlerts/TooManyPermanentOwnersAssignedToResource",
      "type": "Microsoft.Authorization/roleManagementAlerts"
    },
    {
      "properties": {
        "scope": "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f",
        "incidentCount": 1,
        "lastModifiedDateTime": "2022-04-05T03:04:06.467+00:00",
        "lastScannedDateTime": "2022-04-06T18:25:00.38+00:00",
        "isActive": true,
        "alertDefinition": {
          "properties": {
            "displayName": "Too many owners assigned to a resource",
            "scope": "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f",
            "description": "The number of users with the Owner role is too high. We recommend assigning these individuals to less privileged roles or roles more suitable to their daily needs. Take a moment to review the current assignments, and suggested changes here.",
            "severityLevel": "Medium",
            "securityImpact": "As the number of users with the owner role increases, so does the potential for malicious or mistaken actions affecting your resource.",
            "mitigationSteps": "To mitigate this issue, reduce the number of users in the Owner role. Review the list of users in the list, and reassign them to a less privileged role such as Contributor.",
            "howToPrevent": "Choose a role that provides the fewest privileges necessary for a user or group to complete their tasks.",
            "isRemediatable": true,
            "isConfigurable": true
          },
          "name": "TooManyOwnersAssignedToResource",
          "id": "/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlertDefinitions/TooManyOwnersAssignedToResource",
          "type": "Microsoft.Authorization/roleManagementAlertDefinitions"
        },
        "alertIncidents": [
          {
            "properties": {
              "alertIncidentType": "TooManyOwnersAssignedToResourceAlertIncident",
              "assigneeName": "testUser",
              "assigneeType": "User"
            },
            "name": "a9f38501-74ec-43ea-8663-6c538602150d",
            "type": "Microsoft.Authorization/roleManagementAlerts/alertIncidents",
            "id": "/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlerts/TooManyOwnersAssignedToResource/alertIncidents/a9f38501-74ec-43ea-8663-6c538602150d"
          }
        ],
        "alertConfiguration": {
          "properties": {
            "alertConfigurationType": "TooManyOwnersAssignedToResourceAlertConfiguration",
            "alertDefinitionId": "TooManyOwnersAssignedToResource",
            "scope": "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f",
            "isEnabled": true,
            "thresholdNumberOfOwners": 2,
            "thresholdPercentageOfOwnersOutOfAllRoleMembers": 3
          },
          "name": "TooManyOwnersAssignedToResource",
          "id": "/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlertConfigurations/TooManyOwnersAssignedToResource",
          "type": "Microsoft.Authorization/roleManagementAlertConfigurations"
        }
      },
      "name": "TooManyOwnersAssignedToResource",
      "id": "/subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleManagementAlerts/TooManyOwnersAssignedToResource",
      "type": "Microsoft.Authorization/roleManagementAlerts"
    }
  ]
}

定义

名称 说明
Alert

警报。

AlertConfiguration

警报配置。

AlertDefinition

警报定义

AlertIncident

警报事件

AlertListResult

警报列表操作结果。

CloudError

来自服务的错误响应。

CloudErrorBody

来自服务的错误响应。

SeverityLevel

警报的严重级别。

Alert

警报。

名称 类型 说明
id

string

警报 ID。

name

string

警报名称。

properties.alertConfiguration

AlertConfiguration

警报配置。

properties.alertDefinition

AlertDefinition

警报定义。

properties.alertIncidents

AlertIncident[]

警报事件。

properties.incidentCount

integer

警报生成的事件数。

properties.isActive

boolean

默认情况下为 False;如果警报处于活动状态,则为 true。

properties.lastModifiedDateTime

string

更新警报配置或生成新事件的日期时间。

properties.lastScannedDateTime

string

上次扫描警报的日期时间。

properties.scope

string

警报范围。

type

string

警报类型。

AlertConfiguration

警报配置。

名称 类型 说明
id

string

警报配置 ID。

name

string

警报配置名称。

properties.alertConfigurationType

string

警报配置类型。

properties.alertDefinition

AlertDefinition

警报定义。

properties.alertDefinitionId

string

警报定义 ID。

properties.isEnabled

boolean

如果启用警报,则为 True,false 将禁用对特定警报的扫描。

properties.scope

string

警报范围。

type

string

警报配置类型。

AlertDefinition

警报定义

名称 类型 说明
id

string

警报定义 ID。

name

string

警报定义名称。

properties.description

string

警报说明。

properties.displayName

string

警报显示名称。

properties.howToPrevent

string

防止警报的方法。

properties.isConfigurable

boolean

如果可以配置警报配置,则为 True;否则为 false。

properties.isRemediatable

boolean

如果可以修正警报,则为 True;否则为 false。

properties.mitigationSteps

string

缓解警报的方法。

properties.scope

string

警报范围。

properties.securityImpact

string

警报的安全影响。

properties.severityLevel

SeverityLevel

警报的严重级别。

type

string

警报定义类型。

AlertIncident

警报事件

名称 类型 说明
id

string

警报事件 ID。

name

string

警报事件名称。

properties.alertIncidentType

string

警报事件类型。

type

string

警报事件类型。

AlertListResult

警报列表操作结果。

名称 类型 说明
nextLink

string

用于获取下一组结果的 URL。

value

Alert[]

警报列表

CloudError

来自服务的错误响应。

名称 类型 说明
error

CloudErrorBody

来自服务的错误响应。

CloudErrorBody

来自服务的错误响应。

名称 类型 说明
code

string

错误的标识符。 代码是固定的,旨在以编程方式使用。

message

string

描述错误的消息,该消息适用于在用户界面中显示。

SeverityLevel

警报的严重级别。

名称 类型 说明
High

string

Low

string

Medium

string