Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added firewalls policies for AzureCloud and MSFT Login #442

Merged
merged 4 commits into from
Oct 8, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 91 additions & 1 deletion src/bicep/modules/firewall.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,101 @@ resource firewallPolicy 'Microsoft.Network/firewallPolicies@2021-02-01' = {
}
}

resource firewallAppRuleCollectionGroup 'Microsoft.Network/firewallPolicies/ruleCollectionGroups@2021-02-01' = {
name: '${firewallPolicyName}/DefaultApplicationRuleCollectionGroup'
dependsOn: [
firewallPolicy
]
properties: {
priority: 300
ruleCollections: [
glennmusa marked this conversation as resolved.
Show resolved Hide resolved
{
ruleCollectionType: 'FirewallPolicyFilterRuleCollection'
action: {
type: 'Allow'
}
rules: [
{
ruleType: 'ApplicationRule'
name: 'msftauth'
protocols: [
{
protocolType: 'Https'
port: 443
}
]
fqdnTags: []
webCategories: []
targetFqdns: [
'aadcdn.msftauth.net'
'aadcdn.msauth.net'
]
targetUrls: []
terminateTLS: false
sourceAddresses: [
'*'
]
destinationAddresses: []
sourceIpGroups: []
}
]
name: 'AzureAuth'
priority: 110
}
]
}
}

resource firewallNetworkRuleCollectionGroup 'Microsoft.Network/firewallPolicies/ruleCollectionGroups@2021-02-01' = {
name: '${firewallPolicyName}/DefaultNetworkRuleCollectionGroup'
dependsOn: [
firewallPolicy
firewallAppRuleCollectionGroup
]
properties: {
priority: 200
ruleCollections: [
glennmusa marked this conversation as resolved.
Show resolved Hide resolved
{
ruleCollectionType: 'FirewallPolicyFilterRuleCollection'
action: {
type: 'Allow'
}
rules: [
{
ruleType: 'NetworkRule'
name: 'AzureCloud'
ipProtocols: [
'Any'
]
sourceAddresses: [
'*'
]
sourceIpGroups: []
destinationAddresses: [
'AzureCloud'
]
destinationIpGroups: []
destinationFqdns: []
destinationPorts: [
'*'
]
}
]
name: 'AllowAzureCloud'
priority: 100
}
]
}
}

resource firewall 'Microsoft.Network/azureFirewalls@2021-02-01' = {
name: name
location: location
tags: tags

dependsOn: [
firewallNetworkRuleCollectionGroup
firewallAppRuleCollectionGroup
]
properties: {
ipConfigurations: [
{
Expand Down