Skip to content

Commit 4f06cc8

Browse files
Merge pull request #221 from JulianHayward/mssgck
6.3.7
2 parents eba7689 + 3cec9da commit 4f06cc8

5 files changed

Lines changed: 58 additions & 50 deletions

File tree

README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,9 @@ The [Azure Governance Visualizer Accelerator](https://github.com/Azure/Azure-Gov
7878

7979
## Release history
8080

81-
__Changes__ (2023-Dec-17 / 6.3.6 Minor)
81+
__Changes__ (2024-Jan-08 / 6.3.7 Minor)
8282

83-
* fix: processing of Service Principal names that contain special characters
84-
* fix: RBAC reporting correct RBAC Role assignment related Policy assignment Policy definition displayName
85-
* update ARM API-version for CostManagement. Using `2023-03-01` instead of `2019-11-01`
86-
87-
__Changes__ (2023-Dec-15 / 6.3.5 Minor)
88-
89-
* Checking if the response of the storage account properties request is a byte array (type 'byte[]') and decode it to a string
90-
* Different handling of BOM (Byte order mark) for XML returns on storage account properties request (since Powershell version 7.4.0)
91-
* use [AzAPICall](https://aka.ms/AzAPICall) PowerShell module version 1.1.85
83+
* fix: Ignore `ARMLocation` in case not Public Cloud (AzureCloud)
9284

9385
[Full release history](history.md)
9486

history.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
### Azure Governance Visualizer version 6
66

7+
__Changes__ (2024-Jan-08 / 6.3.7 Minor)
8+
9+
* fix: Ignore `ARMLocation` in case not Public Cloud (AzureCloud)
10+
711
__Changes__ (2023-Dec-17 / 6.3.6 Minor)
812

913
* fix: processing of Service Principal names that contain special characters

pwsh/AzGovVizParallel.ps1

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ Param
365365
$Product = 'AzGovViz',
366366

367367
[string]
368-
$ProductVersion = '6.3.6',
368+
$ProductVersion = '6.3.7',
369369

370370
[string]
371371
$GithubRepository = 'aka.ms/AzGovViz',
@@ -33865,25 +33865,31 @@ Write-Host " Initialize 'AzAPICall' succeeded" -ForegroundColor Green
3386533865
Write-Host " Setting `$ignoreARMLocation to `$false" -ForegroundColor Yellow
3386633866
$ignoreARMLocation = $false
3386733867

33868-
if ($azApiCallConf['htParameters'].ARMLocations.count -gt 0) {
33869-
Write-Host ''
33870-
Write-Host "Check if provided parameter value for -ARMLocation '$($ARMLocation)' is valid"
33871-
if ($azApiCallConf['htParameters'].ARMLocations -notcontains $ARMLocation) {
33872-
Write-Host " Parameter value for -ARMLocation '$($ARMLocation)' is not valid - please provide a valid ARMLocation" -ForegroundColor DarkRed
33873-
Write-Host " Valid ARMLocations: '$($azApiCallConf['htParameters'].ARMLocations -join ', ')'" -ForegroundColor Yellow
33874-
throw 'ARMLocation validation failed!'
33868+
if ($azApiCallConf['htParameters'].azureCloudEnvironment -ne 'AzureCloud') {
33869+
Write-Host " Non Public Cloud ($($azApiCallConf['htParameters'].azureCloudEnvironment)) -> Setting `$ignoreARMLocation to `$true" -ForegroundColor Yellow
33870+
$ignoreARMLocation = $true
33871+
}
33872+
33873+
if (-not $ignoreARMLocation) {
33874+
if ($azApiCallConf['htParameters'].ARMLocations.count -gt 0) {
33875+
Write-Host ''
33876+
Write-Host "Check if provided parameter value for -ARMLocation '$($ARMLocation)' is valid"
33877+
if ($azApiCallConf['htParameters'].ARMLocations -notcontains $ARMLocation) {
33878+
Write-Host " Parameter value for -ARMLocation '$($ARMLocation)' is not valid - please provide a valid ARMLocation" -ForegroundColor DarkRed
33879+
Write-Host " Valid ARMLocations: '$($azApiCallConf['htParameters'].ARMLocations -join ', ')'" -ForegroundColor Yellow
33880+
throw 'ARMLocation validation failed!'
33881+
}
33882+
else {
33883+
Write-Host " Parameter value for -ARMLocation '$($ARMLocation)' is valid" -ForegroundColor Green
33884+
}
3387533885
}
3387633886
else {
33877-
Write-Host " Parameter value for -ARMLocation '$($ARMLocation)' is valid" -ForegroundColor Green
33887+
Write-Host ''
33888+
Write-Host "Skipping ARMLocation validation - no locations found in '`$azApiCallConf['htParameters'].ARMLocations'. (-SkipAzContextSubscriptionValidation = '$skipAzContextSubscriptionValidation')"
33889+
Write-Host " Setting `$ignoreARMLocation to `$true" -ForegroundColor Yellow
33890+
$ignoreARMLocation = $true
3387833891
}
3387933892
}
33880-
else {
33881-
Write-Host ''
33882-
Write-Host "Skipping ARMLocation validation - no locations found in '`$azApiCallConf['htParameters'].ARMLocations'. (-SkipAzContextSubscriptionValidation = '$skipAzContextSubscriptionValidation')"
33883-
Write-Host " Setting `$ignoreARMLocation to `$true" -ForegroundColor Yellow
33884-
$ignoreARMLocation = $true
33885-
}
33886-
3388733893
#EndRegion initAZAPICall
3388833894

3388933895
#region required AzAPICall version

pwsh/dev/devAzGovVizParallel.ps1

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ Param
365365
$Product = 'AzGovViz',
366366

367367
[string]
368-
$ProductVersion = '6.3.6',
368+
$ProductVersion = '6.3.7',
369369

370370
[string]
371371
$GithubRepository = 'aka.ms/AzGovViz',
@@ -12462,7 +12462,7 @@ function processStorageAccountAnalysis {
1246212462
else {
1246312463
try {
1246412464
# ? https://github.com/JulianHayward/Azure-MG-Sub-Governance-Reporting/issues/218#issuecomment-1854516882
12465-
if($saProperties.gettype().Name -eq 'Byte[]') {
12465+
if ($saProperties.gettype().Name -eq 'Byte[]') {
1246612466
$byteArray = [byte[]]$saProperties
1246712467
$saProperties = [System.Text.Encoding]::UTF8.GetString($byteArray)
1246812468
}
@@ -12504,7 +12504,7 @@ function processStorageAccountAnalysis {
1250412504

1250512505
if ($listContainersSuccess -eq $true) {
1250612506
# ? https://github.com/JulianHayward/Azure-MG-Sub-Governance-Reporting/issues/218#issuecomment-1854516882
12507-
if($listContainers.gettype().Name -eq 'Byte[]') {
12507+
if ($listContainers.gettype().Name -eq 'Byte[]') {
1250812508
$byteArray = [byte[]]$listContainers
1250912509
$listContainers = [System.Text.Encoding]::UTF8.GetString($byteArray)
1251012510
}
@@ -29076,10 +29076,10 @@ function validateLeastPrivilegeForUser {
2907629076
$uri = "$($azAPICallConf['azAPIEndpointUrls'].ARM)/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01&`$filter=principalId eq '$($azapicallConf['htParameters'].userObjectId)'"
2907729077
$method = 'GET'
2907829078
$getRoleAssignmentsForExecutingUserAtManagementGroupId = AzAPICall -AzAPICallConfiguration $azapicallConf -uri $uri
29079-
$nonReaderRolesAssigned = ($getRoleAssignmentsForExecutingUserAtManagementGroupId.properties.RoleDefinitionId | Sort-object -Unique).where({$_ -notlike '*acdd72a7-3385-48ef-bd42-f606fba81ae7'})
29079+
$nonReaderRolesAssigned = ($getRoleAssignmentsForExecutingUserAtManagementGroupId.properties.RoleDefinitionId | Sort-Object -Unique).where({ $_ -notlike '*acdd72a7-3385-48ef-bd42-f606fba81ae7' })
2908029080
if ($nonReaderRolesAssigned.Count -gt 0) {
29081-
Write-Host "* * * LEAST PRIVILEGE ADVICE" -ForegroundColor DarkRed
29082-
Write-Host "The Azure Governance Visualizer script is executed with more permissions than required."
29081+
Write-Host '* * * LEAST PRIVILEGE ADVICE' -ForegroundColor DarkRed
29082+
Write-Host 'The Azure Governance Visualizer script is executed with more permissions than required.'
2908329083
Write-Host "The executing identity '$($azapicallConf['checkContext'].Account.Id)' ($($azapicallConf['checkContext'].Account.Type)) Id: '$($azapicallConf['htparameters'].userObjectId)' has the following RBAC Role(s) assigned at Management Group scope '$ManagementGroupId':"
2908429084
foreach ($nonReaderRoleAssigned in $nonReaderRolesAssigned) {
2908529085
$currentTask = "Get RBAC Role definition '$nonReaderRoleAssigned'"
@@ -29090,14 +29090,14 @@ function validateLeastPrivilegeForUser {
2909029090
if ($getRole.properties.roleName -eq 'owner' -or $getRole.properties.roleName -eq 'contributor') {
2909129091
Write-Host " - $($getRole.properties.roleName) ($($getRole.properties.type)) !!!"
2909229092
}
29093-
else{
29093+
else {
2909429094
Write-Host " - $($getRole.properties.roleName) ($($getRole.properties.type))"
2909529095
}
2909629096
}
2909729097
Write-Host "The required Azure RBAC role at Management Group scope '$ManagementGroupId' is 'Reader' (acdd72a7-3385-48ef-bd42-f606fba81ae7)."
2909829098
Write-Host "Recommendation: consider executing the script in context of a Service Principal with least privilege. Review the Azure Governance Visualizer Setup Guide at 'https://github.com/JulianHayward/Azure-MG-Sub-Governance-Reporting/blob/master/setup.md'"
2909929099
Write-Host ' * * * * * * * * * * * * * * * * * * * * * *' -ForegroundColor DarkRed
29100-
pause
29100+
Pause
2910129101
}
2910229102
else {
2910329103
Write-Host "Azure Governance Visualizer Least Privilege check (Azure Resource side) for executing identity '$($azapicallConf['checkContext'].Account.Id)' ($($azapicallConf['checkContext'].Account.Type)) Id: '$($azapicallConf['htparameters'].userObjectId)' succeeded" -ForegroundColor Green
@@ -33863,25 +33863,31 @@ Write-Host " Initialize 'AzAPICall' succeeded" -ForegroundColor Green
3386333863
Write-Host " Setting `$ignoreARMLocation to `$false" -ForegroundColor Yellow
3386433864
$ignoreARMLocation = $false
3386533865

33866-
if ($azApiCallConf['htParameters'].ARMLocations.count -gt 0) {
33867-
Write-Host ''
33868-
Write-Host "Check if provided parameter value for -ARMLocation '$($ARMLocation)' is valid"
33869-
if ($azApiCallConf['htParameters'].ARMLocations -notcontains $ARMLocation) {
33870-
Write-Host " Parameter value for -ARMLocation '$($ARMLocation)' is not valid - please provide a valid ARMLocation" -ForegroundColor DarkRed
33871-
Write-Host " Valid ARMLocations: '$($azApiCallConf['htParameters'].ARMLocations -join ', ')'" -ForegroundColor Yellow
33872-
throw 'ARMLocation validation failed!'
33866+
if ($azApiCallConf['htParameters'].azureCloudEnvironment -ne 'AzureCloud') {
33867+
Write-Host " Non Public Cloud ($($azApiCallConf['htParameters'].azureCloudEnvironment)) -> Setting `$ignoreARMLocation to `$true" -ForegroundColor Yellow
33868+
$ignoreARMLocation = $true
33869+
}
33870+
33871+
if (-not $ignoreARMLocation) {
33872+
if ($azApiCallConf['htParameters'].ARMLocations.count -gt 0) {
33873+
Write-Host ''
33874+
Write-Host "Check if provided parameter value for -ARMLocation '$($ARMLocation)' is valid"
33875+
if ($azApiCallConf['htParameters'].ARMLocations -notcontains $ARMLocation) {
33876+
Write-Host " Parameter value for -ARMLocation '$($ARMLocation)' is not valid - please provide a valid ARMLocation" -ForegroundColor DarkRed
33877+
Write-Host " Valid ARMLocations: '$($azApiCallConf['htParameters'].ARMLocations -join ', ')'" -ForegroundColor Yellow
33878+
throw 'ARMLocation validation failed!'
33879+
}
33880+
else {
33881+
Write-Host " Parameter value for -ARMLocation '$($ARMLocation)' is valid" -ForegroundColor Green
33882+
}
3387333883
}
3387433884
else {
33875-
Write-Host " Parameter value for -ARMLocation '$($ARMLocation)' is valid" -ForegroundColor Green
33885+
Write-Host ''
33886+
Write-Host "Skipping ARMLocation validation - no locations found in '`$azApiCallConf['htParameters'].ARMLocations'. (-SkipAzContextSubscriptionValidation = '$skipAzContextSubscriptionValidation')"
33887+
Write-Host " Setting `$ignoreARMLocation to `$true" -ForegroundColor Yellow
33888+
$ignoreARMLocation = $true
3387633889
}
3387733890
}
33878-
else {
33879-
Write-Host ''
33880-
Write-Host "Skipping ARMLocation validation - no locations found in '`$azApiCallConf['htParameters'].ARMLocations'. (-SkipAzContextSubscriptionValidation = '$skipAzContextSubscriptionValidation')"
33881-
Write-Host " Setting `$ignoreARMLocation to `$true" -ForegroundColor Yellow
33882-
$ignoreARMLocation = $true
33883-
}
33884-
3388533891
#EndRegion initAZAPICall
3388633892

3388733893
#region required AzAPICall version

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"ProductVersion": "6.3.6"
2+
"ProductVersion": "6.3.7"
33
}

0 commit comments

Comments
 (0)