@@ -154,7 +154,7 @@ catch {
154
154
try {
155
155
foreach ($file in Get-ChildItem - Path " $LibraryPath /platform/$ ( $Type.ToLower ()) /archetype_definitions" - Recurse - File - Include * .json) {
156
156
$archetypeContent = Get-Content - Path $file.FullName - Raw | ConvertFrom-Json
157
- foreach ($requiredAssignment in $archetypeContent.policy_assignments ) {
157
+ foreach ($requiredAssignment in ( $archetypeContent.policy_assignments | Where-Object { ( $_ -notmatch " ^Enforce-(GR|Encrypt)-\w+0 " ) }) ) {
158
158
switch ($Type ) {
159
159
" ALZ" { $fileContent = Get-ChildItem - Path " $LibraryPath /platform/$ ( $Type.ToLower ()) /policy_assignments" | Where-Object { $_.BaseName.Split (" ." )[0 ] -eq $requiredAssignment } | Get-Content - Raw | ConvertFrom-Json }
160
160
" AMBA" { $fileContent = Get-ChildItem - Path " $LibraryPath /platform/$ ( $Type.ToLower ()) /policy_assignments" | Where-Object { $_.BaseName.Split (" ." )[0 ].Replace(" _" , " -" ) -eq $requiredAssignment } | Get-Content - Raw | ConvertFrom-Json }
@@ -277,14 +277,14 @@ try {
277
277
if ($CreateGuardrailAssignments -and $Type -eq " ALZ" ) {
278
278
foreach ($deployment in $structureFile.enforceGuardrails.deployments ) {
279
279
foreach ($file in Get-ChildItem " $LibraryPath /platform/$ ( $Type.ToLower ()) /policy_set_definitions" - Recurse - File - Include * .json) {
280
- if (($file.Name -match " ^Enforce-Guardrails" ) -and ($file.Name.Split (" ." )[0 ] -in $deployment.policy_set_names )) {
280
+ if (($file.Name -match " ^Enforce-( Guardrails|Encryption)- " ) -and ($file.Name.Split (" ." )[0 ] -in $deployment.policy_set_names )) {
281
281
$fileContent = Get-Content - Path $file.FullName - Raw | ConvertFrom-Json - Depth 100
282
282
283
283
$baseTemplate = [ordered ]@ {
284
284
" `$ schema" = " https://raw.githubusercontent.com/Azure/enterprise-azure-policy-as-code/main/Schemas/policy-assignment-schema.json"
285
285
nodeName = " $ ( $fileContent.name ) "
286
286
assignment = [ordered ]@ {
287
- name = $fileContent.Name -replace " Enforce-Guardrails" , " GR"
287
+ name = $fileContent.Name -replace " Enforce-Guardrails" , " GR" -replace " Enforce-Encryption " , " EN "
288
288
displayName = $fileContent.properties.displayName
289
289
description = $fileContent.properties.description
290
290
}
0 commit comments