Compartilhar via


Device Security Groups - Create Or Update

Use esse método para criar ou atualizar o grupo de segurança do dispositivo em um recurso especificado do Hub IoT.

PUT https://management.azure.com/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}?api-version=2019-08-01

Parâmetros de URI

Nome Em Obrigatório Tipo Description
deviceSecurityGroupName
path True

string

O nome do grupo de segurança do dispositivo. Observe que o nome do grupo de segurança do dispositivo não diferencia maiúsculas de minúsculas.

resourceId
path True

string

O identificador do recurso.

api-version
query True

string

Versão da API para a operação

Corpo da solicitação

Nome Tipo Description
properties.allowlistRules

AllowlistCustomAlertRule[]

As regras de alerta personalizadas da lista de permissões.

properties.denylistRules

DenylistCustomAlertRule[]

As regras de alerta personalizadas da lista de negação.

properties.thresholdRules

ThresholdCustomAlertRule[]

A lista de regras de limite de alerta personalizadas.

properties.timeWindowRules

TimeWindowCustomAlertRule[]

A lista de regras personalizadas da janela de tempo de alerta.

Respostas

Nome Tipo Description
200 OK

DeviceSecurityGroup

O grupo de segurança foi atualizado.

201 Created

DeviceSecurityGroup

O grupo de segurança foi criado.

Other Status Codes

CloudError

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

Segurança

azure_auth

Fluxo OAuth2 do Azure Active Directory

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

Escopos

Nome Description
user_impersonation representar sua conta de usuário

Exemplos

Create or update a device security group for the specified IoT hub resource

Solicitação de exemplo

PUT https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup?api-version=2019-08-01

{
  "properties": {
    "timeWindowRules": [
      {
        "ruleType": "ActiveConnectionsNotInAllowedRange",
        "isEnabled": true,
        "minThreshold": 0,
        "maxThreshold": 30,
        "timeWindowSize": "PT05M"
      }
    ]
  }
}

Resposta de exemplo

