azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Fix Security issue with target FQDN Wildcard in New-AzFirewallApplicationRuleCollection.md

Open jespernohr opened this issue 7 years ago • 5 comments

Description of the new feature

azure-powershell/src/Network/Network/help/New-AzFirewallApplicationRuleCollection.md in example 2 we are instructed to allow network traffic to google.com and microsoft.com, but the wildcard is allowing adding any characters to the left in domainname.com resulting in an unwanted firewall opening to sites like:

foogoogle.com and barmicrosoft.com

this is a copy of the example in the help file New-AzFirewallApplicationRuleCollection.md

New-AzFirewallApplicationRule -Name R1 -Protocol "http:80","https:443" -TargetFqdn "*google.com", "*microsoft.com"

Proposed implementation details (optional)

New-AzFirewallApplicationRuleCollection.md needs to be edited to New-AzFirewallApplicationRule -Name R1 -Protocol "http:80","https:443" -TargetFqdn "*.google.com", "*.microsoft.com"

(notice the . dot between * star and domainname)

jespernohr avatar May 14 '19 10:05 jespernohr

@fanymanea could you please take a look?

anton-evseev avatar May 14 '19 11:05 anton-evseev

I am beginning to think there is a issue with Azure Firewall whitelisting google with the following gives different results:

"targetFqdns": [ "www.google.com", "*.google.com" does not allow traffic to google.com

"targetFqdns": [ "www.google.com", "*google.com" allows traffic to google.com and foobargoogle.com

jespernohr avatar May 28 '19 12:05 jespernohr

Any Update on this?

jespernohr avatar Jul 11 '19 07:07 jespernohr

@fanymanea can you please escalate a fix?

MikhailTryakhov avatar Jul 11 '19 21:07 MikhailTryakhov

@jespernohr - apologies for the delayed response on this. We can fix the docs per your suggestion. The behavior is by design. Wildcards are supported on the left side only and replace any character.

yairt1974 avatar Jan 23 '20 20:01 yairt1974