Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 12 additions & 2 deletions .github/workflows/0-everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,21 @@ jobs:
Install-Module Az -Force
Install-Module powershell-yaml -Force

- name: Deploy Azure Firewall Policy
if: github.event.inputs.hubNetworkType == 'HubNetworkWithAzureFirewall'
run: |
./RunWorkflows.ps1 `
-DeployAzureFirewallPolicy `
-EnvironmentName '${{github.event.inputs.environmentName}}' `
-LoginServicePrincipalJson (ConvertTo-SecureString -String '${{secrets.ALZ_CREDENTIALS}}' -AsPlainText -Force) `
-GitHubRepo ${env:GITHUB_REPOSITORY} `
-GitHubRef ${env:GITHUB_REF}

- name: Deploy Hub Network with Azure Firewall
if: github.event.inputs.hubNetworkType == 'HubNetworkWithAzureFirewall'
run: |
./RunWorkflows.ps1 `
-Deploy${{github.event.inputs.hubNetworkType}} `
-DeployHubNetworkWithAzureFirewall `
-EnvironmentName '${{github.event.inputs.environmentName}}' `
-LoginServicePrincipalJson (ConvertTo-SecureString -String '${{secrets.ALZ_CREDENTIALS}}' -AsPlainText -Force) `
-GitHubRepo ${env:GITHUB_REPOSITORY} `
Expand All @@ -173,7 +183,7 @@ jobs:
if: github.event.inputs.hubNetworkType == 'HubNetworkWithNVA'
run: |
./RunWorkflows.ps1 `
-Deploy${{github.event.inputs.hubNetworkType}} `
-DeployHubNetworkWithNVA `
-EnvironmentName '${{github.event.inputs.environmentName}}' `
-LoginServicePrincipalJson (ConvertTo-SecureString -String '${{secrets.ALZ_CREDENTIALS}}' -AsPlainText -Force) `
-GitHubRepo ${env:GITHUB_REPOSITORY} `
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/5-azure-firewall-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
# ----------------------------------------------------------------------------------
# Test
name: 5 - Azure Firewall Policy

on:
workflow_dispatch:
inputs:
environmentName:
type: string
description: Environment name (optional), e.g. CanadaESLZ-main
required: false

defaults:
run:
shell: pwsh
working-directory: scripts/deployments

jobs:
azure-firewall-policy:
name: Azure Firewall Policy
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3

- name: Configure PowerShell modules
run: |
Install-Module Az -Force
Install-Module powershell-yaml -Force

- name: Deploy Azure Firewall Policy
run: |
./RunWorkflows.ps1 `
-DeployAzureFirewallPolicy `
-EnvironmentName '${{github.event.inputs.environmentName}}' `
-LoginServicePrincipalJson (ConvertTo-SecureString -String '${{secrets.ALZ_CREDENTIALS}}' -AsPlainText -Force) `
-GitHubRepo ${env:GITHUB_REPOSITORY} `
-GitHubRef ${env:GITHUB_REF}
3 changes: 2 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ The following workflows are present in the `.github/workflows` repository folder
| 1 | Management Groups | `1-management-groups.yml`
| 2 | Roles | `2-roles.yml`
| 3 | Logging | `3-logging.yml`
| 4 | Policy | `policy.yml`
| 4 | Policy | `4-policy.yml`
| 5 | Azure Firewall Policy (required for Hub Networking with Azure Firewall) | `5-azure-firewall-policy.yml`
| 5 | Hub Networking with Azure Firewall | `5-hub-network-with-azure-firewall.yml`
| 5 | Hub Networking with NVA | `5-hub-network-with-nva.yml`
| 6 | Subscriptions | `6-subscriptions.yml`
Expand Down
2 changes: 1 addition & 1 deletion policy/builtin/assignments/asb.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-asb'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/builtin/assignments/cis-msft-130.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-cis-msft-130'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/builtin/assignments/fedramp-moderate.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-fedramp-m'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/builtin/assignments/hitrust-hipaa.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-hitrust-hipaa'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/builtin/assignments/location.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var scope = tenantResourceId('Microsoft.Management/managementGroups', policyAssi
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-location'
}

