Skip to content

Commit 8b971d0

Browse files
cae-pr-creator[bot]matt-FFFFFFactions-user
authored
feat(platform/alz): update platform/alz library (automated) (#127)
This is an automated pull_request containing updates to the library templates stored in . Please review the files changed tab to review changes. --------- Co-authored-by: Matt White <16320656+matt-FFFFFF@users.noreply.github.com> Co-authored-by: github-actions <action@github.com>
1 parent 3c1c485 commit 8b971d0

File tree

85 files changed

+1275
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1275
-119
lines changed

.github/workflows/update-alz.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ permissions:
1212

1313
env:
1414
remote_repository: "Azure/Enterprise-Scale"
15-
alzlib_repository: "Azure/alzlib"
1615
library_dir: "platform/alz"
1716
pr_title: "feat: update platform/alz library (automated)"
1817
pr_body: |-
@@ -25,47 +24,47 @@ jobs:
2524
runs-on: ubuntu-latest
2625
environment: libupdate
2726
steps:
28-
- name: Install alzlibtool
29-
run: |
30-
curl -L https://github.com/Azure/alzlib/releases/download/${{ vars.ALZLIBTOOL_VERSION }}/alzlibtool_linux_amd64.tar.gz | tar -xvz
31-
sudo cp alzlibtool /usr/local/bin
3227

33-
- name: Local repository checkout
28+
- name: local repository checkout
3429
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3530
with:
3631
path: ${{ github.repository }}
3732
fetch-depth: 0
3833

39-
- name: Remote repository checkout
34+
- name: install tools
35+
run: make tools
36+
working-directory: ${{ github.workspace }}/${{ github.repository }}
37+
38+
- name: remote repository checkout
4039
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4140
with:
4241
repository: ${{ env.remote_repository }}
4342
path: ${{ env.remote_repository }}
4443
ref: main
4544

46-
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
45+
- uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
4746
id: generate-token
4847
with:
49-
app_id: ${{ secrets.TOKEN_APP_ID }}
50-
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}
48+
app-id: ${{ secrets.TOKEN_APP_ID }}
49+
private-key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}
5150

52-
- name: Configure local git
51+
- name: configure local git
5352
run: |
5453
git config user.name github-actions
5554
git config user.email action@github.com
5655
working-directory: ${{ github.repository }}
5756

58-
- name: Create and checkout branch
57+
- name: create and checkout branch
5958
id: branch
6059
run: |
61-
BRANCH="platform-alz-${{ github.run_number }}"
60+
BRANCH="feat/${{ env.library_dir }}-${{ github.run_number }}"
6261
echo "name=$BRANCH" >> "$GITHUB_OUTPUT"
6362
git checkout -b "$BRANCH"
6463
working-directory: ${{ github.repository }}
6564
env:
6665
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
6766

68-
- name: Update library policy definitions
67+
- name: update library policy definitions
6968
run: |
7069
alzlibtool convert policydefinition -o \
7170
"${{ github.workspace }}/${{ env.remote_repository }}/src/resources/Microsoft.Authorization/policyDefinitions" \
@@ -77,7 +76,7 @@ jobs:
7776
"${{ github.workspace }}/${{ env.remote_repository }}/src/resources/Microsoft.Authorization/policySetDefinitions" \
7877
"${{ github.workspace }}/${{ github.repository }}/${{ env.library_dir }}/policy_set_definitions"
7978
80-
- name: Update library policy definitions in archetype definitions
79+
- name: update library policy definitions in archetype definitions
8180
uses: azure/powershell@53dd145408794f7e80f97cfcca04155c85234709 # v2.0.0
8281
with:
8382
inlineScript: |
@@ -87,7 +86,7 @@ jobs:
8786
-SourcePath "${{ github.workspace }}/${{ env.remote_repository }}"
8887
azPSVersion: "latest"
8988