{
  "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup",
  "name": "samplesecuritygroup",
  "type": "Microsoft.Security/deviceSecurityGroups",
  "properties": {
    "thresholdRules": [],
    "timeWindowRules": [
      {
        "ruleType": "ActiveConnectionsNotInAllowedRange",
        "displayName": "Number of active connections is not in allowed range",
        "description": "Get an alert when the number of active connections of a device in the time window is not in the allowed range",
        "isEnabled": true,
        "minThreshold": 0,
        "maxThreshold": 30,
        "timeWindowSize": "PT05M"
      },
      {
        "ruleType": "AmqpC2DMessagesNotInAllowedRange",
        "displayName": "Number of cloud to device messages (AMQP protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "MqttC2DMessagesNotInAllowedRange",
        "displayName": "Number of cloud to device messages (MQTT protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "HttpC2DMessagesNotInAllowedRange",
        "displayName": "Number of cloud to device messages (HTTP protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "AmqpC2DRejectedMessagesNotInAllowedRange",
        "displayName": "Number of rejected cloud to device messages (AMQP protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "MqttC2DRejectedMessagesNotInAllowedRange",
        "displayName": "Number of rejected cloud to device messages (MQTT protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "HttpC2DRejectedMessagesNotInAllowedRange",
        "displayName": "Number of rejected cloud to device messages (HTTP protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "AmqpD2CMessagesNotInAllowedRange",
        "displayName": "Number of device to cloud messages (AMQP protocol) is not in allowed range",
        "description": "Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "MqttD2CMessagesNotInAllowedRange",
        "displayName": "Number of device to cloud messages (MQTT protocol) is not in allowed range",
        "description": "Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "HttpD2CMessagesNotInAllowedRange",
        "displayName": "Number of device to cloud messages (HTTP protocol) is not in allowed range",
        "description": "Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "DirectMethodInvokesNotInAllowedRange",
        "displayName": "Number of direct method invokes is not in allowed range",
        "description": "Get an alert when the number of direct method invokes in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "FailedLocalLoginsNotInAllowedRange",
        "displayName": "Number of failed local logins is not in allowed range",
        "description": "Get an alert when the number of failed local logins on the device in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "FileUploadsNotInAllowedRange",
        "displayName": "Number of file uploads is not in allowed range",
        "description": "Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "QueuePurgesNotInAllowedRange",
        "displayName": "Number of device queue purges is not in allowed range",
        "description": "Get an alert when the number of device queue purges in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "TwinUpdatesNotInAllowedRange",
        "displayName": "Number of twin updates is not in allowed range",
        "description": "Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "UnauthorizedOperationsNotInAllowedRange",
        "displayName": "Number of unauthorized operations is not in allowed range",
        "description": "Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      }
    ],
    "allowlistRules": [
      {
        "ruleType": "ConnectionToIpNotAllowed",
        "displayName": "Outbound connection to an ip that isn't allowed",
        "description": "Get an alert when an outbound connection is created between your device and an ip that isn't allowed",
        "isEnabled": false,
        "allowlistValues": []
      },
      {
        "ruleType": "LocalUserNotAllowed",
        "displayName": "Login by a local user that isn't allowed",
        "description": "Get an alert when a local user that isn't allowed logins to the device",
        "isEnabled": false,
        "allowlistValues": []
      },
      {
        "ruleType": "ProcessNotAllowed",
        "displayName": "Execution of a process that isn't allowed",
        "description": "Get an alert when a process that isn't allowed is executed",
        "isEnabled": false,
        "allowlistValues": []
      }
    ],
    "denylistRules": []
  }
}
{
  "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup",
  "name": "samplesecuritygroup",
  "type": "Microsoft.Security/deviceSecurityGroups",
  "properties": {
    "thresholdRules": [],
    "timeWindowRules": [
      {
        "ruleType": "ActiveConnectionsNotInAllowedRange",
        "displayName": "Number of active connections is not in allowed range",
        "description": "Get an alert when the number of active connections of a device in the time window is not in the allowed range",
        "isEnabled": true,
        "minThreshold": 0,
        "maxThreshold": 30,
        "timeWindowSize": "PT05M"
      },
      {
        "ruleType": "AmqpC2DMessagesNotInAllowedRange",
        "displayName": "Number of cloud to device messages (AMQP protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "MqttC2DMessagesNotInAllowedRange",
        "displayName": "Number of cloud to device messages (MQTT protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "HttpC2DMessagesNotInAllowedRange",
        "displayName": "Number of cloud to device messages (HTTP protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "AmqpC2DRejectedMessagesNotInAllowedRange",
        "displayName": "Number of rejected cloud to device messages (AMQP protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "MqttC2DRejectedMessagesNotInAllowedRange",
        "displayName": "Number of rejected cloud to device messages (MQTT protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "HttpC2DRejectedMessagesNotInAllowedRange",
        "displayName": "Number of rejected cloud to device messages (HTTP protocol) is not in allowed range",
        "description": "Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "AmqpD2CMessagesNotInAllowedRange",
        "displayName": "Number of device to cloud messages (AMQP protocol) is not in allowed range",
        "description": "Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "MqttD2CMessagesNotInAllowedRange",
        "displayName": "Number of device to cloud messages (MQTT protocol) is not in allowed range",
        "description": "Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "HttpD2CMessagesNotInAllowedRange",
        "displayName": "Number of device to cloud messages (HTTP protocol) is not in allowed range",
        "description": "Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "DirectMethodInvokesNotInAllowedRange",
        "displayName": "Number of direct method invokes is not in allowed range",
        "description": "Get an alert when the number of direct method invokes in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "FailedLocalLoginsNotInAllowedRange",
        "displayName": "Number of failed local logins is not in allowed range",
        "description": "Get an alert when the number of failed local logins on the device in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "FileUploadsNotInAllowedRange",
        "displayName": "Number of file uploads is not in allowed range",
        "description": "Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "QueuePurgesNotInAllowedRange",
        "displayName": "Number of device queue purges is not in allowed range",
        "description": "Get an alert when the number of device queue purges in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "TwinUpdatesNotInAllowedRange",
        "displayName": "Number of twin updates is not in allowed range",
        "description": "Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      },
      {
        "ruleType": "UnauthorizedOperationsNotInAllowedRange",
        "displayName": "Number of unauthorized operations is not in allowed range",
        "description": "Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error",
        "isEnabled": false,
        "minThreshold": 0,
        "maxThreshold": 0,
        "timeWindowSize": "PT15M"
      }
    ],
    "allowlistRules": [
      {
        "ruleType": "ConnectionToIpNotAllowed",
        "displayName": "Outbound connection to an ip that isn't allowed",
        "description": "Get an alert when an outbound connection is created between your device and an ip that isn't allowed",
        "isEnabled": false,
        "allowlistValues": []
      },
      {
        "ruleType": "LocalUserNotAllowed",
        "displayName": "Login by a local user that isn't allowed",
        "description": "Get an alert when a local user that isn't allowed logins to the device",
        "isEnabled": false,
        "allowlistValues": []
      },
      {
        "ruleType": "ProcessNotAllowed",
        "displayName": "Execution of a process that isn't allowed",
        "description": "Get an alert when a process that isn't allowed is executed",
        "isEnabled": false,
        "allowlistValues": []
      }
    ],
    "denylistRules": []
  }
}

Definições

Nome Description
AllowlistCustomAlertRule

Uma regra de alerta personalizada que verifica se um valor (depende do tipo de alerta personalizado) é permitido.

CloudError

Resposta de erro comum para todas as APIs do Azure Resource Manager retornarem detalhes de erro para operações com falha. (Isso também segue o formato de resposta de erro OData.).

CloudErrorBody

O detalhe do erro.

DenylistCustomAlertRule

Uma regra de alerta personalizada que verifica se um valor (depende do tipo de alerta personalizado) é negado.

DeviceSecurityGroup

O recurso de grupo de segurança do dispositivo

ErrorAdditionalInfo

As informações adicionais do erro de gerenciamento de recursos.

ThresholdCustomAlertRule

Uma regra de alerta personalizada que verifica se um valor (depende do tipo de alerta personalizado) está dentro do intervalo determinado.

TimeWindowCustomAlertRule

Uma regra de alerta personalizada que verifica se o número de atividades (depende do tipo de alerta personalizado) em uma janela de tempo está dentro do intervalo determinado.

valueType

O tipo de valor dos itens na lista.

AllowlistCustomAlertRule

Uma regra de alerta personalizada que verifica se um valor (depende do tipo de alerta personalizado) é permitido.

Nome Tipo Description
allowlistValues

string[]

Os valores a serem permitidos. O formato dos valores depende do tipo de regra.

description

string

A descrição do alerta personalizado.

displayName

string

O nome de exibição do alerta personalizado.

isEnabled

boolean

Status do alerta personalizado.

ruleType

string

O tipo da regra de alerta personalizada.

valueType

valueType

O tipo de valor dos itens na lista.

CloudError

Resposta de erro comum para todas as APIs do Azure Resource Manager retornarem detalhes de erro para operações com falha. (Isso também segue o formato de resposta de erro OData.).

Nome Tipo Description
error.additionalInfo

ErrorAdditionalInfo[]

As informações adicionais do erro.

error.code

string

O código de erro.

error.details

CloudErrorBody[]

Os detalhes do erro.

error.message

string

A mensagem de erro.

error.target

string

O destino do erro.

CloudErrorBody

O detalhe do erro.

Nome Tipo Description
additionalInfo

ErrorAdditionalInfo[]

As informações adicionais do erro.

code

string

O código de erro.

details

CloudErrorBody[]

Os detalhes do erro.

message

string

A mensagem de erro.

target

string

O destino do erro.

DenylistCustomAlertRule

Uma regra de alerta personalizada que verifica se um valor (depende do tipo de alerta personalizado) é negado.

Nome Tipo Description
denylistValues

string[]

Os valores a negar. O formato dos valores depende do tipo de regra.

description

string

A descrição do alerta personalizado.

displayName

string

O nome de exibição do alerta personalizado.

isEnabled

boolean

Status do alerta personalizado.

ruleType

string

O tipo da regra de alerta personalizada.

valueType

valueType

O tipo de valor dos itens na lista.

DeviceSecurityGroup

O recurso de grupo de segurança do dispositivo

Nome Tipo Description
id

string

ID do recurso

name

string

Nome do recurso

properties.allowlistRules

AllowlistCustomAlertRule[]

As regras de alerta personalizadas da lista de permissões.

properties.denylistRules

DenylistCustomAlertRule[]

As regras de alerta personalizadas da lista de negação.

properties.thresholdRules

ThresholdCustomAlertRule[]

A lista de regras de limite de alerta personalizadas.

properties.timeWindowRules

TimeWindowCustomAlertRule[]

A lista de regras personalizadas da janela de tempo de alerta.

type

string

Tipo de recurso

ErrorAdditionalInfo

As informações adicionais do erro de gerenciamento de recursos.

Nome Tipo Description
info

object

As informações adicionais.

type

string

O tipo de informação adicional.

ThresholdCustomAlertRule

Uma regra de alerta personalizada que verifica se um valor (depende do tipo de alerta personalizado) está dentro do intervalo determinado.

Nome Tipo Description
description

string

A descrição do alerta personalizado.

displayName

string

O nome de exibição do alerta personalizado.

isEnabled

boolean

Status do alerta personalizado.

maxThreshold

integer

O limite máximo.

minThreshold

integer

O limite mínimo.

ruleType

string

O tipo da regra de alerta personalizada.

TimeWindowCustomAlertRule

Uma regra de alerta personalizada que verifica se o número de atividades (depende do tipo de alerta personalizado) em uma janela de tempo está dentro do intervalo determinado.

Nome Tipo Description
description

string

A descrição do alerta personalizado.

displayName

string

O nome de exibição do alerta personalizado.

isEnabled

boolean

Status do alerta personalizado.

maxThreshold

integer

O limite máximo.

minThreshold

integer

O limite mínimo.

ruleType

string

O tipo da regra de alerta personalizada.

timeWindowSize

string

O tamanho da janela de tempo no formato iso8601.

valueType

O tipo de valor dos itens na lista.

Nome Tipo Description
IpCidr

string

Um intervalo de IP no formato CIDR (por exemplo, '192.168.0.1/8').

String

string

Qualquer valor de cadeia de caracteres.