Skip to content

Commit 5355c97

Browse files
author
Stefan Manea
committed
Do not allow FQDN Tags with spaces
1 parent f60f6c0 commit 5355c97

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

src/ResourceManager/Network/Commands.Network/AzureFirewallFqdnTag/AzureFirewallFqdnTagHelper.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ private static IEnumerable<string> GetAzureFirewallAllowedFqdnTags()
2525
{
2626
return new List<string>
2727
{
28-
"Windows Update",
29-
"Windows Diagnostics",
30-
"App Service Environment",
31-
"Microsoft Active Protection Service",
32-
"Azure Backup"
28+
"WindowsUpdate",
29+
"WindowsDiagnostics",
30+
"AppServiceEnvironment",
31+
"MicrosoftActiveProtectionService",
32+
"AzureBackup"
3333
};
3434
}
3535

@@ -42,19 +42,13 @@ public static List<string> MapUserInputToAllowedFqdnTags(IEnumerable<string> use
4242

4343
var allowedFqdnTags = GetAzureFirewallAllowedFqdnTags();
4444

45-
// Accept both the full version from user and the version without spaces, both case insensistive
45+
// Accept user input case insensistive
4646
var userAcceptedFqdnTags = allowedFqdnTags.Aggregate(
4747
new Dictionary<string, string>(),
4848
(userAcceptedVersions, allowedFqdnTag) =>
4949
{
5050
userAcceptedVersions.Add(allowedFqdnTag.ToUpper(), allowedFqdnTag);
5151

52-
if (allowedFqdnTag.Contains(" "))
53-
{
54-
var tagWithoutSpaces = allowedFqdnTag.Replace(" ", string.Empty);
55-
userAcceptedVersions.Add(tagWithoutSpaces.ToUpper(), allowedFqdnTag);
56-
}
57-
5852
return userAcceptedVersions;
5953
});
6054

src/ResourceManager/Network/Commands.Network/help/New-AzureRmFirewallApplicationRule.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This example creates a rule which will allow all HTTPS traffic on port 443 from
4444

4545
### 2: Create a rule to allow WindowsUpdate for 10.0.0.0/24 subnet
4646
```
47-
New-AzureRmFirewallApplicationRule -Name "windows-update-rule" -FqdnTag "Windows Update" -SourceAddress "10.0.0.0/24"
47+
New-AzureRmFirewallApplicationRule -Name "windows-update-rule" -FqdnTag WindowsUpdate -SourceAddress "10.0.0.0/24"
4848
```
4949

5050
This example creates a rule which will allow traffic for Windows Updates for 10.0.0.0/24 domain.
@@ -84,11 +84,11 @@ Accept wildcard characters: False
8484
### -FqdnTag
8585
Specifies a list of FQDN Tags for this rule. The available tags are:
8686
87-
- Windows Update
88-
- Windows Diagnostics
89-
- App Service Environment
90-
- Microsoft Active Protection Service
91-
- Azure Backup
87+
- WindowsUpdate
88+
- WindowsDiagnostics
89+
- AppServiceEnvironment
90+
- MicrosoftActiveProtectionService
91+
- AzureBackup
9292
9393
```yaml
9494
Type: System.Collections.Generic.List`1[System.String]

0 commit comments

Comments
 (0)