90-
- name: Update library policy assignments and archetypes
89+
- name: update library policy assignments and archetypes
9190
uses: azure/powershell@53dd145408794f7e80f97cfcca04155c85234709 # v2.0.0
9291
with:
9392
inlineScript: |
@@ -97,21 +96,21 @@ jobs:
9796
-SourcePath "${{ github.workspace }}/${{ env.remote_repository }}"
9897
azPSVersion: "latest"
9998

100-
- name: Check for changes
99+
- name: check for changes
101100
id: git_status
102101
run: |
103102
mapfile -t "CHECK_GIT_STATUS" < <(git status -s ${{ env.library_dir }})
104103
printf "%s\n" "${CHECK_GIT_STATUS[@]}"
105104
echo "changes=${#CHECK_GIT_STATUS[@]}" >> "$GITHUB_OUTPUT"
106105
working-directory: ${{ github.workspace }}/${{ github.repository }}
107106

108-
- name: Regerate README.md
107+
- name: generate README.md
109108
if: steps.git_status.outputs.changes > 0
110109
run: |
111-
alzlibtool document library . >README.md
112-
working-directory: ${{ github.repository }}
110+
make docs LIB="${{ env.library_dir }}"
111+
working-directory: ${{ github.workspace }}/${{ github.repository }}
113112

114-
- name: Add files, commit and push
113+
- name: add files, commit and push
115114
if: steps.git_status.outputs.changes > 0
116115
run: |
117116
echo "Pushing changes to origin..."
@@ -120,7 +119,7 @@ jobs:
120119
git push origin ${{ steps.branch.outputs.name }}
121120
working-directory: ${{ github.repository }}
122121

123-
- name: Create pull request
122+
- name: create pull request
124123
if: steps.git_status.outputs.changes > 0
125124
id: pr
126125
run: |
@@ -139,7 +138,7 @@ jobs:
139138
- name: close and comment out of date prs
140139
if: steps.git_status.outputs.changes > 0
141140
run: |
142-
PULL_REQUESTS=$(gh pr list --search 'feat: update platform/alz library (automated)' --json number,headRefName)
141+
PULL_REQUESTS=$(gh pr list --search '${{ env.pr_title }}' --json number,headRefName)
143142
echo "$PULL_REQUESTS" | jq -r '.[] | select(.number != ${{ steps.pr.outputs.number }}) | .number' | xargs -I {} gh pr close {} --delete-branch --comment "Supersceeded by #${{ steps.pr.outputs.pull-request-number }}"
144143
working-directory: ${{ github.repository }}
145144
env:

platform/alz/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ flowchart TD
133133
- Enforce-ASR
134134
- Enforce-GR-KeyVault
135135
- Enforce-Subnet-Private
136-
- Enforce-TLS-SSL-H224
136+
- Enforce-TLS-SSL-Q225
137137
</details>
138138

139139
### archetype `platform`
@@ -160,7 +160,7 @@ flowchart TD
160160

161161
#### root policy definitions
162162

163-
<details><summary>158 policy definitions</summary>
163+
<details><summary>160 policy definitions</summary>
164164

165165
- Append-AppService-httpsonly
166166
- Append-AppService-latestTLS
@@ -173,6 +173,8 @@ flowchart TD
173173
- Audit-PrivateLinkDnsZones
174174
- Audit-PublicIpAddresses-UnusedResourcesCostOptimization
175175
- Audit-ServerFarms-UnusedResourcesCostOptimization
176+
- Audit-Tags-Mandatory
177+
- Audit-Tags-Mandatory-Rg
176178
- Deny-AA-child-resources
177179
- Deny-APIM-TLS
178180
- Deny-AppGW-Without-WAF
@@ -324,7 +326,7 @@ flowchart TD
324326

325327
#### root policy set definitions
326328

327-
<details><summary>46 policy set definitions</summary>
329+
<details><summary>47 policy set definitions</summary>
328330