resource rgLocationAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/builtin/assignments/nist80053r4.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-nist-80053-r4'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/builtin/assignments/nist80053r5.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-nist-80053-r5'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/builtin/assignments/pbmm.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-pbmm'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/custom/assignments/AKS.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var policyScopedId = '/providers/Microsoft.Management/managementGroups/${policyD
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-aks'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/custom/assignments/DDoS.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var policyScopedId = '/providers/Microsoft.Management/managementGroups/${policyD
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-ddos'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/custom/assignments/DNSPrivateEndpoints.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var policyScopedId = '/providers/Microsoft.Management/managementGroups/${policyD
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-dns-pe'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/custom/assignments/DefenderForCloud.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var policyScopedId = '/providers/Microsoft.Management/managementGroups/${policyD
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-mdfc'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/custom/assignments/LogAnalytics.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var policyScopedId = '/providers/Microsoft.Management/managementGroups/${policyD
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-logging'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/custom/assignments/Network.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var policyScopedId = '/providers/Microsoft.Management/managementGroups/${policyD
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-network'
}

resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {
Expand Down
2 changes: 1 addition & 1 deletion policy/custom/assignments/Tags.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var scope = tenantResourceId('Microsoft.Management/managementGroups', policyAssi
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-tags'
}

// Tags Inherited from Subscription to Resource Groups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ function Set-AzureFirewallPolicy {
-Name "main-$Region" `
-Location $Region `
-TemplateFile "$($Context.WorkingDirectory)/landingzones/lz-platform-connectivity-hub-azfw/main-azfw-policy.bicep" `
-TemplateParameterFile $ConfigurationFilePath
-TemplateParameterFile $ConfigurationFilePath `
-Verbose
}

function Set-HubNetwork-With-AzureFirewall {
Expand Down
20 changes: 12 additions & 8 deletions scripts/deployments/RunWorkflows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
Deploy management groups interactively.

.EXAMPLE
PS> .\RunWorkflows.ps1 -EnvironmentName CanadaESLZ-main -LoginInteractiveTenantId '8188040d-6c67-4c5c-b112-36a304b66dad' -DeployManagementGroups -DeployRoles -DeployLogging -DeployCustomPolicy -DeployBuiltInPolicy -DeployHubNetworkWithAzureFirewall
PS> .\RunWorkflows.ps1 -EnvironmentName CanadaESLZ-main -LoginInteractiveTenantId '8188040d-6c67-4c5c-b112-36a304b66dad' -DeployManagementGroups -DeployRoles -DeployLogging -DeployCustomPolicy -DeployBuiltInPolicy -DeployAzureFirewallPolicy -DeployHubNetworkWithAzureFirewall

Deploy all platform components interactively, with Azure Firewall.

Expand Down Expand Up @@ -105,6 +105,7 @@ Param(
[switch]$DeployLogging,
[switch]$DeployCustomPolicy,
[switch]$DeployBuiltinPolicy,
[switch]$DeployAzureFirewallPolicy,
[switch]$DeployHubNetworkWithNVA,
[switch]$DeployHubNetworkWithAzureFirewall,
[string[]]$DeploySubscriptionIds=@(),
Expand Down Expand Up @@ -271,20 +272,23 @@ if ($DeployHubNetworkWithNVA) {
-NvaPassword $NvaPassword
}

# Azure Firewall Policy
if ($DeployAzureFirewallPolicy) {
# Create Azure Firewall Policy
Set-AzureFirewallPolicy `
-Context $Context `
-Region $Context.Variables['var-hubnetwork-region'] `
-SubscriptionId $Context.Variables['var-hubnetwork-subscriptionId'] `
-ConfigurationFilePath "$($Context.NetworkingDirectory)/$($Context.Variables['var-hubnetwork-azfwPolicy-configurationFileName'])"
}

# Hub Networking with Azure Firewall
if ($DeployHubNetworkWithAzureFirewall) {
Write-Host "Deploying Hub Networking with Azure Firewall..."
# Get Logging information using logging config file
$LoggingConfiguration = Get-LoggingConfiguration `
-ConfigurationFilePath "$($Context.LoggingDirectory)/$($Context.Variables['var-logging-configurationFileName'])" `
-SubscriptionId $Context.Variables['var-logging-subscriptionId']

# Create Azure Firewall Policy
Set-AzureFirewallPolicy `
-Context $Context `
-Region $Context.Variables['var-hubnetwork-region'] `
-SubscriptionId $Context.Variables['var-hubnetwork-subscriptionId'] `
-ConfigurationFilePath "$($Context.NetworkingDirectory)/$($Context.Variables['var-hubnetwork-azfwPolicy-configurationFileName'])"

# Retrieve Azure Firewall Policy
$AzureFirewallPolicyConfiguration = Get-AzureFirewallPolicy `
Expand Down