Skip to content

Commit 53355fb

Browse files
authored
update az monitor assignment and storage account definitions (#8)
* Add microsoft.com to allowed email domains for Azure Monitor policies * Remove application tag restrictions from storage account policies * Remove deprecated pipeline template deployment script from integration test config * Enhance verbose logging in policy integration test case retrieval
1 parent 46dcb1a commit 53355fb

File tree

8 files changed

+7
-53
lines changed

8 files changed

+7
-53
lines changed

policyAssignments/dev/pa-d-monitor.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
},
1515
"MON-001_allowedEmailDomains": {
1616
"value": [
17-
"contoso.com"
17+
"contoso.com",
18+
"microsoft.com"
1819
]
1920
},
2021
"MON-002_Effect": {

policyAssignments/prod/pa-p-monitor.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
},
1515
"MON-001_allowedEmailDomains": {
1616
"value": [
17-
"contoso.com"
17+
"contoso.com",
18+
"microsoft.com"
1819
]
1920
},
2021
"MON-002_Effect": {

policyDefinitions/storage-account/pol-deny-storage-account-public-endpoint.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,6 @@
3232
"field": "type",
3333
"equals": "Microsoft.Storage/storageAccounts"
3434
},
35-
{
36-
"not": {
37-
"field": "tags[application]",
38-
"equals": "databricks"
39-
}
40-
},
41-
{
42-
"not": {
43-
"field": "tags[application]",
44-
"equals": "purview"
45-
}
46-
},
4735
{
4836
"anyOf": [
4937
{

policyDefinitions/storage-account/pol-deny-storage-account-restrict-virtual-network-rules.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@
3333
"field": "type",
3434
"equals": "Microsoft.Storage/storageAccounts"
3535
},
36-
{
37-
"not": {
38-
"field": "tags[application]",
39-
"equals": "databricks"
40-
}
41-
},
42-
{
43-
"not": {
44-
"field": "tags[application]",
45-
"equals": "purview"
46-
}
47-
},
4836
{
4937
"anyOf": [
5038
{

policyDefinitions/storage-account/pol-deny-storage-accounts-should-restrict-network-access.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@
3333
"field": "type",
3434
"equals": "Microsoft.Storage/storageAccounts"
3535
},
36-
{
37-
"not": {
38-
"field": "tags[application]",
39-
"equals": "databricks"
40-
}
41-
},
42-
{
43-
"not": {
44-
"field": "tags[application]",
45-
"equals": "purview"
46-
}
47-
},
4836
{
4937
"field": "Microsoft.Storage/storageAccounts/networkAcls.defaultAction",
5038
"notEquals": "Deny"

policyDefinitions/storage-account/pol-deploy-storage-account-blob-soft-delete.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,6 @@
5555
"field": "type",
5656
"equals": "Microsoft.Storage/storageAccounts"
5757
},
58-
{
59-
"not": {
60-
"field": "tags[application]",
61-
"equals": "databricks"
62-
}
63-
},
64-
{
65-
"not": {
66-
"field": "tags[application]",
67-
"equals": "purview"
68-
}
69-
},
7058
{
7159
"field": "kind",
7260
"in": [

scripts/pipelines/policy-integration-tests/pipeline-map-policy-integration-test-cases.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,11 @@ function getTestCasesFromAssignment {
159159
[string]$policyIntegrationTestsPath
160160
)
161161
$testsInScope = @()
162-
$testCases = Get-ChildItem -path $policyIntegrationTestsPath -Depth 1 -Directory
162+
Write-Verbose " - Looking for test cases that are impacted by the policy assignment '$assignmentName' from '$policyIntegrationTestsPath'." -Verbose
163+
$testCases = Get-ChildItem -path $policyIntegrationTestsPath -Depth 0 -Directory
163164

164165
foreach ($testCase in $testCases) {
166+
Write-Verbose " - Checking test case '$($testCase.Name)' for assignment '$assignmentName'..." -Verbose
165167
$testConfigFile = join-Path -Path $testCase.FullName -ChildPath 'config.json' -Resolve
166168
$testConfig = Get-Content -Path $testConfigFile -Raw | ConvertFrom-Json -Depth 99
167169
$policyAssignmentIds = $testConfig.policyAssignmentIds
@@ -523,7 +525,6 @@ Foreach ($file in $modifiedFiles) {
523525
Write-Verbose " - File '$file' is not in the global test paths. Will Check if individual tests need to be executed." -Verbose
524526
$getRequiredTestCasesParams = @{
525527
changeFilePath = $file
526-
policyIntegrationTestsPath = $policyIntegrationTestsPath
527528
policyInitiativesPath = $policyInitiativesPath
528529
policyAssignmentsPath = $policyAssignmentsPath
529530
gitRoot = $gitRoot

tests/policy-integration-tests/.shared/policy_integration_test_config.jsonc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
"scripts/pipelines/pipeline-get-deployment-target-from-parameter-file.ps1",
120120
"scripts/pipelines/pipeline-get-parameter-files.ps1",
121121
"scripts/pipelines/pipeline-install-moduleFromRepo.ps1",
122-
"scripts/pipelines/pipeline-template-deployment.ps1",
123122
"scripts/pipelines/pipeline-template-deployment-rest.ps1",
124123
"scripts/pipelines/pipeline-template-validation.ps1",
125124
"scripts/pipelines/pipeline-set-policy-resource-bicep-template-file.ps1",

0 commit comments

Comments
 (0)