Bagikan melalui


Set-AzDeviceSecurityGroup

Membuat atau memperbarui grup keamanan perangkat

Sintaks

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>]

Deskripsi

Cmdlet Set-AzDeviceSecurityGroup membuat atau memperbarui grup keamanan perangkat yang ditentukan dalam solusi keamanan iot.

Contoh

Contoh 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: []

Perbarui grup keamanan perangkat yang ada dari IoT Hub "/subscriptions/XXXXXXXX-XXXX-XXXXX-XXXXXXXXXXXXXX/resourceGroups/MyResourceGroup/providers/Microsoft.Devices/IotHubs/MyHub" dengan jenis aturan "Active Koneksi ionsNotInAllowedRange"

Parameter

-AllowlistRule

Perbolehkan aturan daftar.

Jenis:PSAllowlistCustomAlertRule[]
Position:Named
nilai default:None
Diperlukan:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Meminta Anda mengonfirmasi sebelum menjalankan cmdlet.

Jenis:SwitchParameter
Aliases:cf
Position:Named
nilai default:None
Diperlukan:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan Azure.

Jenis:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
nilai default:None
Diperlukan:False
Accept pipeline input:False
Accept wildcard characters:False

-DenylistRule

Tolak aturan daftar.

Jenis:PSDenylistCustomAlertRule[]
Position:Named
nilai default:None
Diperlukan:False
Accept pipeline input:False
Accept wildcard characters:False

-HubResourceId

Id sumber daya IoT Hub.

Jenis:String
Position:Named
nilai default:None
Diperlukan:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Objek Input.

Jenis:PSDeviceSecurityGroup
Position:Named
nilai default:None
Diperlukan:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Nama sumber daya.

Jenis:String
Position:Named
nilai default:None
Diperlukan:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

ID sumber daya keamanan yang ingin Anda panggil perintahnya.

Jenis:String
Position:Named
nilai default:None
Diperlukan:True
Accept pipeline input:True
Accept wildcard characters:False

-ThresholdRule

Aturan ambang batas.

Jenis:PSThresholdCustomAlertRule[]
Position:Named
nilai default:None
Diperlukan:False
Accept pipeline input:False
Accept wildcard characters:False

-TimeWindowRule

Aturan jendela waktu.

Jenis:PSTimeWindowCustomAlertRule[]
Position:Named
nilai default:None
Diperlukan:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Menunjukkan apa yang akan terjadi jika cmdlet berjalan. Cmdlet tidak dijalankan.

Jenis:SwitchParameter
Aliases:wi
Position:Named
nilai default:None
Diperlukan:False
Accept pipeline input:False
Accept wildcard characters:False

Input

PSThresholdCustomAlertRule[]

PSTimeWindowCustomAlertRule[]

PSAllowlistCustomAlertRule[]

PSDenylistCustomAlertRule[]

PSDeviceSecurityGroup

String

Output

PSDeviceSecurityGroup