Skip to content

Commit 2b57afb

Browse files
Removing PSAzureFirewallPolicyThreatIntelWhitelist validations (Azure#16377)
* Removed PSAzureFirewallPolicyThreatIntelWhitelist validation because all validation happen in BE * added my changes in changelog.md * reomved comments from change log that merged mistakenly to PR
1 parent a7262e1 commit 2b57afb

File tree

2 files changed

+1
-34
lines changed

2 files changed

+1
-34
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
--->
2020

2121
## Upcoming Release
22+
* Bugfix in PSAzureFirewallPolicyThreatIntelWhitelist for FirewallPolicy
2223
* Added optional parameter `-IsSecuritySite` to the following cmdlet:
2324
- `New-AzVpnSite`
2425
* Support for new Match Variables in WAF Exclusions

src/Network/Network/Models/AzureFirewallPolicy/PSAzureFirewallPolicyThreatIntelWhitelist.cs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public string[] FQDNs
3131
get { return this.fqdns; }
3232
set
3333
{
34-
ValidateFqdns(value);
3534
fqdns = value;
3635
}
3736
}
@@ -41,41 +40,8 @@ public string[] IpAddresses
4140
get { return this.ipAddresses; }
4241
set
4342
{
44-
ValidateIpAddresses(value);
4543
ipAddresses = value;
4644
}
4745
}
48-
49-
private const string SecureGatewayThreatIntelFqdnRegex = "^\\*?([a-zA-Z0-9\\-\\.]?[a-zA-Z0-9])*$";
50-
51-
private void ValidateFqdns(string[] fqdns)
52-
{
53-
if (fqdns == null)
54-
return;
55-
56-
var matchingRegEx = new Regex(SecureGatewayThreatIntelFqdnRegex);
57-
foreach (var fqdn in fqdns)
58-
{
59-
if (!matchingRegEx.IsMatch(fqdn))
60-
{
61-
throw new PSArgumentException(String.Format("\'{0}\' is not a valid threat intel whitelist FQDN", fqdn));
62-
}
63-
}
64-
}
65-
66-
private void ValidateIpAddresses(string[] ipAddresses)
67-
{
68-
if (ipAddresses == null)
69-
return;
70-
71-
foreach (var ip in ipAddresses)
72-
{
73-
IPAddress ipVal;
74-
if (!IPAddress.TryParse(ip, out ipVal) || ipVal.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork)
75-
{
76-
throw new PSArgumentException(String.Format("\'{0}\' is not a valid threat intel whitelist Ip Address", ip));
77-
}
78-
}
79-
}
8046
}
8147
}

0 commit comments

Comments
 (0)