329331
- Audit-TrustedLaunch
330332
- Audit-UnusedResourcesCostOptimization
@@ -344,6 +346,7 @@ flowchart TD
344346
- Enforce-Backup
345347
- Enforce-EncryptTransit
346348
- Enforce-EncryptTransit_20240509
349+
- Enforce-EncryptTransit_20241211
347350
- Enforce-Encryption-CMK
348351
- Enforce-Guardrails-APIM
349352
- Enforce-Guardrails-AppServices
@@ -526,7 +529,7 @@ The subscription id that hosts the private link DNS zones.
526529

527530
### all policy definitions
528531

529-
<details><summary>158 policy definitions</summary>
532+
<details><summary>160 policy definitions</summary>
530533

531534
- Append-AppService-httpsonly
532535
- Append-AppService-latestTLS
@@ -539,6 +542,8 @@ The subscription id that hosts the private link DNS zones.
539542
- Audit-PrivateLinkDnsZones
540543
- Audit-PublicIpAddresses-UnusedResourcesCostOptimization
541544
- Audit-ServerFarms-UnusedResourcesCostOptimization
545+
- Audit-Tags-Mandatory
546+
- Audit-Tags-Mandatory-Rg
542547
- Deny-AA-child-resources
543548
- Deny-APIM-TLS
544549
- Deny-AppGW-Without-WAF
@@ -690,7 +695,7 @@ The subscription id that hosts the private link DNS zones.
690695

691696
### all policy set definitions
692697

693-
<details><summary>46 policy set definitions</summary>
698+
<details><summary>47 policy set definitions</summary>
694699

695700
- Audit-TrustedLaunch
696701
- Audit-UnusedResourcesCostOptimization
@@ -710,6 +715,7 @@ The subscription id that hosts the private link DNS zones.
710715
- Enforce-Backup
711716
- Enforce-EncryptTransit
712717
- Enforce-EncryptTransit_20240509
718+
- Enforce-EncryptTransit_20241211
713719
- Enforce-Encryption-CMK
714720
- Enforce-Guardrails-APIM
715721
- Enforce-Guardrails-AppServices
@@ -742,7 +748,7 @@ The subscription id that hosts the private link DNS zones.
742748

743749
### all policy assignments
744750

745-
<details><summary>49 policy assignments</summary>
751+
<details><summary>50 policy assignments</summary>
746752

747753
- Audit-AppGW-WAF
748754
- Audit-PeDnsZones
@@ -793,6 +799,7 @@ The subscription id that hosts the private link DNS zones.
793799
- Enforce-GR-KeyVault
794800
- Enforce-Subnet-Private
795801
- Enforce-TLS-SSL-H224
802+
- Enforce-TLS-SSL-Q225
796803
</details>
797804

798805
### all role definitions

platform/alz/archetype_definitions/landing_zones.alz_archetype_definition.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"Enforce-ASR",
2727
"Enforce-GR-KeyVault",
2828
"Enforce-Subnet-Private",
29-
"Enforce-TLS-SSL-H224"
29+
"Enforce-TLS-SSL-Q225"
3030
],
3131
"policy_definitions": [],
3232
"policy_set_definitions": [],

platform/alz/archetype_definitions/root.alz_archetype_definition.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
"Audit-PrivateLinkDnsZones",
3131
"Audit-PublicIpAddresses-UnusedResourcesCostOptimization",
3232
"Audit-ServerFarms-UnusedResourcesCostOptimization",
33+
"Audit-Tags-Mandatory-Rg",
34+
"Audit-Tags-Mandatory",
3335
"Deny-AA-child-resources",
3436
"Deny-APIM-TLS",
3537
"Deny-AppGw-Without-Tls",
@@ -197,6 +199,7 @@
197199
"Enforce-Backup",
198200
"Enforce-Encryption-CMK",
199201
"Enforce-EncryptTransit_20240509",
202+
"Enforce-EncryptTransit_20241211",
200203
"Enforce-EncryptTransit",
201204
"Enforce-Guardrails-APIM",
202205
"Enforce-Guardrails-AppServices",

platform/alz/policy_assignments/Audit-AppGW-WAF.alz_policy_assignment.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"type": "Microsoft.Authorization/policyAssignments",
3-
"apiVersion": "2022-06-01",
3+
"apiVersion": "2024-04-01",
44
"name": "Audit-AppGW-WAF",
55
"dependsOn": [],
66
"properties": {
77
"description": "Assign the WAF should be enabled for Application Gateway audit policy.",
88
"displayName": "Web Application Firewall (WAF) should be enabled for Application Gateway",
99
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/564feb30-bf6a-4854-b4bb-0d2d2d1e6c66",
10+
"definitionVersion": "2.*.*",
1011
"enforcementMode": "Default",
1112
"nonComplianceMessages": [
1213
{

platform/alz/policy_assignments/Audit-ResourceRGLocation.alz_policy_assignment.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"type": "Microsoft.Authorization/policyAssignments",
3-
"apiVersion": "2022-06-01",
3+
"apiVersion": "2024-04-01",
44
"name": "Audit-ResourceRGLocation",
55
"dependsOn": [],
66
"properties": {
77
"description": "Resource Group and Resource locations should match.",
88
"displayName": "Resource Group and Resource locations should match",
99
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a",
10+
"definitionVersion": "2.*.*",
1011
"enforcementMode": "Default",
1112
"nonComplianceMessages": [
1213
{

platform/alz/policy_assignments/Audit-TrustedLaunch.alz_policy_assignment.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"enforcementMode": "Default",
1212
"nonComplianceMessages": [
1313
{
14-
"message": "Trust Launch {enforcementMode} be used on supported virtual machines for enhanced security."
14+
"message": "Trusted Launch {enforcementMode} be used on supported virtual machines for enhanced security."
1515
}
1616
],
1717
"parameters": {

platform/alz/policy_assignments/Audit-ZoneResiliency.alz_policy_assignment.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"type": "Microsoft.Authorization/policyAssignments",
3-
"apiVersion": "2022-06-01",
3+
"apiVersion": "2024-04-01",
44
"name": "Audit-ZoneResiliency",
55
"dependsOn": [],
66
"properties": {
77
"description": "Resources should be Zone Resilient.",
88
"displayName": "Resources should be Zone Resilient",
99
"policyDefinitionId": "/providers/Microsoft.Authorization/policySetDefinitions/130fb88f-0fc9-4678-bfe1-31022d71c7d5",
10+
"definitionVersion": "1.*.*-preview",
1011
"enforcementMode": "Default",
1112
"nonComplianceMessages": [
1213
{

platform/alz/policy_assignments/Deny-Classic-Resources.alz_policy_assignment.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"type": "Microsoft.Authorization/policyAssignments",
3-
"apiVersion": "2022-06-01",
3+
"apiVersion": "2024-04-01",
44
"name": "Deny-Classic-Resources",
55
"dependsOn": [],
66
"properties": {
77
"description": "Denies deployment of classic resource types under the assigned scope.",
88
"displayName": "Deny the deployment of classic resources",
99
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/6c112d4e-5bc7-47ae-a041-ea2d9dccd749",
10+
"definitionVersion": "2.*.*",
1011
"enforcementMode": "Default",
1112
"nonComplianceMessages": [
1213
{

platform/alz/policy_assignments/Deny-HybridNetworking.alz_policy_assignment.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"type": "Microsoft.Authorization/policyAssignments",
3-
"apiVersion": "2022-06-01",
3+
"apiVersion": "2024-04-01",
44
"name": "Deny-HybridNetworking",
55
"dependsOn": [],
66
"properties": {
77
"description": "Denies deployment of vWAN/ER/VPN gateway resources in the Corp landing zone.",
88
"displayName": "Deny the deployment of vWAN/ER/VPN gateway resources",
99
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/6c112d4e-5bc7-47ae-a041-ea2d9dccd749",
10+
"definitionVersion": "2.*.*",
1011
"enforcementMode": "Default",
1112
"nonComplianceMessages": [
1213
{

0 commit comments

Comments
 (0)