次の方法で共有


Set-AzDeviceSecurityGroup

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

構文

ResourceIdLevelResource (既定)

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

InputObject

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

ResourceId

Set-AzDeviceSecurityGroup
    -ResourceId <String>
    [-ThresholdRule <PSThresholdCustomAlertRule[]>]
    [-TimeWindowRule <PSTimeWindowCustomAlertRule[]>]
    [-AllowlistRule <PSAllowlistCustomAlertRule[]>]
    [-DenylistRule <PSDenylistCustomAlertRule[]>]
    [-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[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

ResourceIdLevelResource
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Confirm

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

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:cf

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-DefaultProfile

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

パラメーターのプロパティ

型:IAzureContextContainer
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-DenylistRule

拒否リストルール。

パラメーターのプロパティ

型:

PSDenylistCustomAlertRule[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

ResourceIdLevelResource
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-HubResourceId

IoT Hub リソース ID。

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

ResourceIdLevelResource
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-InputObject

Input オブジェクト。

パラメーターのプロパティ

型:PSDeviceSecurityGroup
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

InputObject
配置:Named
必須:True
パイプラインからの値:True
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Name

リソース名。

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

ResourceIdLevelResource
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ResourceId

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

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

ResourceId
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-ThresholdRule

しきい値ルール。

パラメーターのプロパティ

型:

PSThresholdCustomAlertRule[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

ResourceIdLevelResource
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-TimeWindowRule

時間枠ルール。

パラメーターのプロパティ

型:

PSTimeWindowCustomAlertRule[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

ResourceIdLevelResource
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-WhatIf

コマンドレットを実行した場合の動作を示します。 コマンドレットは実行されません。

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:ウィスコンシン

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

CommonParameters

このコマンドレットでは、一般的なパラメーター -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction、-WarningVariable の各パラメーターがサポートされています。 詳細については、about_CommonParametersを参照してください。

入力

PSThresholdCustomAlertRule

PSTimeWindowCustomAlertRule

PSAllowlistCustomAlertRule

PSDenylistCustomAlertRule

PSDeviceSecurityGroup

String

出力

PSDeviceSecurityGroup