forked from Azure/Enterprise-Scale
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
264 changed files
with
38,048 additions
and
6,450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Policy Submission | ||
description: Submit an Azure policy/initiative for Azure Landing Zone | ||
title: "[Policy]: " | ||
labels: ["policy"] | ||
projects: [] | ||
assignees: | ||
- springstone | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: Thanks for taking the time to fill out this policy submission! | ||
- type: dropdown | ||
id: policytype | ||
attributes: | ||
label: Policy Definition or Initiative | ||
description: Are you proposing a policy definition or initiative definition? | ||
options: | ||
- Definition | ||
- Initiative | ||
- Not sure | ||
default: 0 | ||
validations: | ||
required: true | ||
- type: dropdown | ||
id: builtincustom | ||
attributes: | ||
label: Built-in/Custom | ||
description: Is the policy definition or initiative built-in or are you proposing a custom one? | ||
options: | ||
- Built-in | ||
- Custom | ||
- Not sure | ||
default: 0 | ||
validations: | ||
required: true | ||
- type: input | ||
id: resourceid | ||
attributes: | ||
label: Built-in policy definition or initiative ID | ||
description: If this is for a built in policy definition or initiative, please provide the resource ID | ||
value: "<GUID>" | ||
validations: | ||
required: false | ||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Custom policy definition or initiative description | ||
description: If this is a custom policy definition or initiative, please provide a description of what it should do. | ||
placeholder: A policy that | ||
value: "A policy that does ..." | ||
validations: | ||
required: true | ||
- type: dropdown | ||
id: assignmentscope | ||
attributes: | ||
label: Scope | ||
description: What scope (Management Group) should the policy definition or initiative be assigned to? | ||
options: | ||
- Intermediate Root | ||
- Platform | ||
- Connectivity | ||
- Management | ||
- Identity | ||
- Landing Zones | ||
- Corp | ||
- Online | ||
- Decommissioned | ||
- Sandbox | ||
- Multiple / Other | ||
default: 0 | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: defaultassignment | ||
attributes: | ||
label: Default Assignment | ||
description: Should the policy definition or initiative be assigned by default to the scope above in Azure Landing Zone? | ||
options: | ||
- label: "Yes" | ||
- type: textarea | ||
id: Comments | ||
attributes: | ||
label: Comments/thoughts | ||
description: Do you have any additional comments/thoughts? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Import-Module -Name $PSScriptRoot\PolicyPesterTestHelper.psm1 -Force -Verbose | ||
Import-Module Pester -Force | ||
|
||
function RunPester | ||
{ | ||
param ( | ||
[Parameter()] | ||
[String]$PolicyTest | ||
) | ||
|
||
$pesterConfiguration = @{ | ||
Run = @{ | ||
Container = New-PesterContainer -Path $PolicyTest | ||
PassThru = $true | ||
} | ||
Output = @{ | ||
Verbosity = 'Detailed' | ||
CIFormat = 'Auto' | ||
} | ||
} | ||
$result = Invoke-Pester -Configuration $pesterConfiguration | ||
#exit $result.FailedCount | ||
} | ||
|
||
$ModifiedFiles = @(Get-PolicyFiles -DiffFilter "M") | ||
if ([String]::IsNullOrEmpty($ModifiedFiles)) | ||
{ | ||
Write-Warning "These are the modified policies: $($ModifiedFiles)" | ||
} | ||
else | ||
{ | ||
Write-Warning "There are no modified policies" | ||
} | ||
|
||
$AddedFiles = @(Get-PolicyFiles -DiffFilter "A") | ||
if ([String]::IsNullOrEmpty($AddedFiles)) | ||
{ | ||
Write-Warning "These are the added policies: $($AddedFiles)" | ||
} | ||
else | ||
{ | ||
Write-Warning "There are no added policies" | ||
} | ||
|
||
$ModifiedAddedFiles = $ModifiedFiles + $AddedFiles | ||
|
||
$ModifiedAddedFiles | ForEach-Object { | ||
|
||
$PolicyFile = Split-Path $_ -Leaf | ||
$PolicyFileClean = $PolicyFile -replace ".json", "" | ||
|
||
$testPath = "tests/policy/$($PolicyFileClean).Tests.ps1" | ||
|
||
if (Test-Path $testPath) | ||
{ | ||
Write-Warning "Running pester tests on $PolicyFileClean" | ||
RunPester($testPath) | ||
} | ||
else | ||
{ | ||
Write-Warning "There are no tests for $PolicyFileClean" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.