次の方法で共有


Set-AzDeviceSecurityGroup

デバイス セキュリティ グループを作成または更新する

構文

Set-AzDeviceSecurityGroup
   -Name <String>
   -HubResourceId <String>
   [-ThresholdRule <PSThresholdCustomAlertRule[]>]
   [-TimeWindowRule <PSTimeWindowCustomAlertRule[]>]
   [-AllowlistRule <PSAllowlistCustomAlertRule[]>]
   [-DenylistRule <PSDenylistCustomAlertRule[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzDeviceSecurityGroup
   [-ThresholdRule <PSThresholdCustomAlertRule[]>]
   [-TimeWindowRule <PSTimeWindowCustomAlertRule[]>]
   [-AllowlistRule <PSAllowlistCustomAlertRule[]>]
   [-DenylistRule <PSDenylistCustomAlertRule[]>]
   -InputObject <PSDeviceSecurityGroup>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzDeviceSecurityGroup
   [-ThresholdRule <PSThresholdCustomAlertRule[]>]
   [-TimeWindowRule <PSTimeWindowCustomAlertRule[]>]
   [-AllowlistRule <PSAllowlistCustomAlertRule[]>]
   [-DenylistRule <PSDenylistCustomAlertRule[]>]
   -ResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

説明

Set-AzDeviceSecurityGroup コマンドレットは、iot セキュリティ ソリューションで定義されているデバイス セキュリティ グループを作成または更新します。

例 1

$TimeWindowSize = New-TimeSpan -Minutes 5
$TimeWindowRule = New-AzDeviceSecurityGroupTimeWindowRuleObject -Type "ActiveConnectionsNotInAllowedRange" -Enabled $true `
-MaxThreshold 30 -MinThreshold 0 -TimeWindowSize $TimeWindowSize
Set-AzDeviceSecurityGroup -Name "MySecurityGroup" `
-HubResourceId "/subscriptions/XXXXXXXX-XXXX-XXXXX-XXXX-XXXXXXXXXXXX/resourceGroups/MyResourceGroup/providers/Microsoft.Devices/IotHubs/MyHub" `
-TimeWindowRule $TimeWindowRules

Id: "/subscriptions/XXXXXXXX-XXXX-XXXXX-XXXX-XXXXXXXXXXXX/resourceGroups/MyResourceGroup/providers/Microsoft.Devices/IotHubs/MyHub/providers/Microsoft.Security/deviceSecurityGroups/MySecurityGroup"
Name: "MySecurityGroup"
Type: "Microsoft.Security/deviceSecurityGroups"
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: 0
              TimeWindowSize: "PT5M"
            }]
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
              ValueType: "IpCidr"
              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
              ValueType: "String"
              AllowlistValues: []
            }]
DenylistRules: []

IoT Hub "/subscriptions/XXXXXXXX-XXXX-XXXXX-XXXX-XXXXXXXXXXXX/resourceGroups/MyResourceGroup/providers/Microsoft.Devices/IotHubs/MyHub" から既存のデバイス セキュリティ グループを規則の種類 "ActiveConnectionsNotInAllowedRange" で更新します

パラメーター

-AllowlistRule

許可リストルール。

型:PSAllowlistCustomAlertRule[]
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

コマンドレットの実行前に確認を求めるメッセージが表示されます。

型:SwitchParameter
Aliases:cf
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

Azure との通信のために使用される資格情報、アカウント、テナント、サブスクリプションです。

型:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-DenylistRule

拒否リストルール。

型:PSDenylistCustomAlertRule[]
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-HubResourceId

IoT Hub リソース ID。

型:String
Position:Named
既定値:None
必須:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Input オブジェクト。

型:PSDeviceSecurityGroup
Position:Named
既定値:None
必須:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

リソース名。

型:String
Position:Named
既定値:None
必須:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

コマンドを呼び出すセキュリティ リソースの ID。

型:String
Position:Named
既定値:None
必須:True
Accept pipeline input:True
Accept wildcard characters:False

-ThresholdRule

しきい値ルール。

型:PSThresholdCustomAlertRule[]
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-TimeWindowRule

時間枠ルール。

型:PSTimeWindowCustomAlertRule[]
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

コマンドレットの実行時に発生する内容を示します。 このコマンドレットは実行されません。

型:SwitchParameter
Aliases:wi
Position:Named
既定値:None
必須:False
Accept pipeline input:False
Accept wildcard characters:False

入力

PSThresholdCustomAlertRule[]

PSTimeWindowCustomAlertRule[]

PSAllowlistCustomAlertRule[]

PSDenylistCustomAlertRule[]

PSDeviceSecurityGroup

String

出力

PSDeviceSecurityGroup