Set-AzDeviceSecurityGroup
Creare o aggiornare il gruppo di sicurezza dei dispositivi
Sintassi
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>]
Descrizione
Il cmdlet Set-AzDeviceSecurityGroup crea o aggiorna un gruppo di sicurezza dei dispositivi definito nella soluzione di sicurezza iot.
Esempio
Esempio 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: []
Aggiornare il gruppo di sicurezza dei dispositivi esistente da hub IoT "/subscriptions/XXXXXXXX-XXXX-XXXXX-XXXXXXXXXXXXXXX/resourceGroups/MyResourceGroup/providers/Microsoft.Devices/IotHubs/MyHub" con il tipo di regola "Active Connessione ionsNotInAllowedRange"
Parametri
-AllowlistRule
Consenti regole elenco.
Type: | PSAllowlistCustomAlertRule[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Richiede conferma prima di eseguire il cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
Le credenziali, l’account, il tenant e la sottoscrizione usati per comunicare con Azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DenylistRule
Nega regole elenco.
Type: | PSDenylistCustomAlertRule[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-HubResourceId
hub IoT ID risorsa.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Oggetto di input.
Type: | PSDeviceSecurityGroup |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Nome risorsa.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResourceId
ID della risorsa di sicurezza su cui si desidera richiamare il comando.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ThresholdRule
Regole di soglia.
Type: | PSThresholdCustomAlertRule[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TimeWindowRule
Regole dell'intervallo di tempo.
Type: | PSTimeWindowCustomAlertRule[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |