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

[pull] main from Azure:main #107

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
546b9fd
[StepSecurity] Apply security best practices (#876)
step-security-bot Oct 7, 2024
97d5a59
Bump github/codeql-action from 3.26.10 to 3.26.13 (#879)
dependabot[bot] Oct 19, 2024
d02b0d3
Bump actions/checkout from 4.1.1 to 4.2.1 (#881)
dependabot[bot] Oct 19, 2024
c375e41
Bump actions/upload-artifact from 4.4.0 to 4.4.3 (#880)
dependabot[bot] Oct 19, 2024
3f3d38f
feat: Policy Refresh Q1 FY25 (#806)
cae-pr-creator[bot] Oct 24, 2024
379fc24
Bump softprops/action-gh-release from 2.0.8 to 2.0.9 (#893)
dependabot[bot] Nov 4, 2024
acc9e70
Bump github/codeql-action from 3.26.13 to 3.27.0 (#887)
dependabot[bot] Nov 4, 2024
6be370f
Bump actions/checkout from 4.2.1 to 4.2.2 (#889)
dependabot[bot] Nov 4, 2024
7a40492
Bump actions/dependency-review-action from 4.3.4 to 4.4.0 (#892)
dependabot[bot] Nov 4, 2024
d1edb92
feat: Update Policy Library (automated) (#894)
cae-pr-creator[bot] Nov 5, 2024
c282211
fix: Private DNS Zones Bug (#695) (#891)
jtracey93 Nov 6, 2024
301891f
fix: Resolve a variety of bugs and update api version of private dns …
oZakari Nov 7, 2024
3712548
Bump github/codeql-action from 3.27.0 to 3.27.1 (#900)
dependabot[bot] Nov 12, 2024
1618d0f
Adjust permission scopes (#898)
oZakari Nov 12, 2024
aad77e8
Update known issues (#908)
oZakari Nov 21, 2024
0d6728d
Bump softprops/action-gh-release from 2.0.9 to 2.1.0 (#906)
dependabot[bot] Nov 21, 2024
5450db5
Bump github/codeql-action from 3.27.1 to 3.27.4 (#905)
dependabot[bot] Nov 21, 2024
24c576a
Update permissions at top level and add environment (#904)
oZakari Nov 22, 2024
488e028
Update docs (#910)
oZakari Nov 23, 2024
640a1db
feat: updates to fix Region name now being appended to azFw policy na…
jtracey93 Nov 27, 2024
fbc398a
Bump github/codeql-action from 3.27.4 to 3.27.5 (#911)
dependabot[bot] Dec 4, 2024
9887611
Bump step-security/harden-runner from 2.10.1 to 2.10.2 (#913)
dependabot[bot] Dec 4, 2024
0a58283
Bump actions/dependency-review-action from 4.4.0 to 4.5.0 (#912)
dependabot[bot] Dec 4, 2024
a97b298
fix: Add missing private dns zones to applicable policy assignment an…
oZakari Dec 4, 2024
fa9f33a
feat: move bootstrap examples (#924)
jaredfholgate Dec 13, 2024
fdb0b82
Delete .github/workflows/gh-ado-sync.yml (#927)
jtracey93 Dec 19, 2024
c1aded8
feat: Add SQL ATP status stream to DCR (#931)
arjenhuitema Jan 6, 2025
f025098
build: bump actions/upload-artifact from 4.4.3 to 4.5.0 (#930)
dependabot[bot] Jan 7, 2025
04b3a3a
refactor: Allow option to specify virtual network gateway ip configur…
oZakari Jan 7, 2025
02b0649
build: bump softprops/action-gh-release from 2.1.0 to 2.2.0 (#926)
dependabot[bot] Jan 7, 2025
455ce2b
build: bump github/codeql-action from 3.27.5 to 3.28.0 (#929)
dependabot[bot] Jan 7, 2025
c540c63
Fix policy assignment (#933)
oZakari Jan 7, 2025
2471b99
chore: Update version.json (#934)
oZakari Jan 7, 2025
794173a
build: bump softprops/action-gh-release from 2.2.0 to 2.2.1 (#938)
dependabot[bot] Jan 14, 2025
7d39a21
build: bump actions/upload-artifact from 4.5.0 to 4.6.0 (#937)
dependabot[bot] Jan 14, 2025
8d0fa7f
build: bump step-security/harden-runner from 2.10.2 to 2.10.3 (#935)
dependabot[bot] Jan 14, 2025
5402336
build: bump github/codeql-action from 3.28.0 to 3.28.1 (#936)
dependabot[bot] Jan 14, 2025
2edf93b
docs: Update Accelerator links (#940)
oZakari Jan 17, 2025
4a55500
Adding missing permissions (#946)
oZakari Jan 23, 2025
78c72cd
build: bump gaurav-nelson/github-action-markdown-link-check (#941)
dependabot[bot] Jan 23, 2025
ea79ef0
build: bump step-security/harden-runner from 2.10.3 to 2.10.4 (#942)
dependabot[bot] Jan 23, 2025
1ded231
chore: Update apiversions (#945)
oZakari Jan 23, 2025
5a7c193
Pin to ALZ PowerShell version which supports line endings function (#…
oZakari Feb 13, 2025
4c53301
build: bump github/codeql-action from 3.28.1 to 3.28.9 (#954)
dependabot[bot] Feb 13, 2025
7220781
Update update-policy.yml (#956)
oZakari Feb 13, 2025
605185b
fix: improve handling of definition versions in Bicep output (#963)
jtracey93 Feb 20, 2025
621d3fe
fix: Update Invoke-PolicyToBicep.ps1 formatting (#964)
oZakari Feb 20, 2025
3683fe1
Update Invoke-PolicyToBicep.ps1 (#965)
oZakari Feb 20, 2025
4b8287f
Fix script (#966)
oZakari Feb 20, 2025
a8e7803
resave file with changes (#967)
oZakari Feb 20, 2025
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
5 changes: 4 additions & 1 deletion .github/actions-config/mlc_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
{
"pattern": "^(https:\\/\\/)?([www.]?)+(microsoft.com\\/)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"
}
{
"pattern": "^mailto:"
}
],
"httpHeaders": [
{
Expand All @@ -27,4 +30,4 @@
203,
206
]
}
}
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ updates:
labels:
- "Type: Hygiene :broom:"
- "Needs: Attention :wave:"
commit-message:
prefix: 'build: '

39 changes: 29 additions & 10 deletions .github/scripts/Invoke-PolicyToBicep.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ param (
if (-not (Get-Module -ListAvailable -Name ALZ)) {
# Module doesn't exist, so install it
Write-Information "====> ALZ module isn't already installed. Installing..." -InformationAction Continue
Install-Module -Name ALZ -Force -Scope CurrentUser -ErrorAction Stop
Install-Module -Name ALZ -Force -Scope CurrentUser -ErrorAction Stop -RequiredVersion '4.1.5'
Write-Information "====> ALZ module now installed." -InformationAction Continue
} else {
}
else {
Write-Information "====> ALZ module is already installed." -InformationAction Continue
}

Expand Down Expand Up @@ -157,14 +158,24 @@ function New-PolicySetDefinitionsBicepInputTxtFile {
[System.Collections.Hashtable]$policySetDefinitionsOutputForBicep = [ordered]@{}

# Loop through child Policy Set/Initiative Definitions if HashTable not == 0
if (($policyDefinitions.Count) -ne 0) {
if ($policyDefinitions.Count -ne 0) {
$policyDefinitions | Sort-Object | ForEach-Object {
if ($null -ne $_.groupNames -and $_.groupNames.Count -ne 0) {
$joinedGroupNames = "'" + ($_.groupNames -join "','" ) + "'"
$policySetDefinitionsOutputForBicep.Add($_.policyDefinitionReferenceId, @($_.policyDefinitionId, $joinedGroupNames))
if (![string]::IsNullOrEmpty($_.definitionVersion)) {
$policySetDefinitionsOutputForBicep.Add($_.policyDefinitionReferenceId, @($_.policyDefinitionId, $joinedGroupNames, $_.definitionVersion))
}
else {
$policySetDefinitionsOutputForBicep.Add($_.policyDefinitionReferenceId, @($_.policyDefinitionId, $joinedGroupNames, ""))
}
}
else {
$policySetDefinitionsOutputForBicep.Add($_.policyDefinitionReferenceId, @($_.policyDefinitionId, ""))
if (![string]::IsNullOrEmpty($_.definitionVersion)) {
$policySetDefinitionsOutputForBicep.Add($_.policyDefinitionReferenceId, @($_.policyDefinitionId, "", $_.definitionVersion))
}
else {
$policySetDefinitionsOutputForBicep.Add($_.policyDefinitionReferenceId, @($_.policyDefinitionId, "", ""))
}
}
}
}
Expand All @@ -183,11 +194,20 @@ function New-PolicySetDefinitionsBicepInputTxtFile {
if (($policySetDefinitionsOutputForBicep.Count) -ne 0) {
$policySetDefinitionsOutputForBicep.Keys | Sort-Object | ForEach-Object {
$definitionReferenceId = $_

$definitionReferenceIdForParameters = $_
$definitionId = $($policySetDefinitionsOutputForBicep[$_][0])
$groups = $($policySetDefinitionsOutputForBicep[$_][1])
$definitionVersion = $($policySetDefinitionsOutputForBicep[$_][2])

# Ensure definitionVersion is always set to '' if empty, otherwise wrap it in single quotes
if ([string]::IsNullOrEmpty($definitionVersion)) {
$definitionVersion = "''"
} else {
$definitionVersion = "'$definitionVersion'"
}

# If definitionReferenceId or definitionReferenceIdForParameters contains apostrophes, replace that apostrophe with a backslash and an apostrohphe for Bicep string escaping
# If definitionReferenceId or definitionReferenceIdForParameters contains apostrophes, replace that apostrophe with a backslash and an apostrophe for Bicep string escaping
if ($definitionReferenceId.Contains("'")) {
$definitionReferenceId = $definitionReferenceId.Replace("'", "\'")
}
Expand All @@ -201,11 +221,10 @@ function New-PolicySetDefinitionsBicepInputTxtFile {
$definitionReferenceIdForParameters = "['$definitionReferenceIdForParameters']"

# Add nested array of objects to each Policy Set/Initiative Definition in the Bicep variable, without the '.' before the definitionReferenceId to make it an accessor
Add-Content -Path "$rootPath/$definitionsSetLongPath/$defintionsSetTxtFileName" -Encoding "utf8" -Value "`t`t`t{`r`n`t`t`t`tdefinitionReferenceId: '$definitionReferenceId'`r`n`t`t`t`tdefinitionId: '$definitionId'`r`n`t`t`t`tdefinitionParameters: $policySetDefParamVarCreation$definitionReferenceIdForParameters.parameters`r`n`t`t`t`tdefinitionGroups: [$groups]`r`n`t`t`t}"
}
else {
Add-Content -Path "$rootPath/$definitionsSetLongPath/$defintionsSetTxtFileName" -Encoding "utf8" -Value "`t`t`t{`r`n`t`t`t`tdefinitionReferenceId: '$definitionReferenceId'`r`n`t`t`t`tdefinitionId: '$definitionId'`r`n`t`t`t`tdefinitionParameters: $policySetDefParamVarCreation$definitionReferenceIdForParameters.parameters`r`n`t`t`t`tdefinitionGroups: [$groups]`r`n`t`t`t`tdefinitionVersion: $definitionVersion`r`n`t`t`t}"
} else {
# Add nested array of objects to each Policy Set/Initiative Definition in the Bicep variable
Add-Content -Path "$rootPath/$definitionsSetLongPath/$defintionsSetTxtFileName" -Encoding "utf8" -Value "`t`t`t{`r`n`t`t`t`tdefinitionReferenceId: '$definitionReferenceId'`r`n`t`t`t`tdefinitionId: '$definitionId'`r`n`t`t`t`tdefinitionParameters: $policySetDefParamVarCreation.$definitionReferenceIdForParameters.parameters`r`n`t`t`t`tdefinitionGroups: [$groups]`r`n`t`t`t}"
Add-Content -Path "$rootPath/$definitionsSetLongPath/$defintionsSetTxtFileName" -Encoding "utf8" -Value "`t`t`t{`r`n`t`t`t`tdefinitionReferenceId: '$definitionReferenceId'`r`n`t`t`t`tdefinitionId: '$definitionId'`r`n`t`t`t`tdefinitionParameters: $policySetDefParamVarCreation.$definitionReferenceIdForParameters.parameters`r`n`t`t`t`tdefinitionGroups: [$groups]`r`n`t`t`t`tdefinitionVersion: $definitionVersion`r`n`t`t`t}"
}
}
}
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/bicep-build-to-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ on:
- "**/bicepconfig.json"
workflow_dispatch: {}

permissions:
contents: read

jobs:
bicep_unit_tests:
name: Bicep Build & Lint All Modules
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- name: Checkout Repo
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

Expand Down Expand Up @@ -112,17 +119,21 @@ jobs:
azure_waf:
name: Test Azure Well-Architected Framework (PSRule)
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- name: Checkout Repo
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

# Add pipeline tests for Azure Well-Architected Framework.
# See https://aka.ms/ps-rule-action for configuration options.
- name: Run PSRule analysis
uses: Microsoft/ps-rule@v2
uses: Microsoft/ps-rule@46451b8f5258c41beb5ae69ed7190ccbba84112c # v2.9.0
with:
modules: PSRule.Rules.Azure
baseline: Azure.Preview
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,29 @@ on:
- main
workflow_dispatch: {}

permissions:
contents: read

jobs:
lint:
permissions:
contents: read # for actions/checkout to fetch code
statuses: write # for github/super-linter to mark status of each linter run
name: Lint code base
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Run github/super-linter
uses: github/super-linter@v7
uses: github/super-linter@b807e99ddd37e444d189cfd2c2ca1274d8ae8ef1 # v7
env:
# Lint all code - disabled in as part of #262
VALIDATE_ALL_CODEBASE: false
Expand All @@ -40,15 +49,19 @@ jobs:
markdown-link-check:
name: Markdown Link Check
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@master
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # master
with:
fetch-depth: 0

- name: Check links in markdown files
uses: gaurav-nelson/[email protected].15
uses: gaurav-nelson/github-action-markdown-link-check@1b916f2cf6c36510a6059943104e3c42ce6c16bc # 1.0.16
with:
config-file: ".github/actions-config/mlc_config.json"
use-verbose-mode: "yes"
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required,
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
27 changes: 0 additions & 27 deletions .github/workflows/gh-ado-sync.yml

This file was deleted.

13 changes: 12 additions & 1 deletion .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@ on:
- edited
- synchronize

permissions:
contents: read

jobs:
main:
permissions:
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 10 additions & 2 deletions .github/workflows/psdocs-mdtogit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,23 @@ env:
github_pr_repo: ${{ github.event.pull_request.head.repo.full_name }}

permissions:
contents: write
contents: read

jobs:
arm_docs:
name: Generate Markdown
permissions:
contents: write
runs-on: ubuntu-latest
environment: BicepUpdateDocumentation
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Show env
run: env | sort
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,30 @@ on:
- main
workflow_dispatch: {}

permissions:
contents: read

jobs:
release-tests:
name: Pre-Release Tests
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- name: Checkout Repo
id: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Pester Tests
id: pester
if: startsWith(github.head_ref, 'release')
uses: azure/powershell@v2
uses: azure/powershell@53dd145408794f7e80f97cfcca04155c85234709 # v2.0.0
with:
inlineScript: |
Import-Module Pester -Force
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ on:
- main

permissions:
contents: write
contents: read

jobs:
release:
name: Generate Accelerator Release Artifacts
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Zip and Tar
run: |
Expand All @@ -28,15 +35,15 @@ jobs:
zip -r ../accelerator.zip .

- name: Upload Artifacts to Action
uses: actions/upload-artifact@v4.4.0
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: accelerator
path: |
accelerator.tar.gz
accelerator.zip

- name: Add Artifacts to Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
Expand Down
Loading
Loading