Skip to content

Commit 6a90a2f

Browse files
Separate Azure Firewall Policy deployment switch & unique telemetry tracking for policy assignments (#289)
1 parent c413307 commit 6a90a2f

20 files changed

+89
-27
lines changed

.github/workflows/0-everything.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,21 @@ jobs:
159159
Install-Module Az -Force
160160
Install-Module powershell-yaml -Force
161161
162+
- name: Deploy Azure Firewall Policy
163+
if: github.event.inputs.hubNetworkType == 'HubNetworkWithAzureFirewall'
164+
run: |
165+
./RunWorkflows.ps1 `
166+
-DeployAzureFirewallPolicy `
167+
-EnvironmentName '${{github.event.inputs.environmentName}}' `
168+
-LoginServicePrincipalJson (ConvertTo-SecureString -String '${{secrets.ALZ_CREDENTIALS}}' -AsPlainText -Force) `
169+
-GitHubRepo ${env:GITHUB_REPOSITORY} `
170+
-GitHubRef ${env:GITHUB_REF}
171+
162172
- name: Deploy Hub Network with Azure Firewall
163173
if: github.event.inputs.hubNetworkType == 'HubNetworkWithAzureFirewall'
164174
run: |
165175
./RunWorkflows.ps1 `
166-
-Deploy${{github.event.inputs.hubNetworkType}} `
176+
-DeployHubNetworkWithAzureFirewall `
167177
-EnvironmentName '${{github.event.inputs.environmentName}}' `
168178
-LoginServicePrincipalJson (ConvertTo-SecureString -String '${{secrets.ALZ_CREDENTIALS}}' -AsPlainText -Force) `
169179
-GitHubRepo ${env:GITHUB_REPOSITORY} `
@@ -173,7 +183,7 @@ jobs:
173183
if: github.event.inputs.hubNetworkType == 'HubNetworkWithNVA'
174184
run: |
175185
./RunWorkflows.ps1 `
176-
-Deploy${{github.event.inputs.hubNetworkType}} `
186+
-DeployHubNetworkWithNVA `
177187
-EnvironmentName '${{github.event.inputs.environmentName}}' `
178188
-LoginServicePrincipalJson (ConvertTo-SecureString -String '${{secrets.ALZ_CREDENTIALS}}' -AsPlainText -Force) `
179189
-GitHubRepo ${env:GITHUB_REPOSITORY} `
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ----------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT license.
4+
#
5+
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
6+
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
7+
# OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
8+
# ----------------------------------------------------------------------------------
9+
# Test
10+
name: 5 - Azure Firewall Policy
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
environmentName:
16+
type: string
17+
description: Environment name (optional), e.g. CanadaESLZ-main
18+
required: false
19+
20+
defaults:
21+
run:
22+
shell: pwsh
23+
working-directory: scripts/deployments
24+
25+
jobs:
26+
azure-firewall-policy:
27+
name: Azure Firewall Policy
28+
runs-on: ubuntu-latest
29+
steps:
30+
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
34+
- name: Configure PowerShell modules
35+
run: |
36+
Install-Module Az -Force
37+
Install-Module powershell-yaml -Force
38+
39+
- name: Deploy Azure Firewall Policy
40+
run: |
41+
./RunWorkflows.ps1 `
42+
-DeployAzureFirewallPolicy `
43+
-EnvironmentName '${{github.event.inputs.environmentName}}' `
44+
-LoginServicePrincipalJson (ConvertTo-SecureString -String '${{secrets.ALZ_CREDENTIALS}}' -AsPlainText -Force) `
45+
-GitHubRepo ${env:GITHUB_REPOSITORY} `
46+
-GitHubRef ${env:GITHUB_REF}

.github/workflows/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ The following workflows are present in the `.github/workflows` repository folder
1818
| 1 | Management Groups | `1-management-groups.yml`
1919
| 2 | Roles | `2-roles.yml`
2020
| 3 | Logging | `3-logging.yml`
21-
| 4 | Policy | `policy.yml`
21+
| 4 | Policy | `4-policy.yml`
22+
| 5 | Azure Firewall Policy (required for Hub Networking with Azure Firewall) | `5-azure-firewall-policy.yml`
2223
| 5 | Hub Networking with Azure Firewall | `5-hub-network-with-azure-firewall.yml`
2324
| 5 | Hub Networking with NVA | `5-hub-network-with-nva.yml`
2425
| 6 | Subscriptions | `6-subscriptions.yml`

policy/builtin/assignments/asb.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
3232
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
3333
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
3434
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
35-
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
35+
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-asb'
3636
}
3737

3838
resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {

policy/builtin/assignments/cis-msft-130.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
4444
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
4545
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
4646
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
47-
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
47+
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-cis-msft-130'
4848
}
4949

5050
resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {

policy/builtin/assignments/fedramp-moderate.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
3535
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
3636
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
3737
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
38-
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
38+
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-fedramp-m'
3939
}
4040

4141
resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {

policy/builtin/assignments/hitrust-hipaa.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
4747
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
4848
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
4949
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
50-
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
50+
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-hitrust-hipaa'
5151
}
5252

5353
resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {

policy/builtin/assignments/location.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var scope = tenantResourceId('Microsoft.Management/managementGroups', policyAssi
3131
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
3232
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
3333
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
34-
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
34+
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-location'
3535
}
3636

3737
resource rgLocationAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {

policy/builtin/assignments/nist80053r4.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
4141
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
4242
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
4343
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
44-
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
44+
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-nist-80053-r4'
4545
}
4646

4747
resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {

policy/builtin/assignments/nist80053r5.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var policyScopedId = resourceId('Microsoft.Authorization/policySetDefinitions',
3535
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
3636
var telemetry = json(loadTextContent('../../../config/telemetry.json'))
3737
module telemetryCustomerUsageAttribution '../../../azresources/telemetry/customer-usage-attribution-management-group.bicep' = if (telemetry.customerUsageAttribution.enabled) {
38-
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}'
38+
name: 'pid-${telemetry.customerUsageAttribution.modules.policy}-nist-80053-r5'
3939
}
4040

4141
resource policySetAssignment 'Microsoft.Authorization/policyAssignments@2020-03-01' = {

0 commit comments

Comments
 (0)