Skip to content

Commit e89edad

Browse files
committed
address comment
1 parent 107ee10 commit e89edad

File tree

8 files changed

+24
-40
lines changed

8 files changed

+24
-40
lines changed

src/Network/Network/Az.Network.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ AliasesToExport = 'List-AzApplicationGatewayAvailableWafRuleSets',
451451
'Get-AzExpressRouteCircuitStats',
452452
'Get-AzApplicationGatewayAvailableWafRuleSets',
453453
'Get-AzApplicationGatewayAvailableSslOptions',
454-
'Get-AzInterfaceEndpoint'
454+
'Get-AzInterfaceEndpoint',
455+
'New-AzFirewallThreatIntelWhitelistObject'
455456

456457
# DSC resources to export from this module
457458
# DscResourcesToExport = @()

src/Network/Network/AzureFirewall/NewAzureFirewallCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ public class NewAzureFirewallCommand : AzureFirewallBaseCmdlet
137137

138138
[Parameter(
139139
Mandatory = false,
140-
ValueFromPipelineByPropertyName = true,
141140
HelpMessage = "The whitelist for Threat Intelligence")]
142141
public PSAzureFirewallThreatIntelWhitelist ThreatIntelWhitelist { get; set; }
143142

src/Network/Network/AzureFirewall/ThreatIntelWhitelist/NewAzureFirewallThreatIntelWhitelistCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
namespace Microsoft.Azure.Commands.Network
2222
{
23-
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FirewallThreatIntelWhitelist", SupportsShouldProcess = true), OutputType(typeof(PSAzureFirewallThreatIntelWhitelist))]
23+
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FirewallThreatIntelWhitelist"), OutputType(typeof(PSAzureFirewallThreatIntelWhitelist))]
24+
[Alias("New-AzFirewallThreatIntelWhitelistObject")]
2425
public class NewAzureFirewallThreatIntelWhitelistCommand : AzureFirewallBaseCmdlet
2526
{
2627
[Parameter(

src/Network/Network/Models/AzureFirewall/PSAzureFirewallThreatIntelWhitelist.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ private void ValidateFqdns(string[] fqdns)
5252
{
5353
if (fqdns == null)
5454
return;
55+
56+
var matchingRegEx = new Regex(SecureGatewayThreatIntelFqdnRegex);
5557
foreach (var fqdn in fqdns)
5658
{
57-
var matchingRegEx = new Regex(SecureGatewayThreatIntelFqdnRegex);
5859
if (!matchingRegEx.IsMatch(fqdn))
5960
{
6061
throw new PSArgumentException(String.Format("\'{0}\' is not a valid threat intel whitelist FQDN", fqdn));
@@ -66,6 +67,7 @@ private void ValidateIpAddresses(string[] ipAddresses)
6667
{
6768
if (ipAddresses == null)
6869
return;
70+
6971
foreach (var ip in ipAddresses)
7072
{
7173
IPAddress ipVal;

src/Network/Network/help/Az.Network.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Adds a VPN client root certificate.
141141
Approves a private endpoint connection.
142142

143143
### [Deny-AzPrivateEndpointConnection](Deny-AzPrivateEndpointConnection.md)
144-
denies a private endpoint connection.
144+
Denies a private endpoint connection.
145145

146146
### [Get-AzApplicationGateway](Get-AzApplicationGateway.md)
147147
Gets an application gateway.

src/Network/Network/help/Get-AzFirewall.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ Required: False
315315
Position: Named
316316
Default value: None
317317
Accept pipeline input: True (ByPropertyName)
318-
Accept wildcard characters: False
318+
Accept wildcard characters: True
319319
```
320320
321321
### CommonParameters

src/Network/Network/help/New-AzFirewall.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,18 @@ New-AzFirewall -Name "azFw" -ResourceGroupName $rgName -Location centralus -Sku
160160

161161
This example creates a Firewall attached to virtual hub "vHub". A firewall policy $fp will be attached to the firewall. This firewall allows/denies the traffic based on the rules mentioned in the firewall policy $fp. The virtual hub and the firewall should be in the same regions.
162162

163+
### 10: Create a Firewall with threat intelligence whitelist setup
164+
```
165+
$rgName = "resourceGroupName"
166+
$vnet = Get-AzVirtualNetwork -ResourceGroupName $rgName -Name "vnet"
167+
$pip = Get-AzPublicIpAddress -ResourceGroupName $rgName -Name "publicIpName"
168+
169+
$tiWhitelist = New-AzFirewallThreatIntelWhitelist -FQDN @("www.microsoft.com") -IpAddresses @("8.8.8.8")
170+
New-AzFirewall -Name "azFw" -ResourceGroupName $rgName -Location centralus -VirtualNetwork $vnet -PublicIpAddress $pip -ThreatIntelWhitelist $tiWhitelist
171+
```
172+
173+
This example creates a Firewall that whitelist "www.microsoft.com" and "8.8.8.8" from threat intelligence
174+
163175
## PARAMETERS
164176

165177
### -ApplicationRuleCollection
@@ -402,7 +414,7 @@ Aliases:
402414
Required: False
403415
Position: Named
404416
Default value: None
405-
Accept pipeline input: True (ByPropertyName)
417+
Accept pipeline input: False
406418
Accept wildcard characters: False
407419
```
408420

src/Network/Network/help/New-AzFirewallThreatIntelWhitelist.md

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Create a new threat intelligence whitelist for Azure Firewall
1414

1515
```
1616
New-AzFirewallThreatIntelWhitelist [-FQDN <String[]>] [-IpAddress <String[]>]
17-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
17+
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
21-
The **New-AzFirewallThreatIntelWhitelist** cmdlet creates a threat intel whitelist for Azure Firewall.
21+
The **New-AzFirewallThreatIntelWhitelist** cmdlet creates a threat intel whitelist object, which can be used when creating or setting an Azure Firewall.
2222

2323
## EXAMPLES
2424

@@ -76,37 +76,6 @@ Accept pipeline input: False
7676
Accept wildcard characters: False
7777
```
7878
79-
### -Confirm
80-
Prompts you for confirmation before running the cmdlet.
81-
82-
```yaml
83-
Type: System.Management.Automation.SwitchParameter
84-
Parameter Sets: (All)
85-
Aliases: cf
86-
87-
Required: False
88-
Position: Named
89-
Default value: None
90-
Accept pipeline input: False
91-
Accept wildcard characters: False
92-
```
93-
94-
### -WhatIf
95-
Shows what would happen if the cmdlet runs.
96-
The cmdlet is not run.
97-
98-
```yaml
99-
Type: System.Management.Automation.SwitchParameter
100-
Parameter Sets: (All)
101-
Aliases: wi
102-
103-
Required: False
104-
Position: Named
105-
Default value: None
106-
Accept pipeline input: False
107-
Accept wildcard characters: False
108-
```
109-
11079
### CommonParameters
11180
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
11281

0 commit comments

Comments
 (0)