Partilhar via


Alerts - List For Scope

Obtém alertas para um escopo de recurso.

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

Parâmetros do URI

Name Em Necessário Tipo Description
scope
path True

string

O âmbito do alerta.

api-version
query True

string

minLength: 1

A versão da API a ser usada para esta operação.

Respostas

Name Tipo Description
200 OK

AlertListResult

OK - Retorna uma matriz de alertas.

Other Status Codes

CloudError

Resposta de erro descrevendo por que a operação falhou.

Segurança

azure_auth

Azure Ative Directory OAuth2 Flow

Tipo: oauth2
Fluxo: implicit
URL de Autorização: https://login.microsoftonline.com/common/oauth2/authorize

Âmbitos

Name Description
user_impersonation personificar a sua conta de utilizador

Exemplos

GetAlerts

Pedido de amostra

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

Resposta da amostra

{
  "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"
    }
  ]
}

Definições

Name Description
Alert

O alerta.

AlertConfiguration

Configuração de alerta.

AlertDefinition

Definição de alerta

AlertIncident

Incidente de alerta

AlertListResult

Resultado da operação da lista de alertas.

CloudError

Uma resposta de erro do serviço.

CloudErrorBody

Uma resposta de erro do serviço.

SeverityLevel

Nível de gravidade do alerta.

Alert

O alerta.

Name Tipo Description
id

string

O ID do alerta.

name

string

O nome do alerta.

properties.alertConfiguration

AlertConfiguration

A configuração do alerta.

properties.alertDefinition

AlertDefinition

A definição de alerta.

properties.alertIncidents

AlertIncident[]

Os incidentes de alerta.

properties.incidentCount

integer (int32)

O número de incidentes gerados do alerta.

properties.isActive

boolean

Falso por padrão; true se o alerta estiver ativo.

properties.lastModifiedDateTime

string (date-time)

A data em que a configuração do alerta foi atualizada ou novos incidentes foram gerados.

properties.lastScannedDateTime

string (date-time)

A data em que o alerta foi verificado pela última vez.

properties.scope

string

O escopo do alerta.

type

string

O tipo de alerta.

AlertConfiguration

Configuração de alerta.

Name Tipo Description
id

string

O ID de configuração do alerta.

name

string

O nome da configuração do alerta.

properties.alertConfigurationType

string

O tipo de configuração de alerta.

properties.alertDefinition

AlertDefinition

A definição de alerta.

properties.alertDefinitionId

string

O ID da definição de alerta.

properties.isEnabled

boolean

True se o alerta estiver ativado, false desativará a verificação do alerta específico.

properties.scope

string

O escopo do alerta.

type

string

O tipo de configuração de alerta.

AlertDefinition

Definição de alerta

Name Tipo Description
id

string

O ID da definição de alerta.

name

string

O nome da definição de alerta.

properties.description

string

A descrição do alerta.

properties.displayName

string

O nome de exibição do alerta.

properties.howToPrevent

string

As formas de evitar o alerta.

properties.isConfigurable

boolean

True se a configuração de alerta puder ser configurada; falso, caso contrário.

properties.isRemediatable

boolean

True se o alerta puder ser corrigido; falso, caso contrário.

properties.mitigationSteps

string

Os métodos para mitigar o alerta.

properties.scope

string

O escopo do alerta.

properties.securityImpact

string

Impacto do alerta na segurança.

properties.severityLevel

SeverityLevel

Nível de gravidade do alerta.

type

string

O tipo de definição de alerta.

AlertIncident

Incidente de alerta

Name Tipo Description
id

string

A ID do incidente de alerta.

name

string

O nome do incidente de alerta.

properties.alertIncidentType

string

O tipo de incidente de alerta.

type

string

O tipo de incidente de alerta.

AlertListResult

Resultado da operação da lista de alertas.

Name Tipo Description
nextLink

string

A URL a ser usada para obter o próximo conjunto de resultados.

value

Alert[]

Lista de alertas

CloudError

Uma resposta de erro do serviço.

Name Tipo Description
error

CloudErrorBody

Uma resposta de erro do serviço.

CloudErrorBody

Uma resposta de erro do serviço.

Name Tipo Description
code

string

Um identificador para o erro. Os códigos são invariantes e destinam-se a ser consumidos programaticamente.

message

string

Uma mensagem descrevendo o erro, destinada a ser adequada para exibição em uma interface do usuário.

SeverityLevel

Nível de gravidade do alerta.

Valor Description
Low
Medium
High