Skip to content

Commit

Permalink
[Enhancement] GR12 marketplace logic update (#112)
Browse files Browse the repository at this point in the history
* GR 12 marketplace logic update

* deleting commented lines and adding new zip modules

* module version update for GR-complianceCheck

* fix mitigationCommands

* update FR comments and zipped module
  • Loading branch information
dutt0 authored Mar 21, 2024
1 parent e5502f4 commit f57a5de
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 11 deletions.
Binary file modified psmodules/Check-PrivateMarketPlace.zip
Binary file not shown.
Binary file modified psmodules/GR-ComplianceChecks.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions setup/IaC/modules/automationaccount.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ resource module14 'modules' = if (newDeployment || updatePSModules) {
properties: {
contentLink: {
uri: '${ModuleBaseURL}/Check-PrivateMarketPlace.zip'
version: '1.1.3'
version: '1.1.4'
}
}
}
Expand Down Expand Up @@ -212,7 +212,7 @@ resource module14 'modules' = if (newDeployment || updatePSModules) {
properties: {
contentLink: {
uri: '${ModuleBaseURL}/GR-ComplianceChecks.zip'
version: '1.4.7'
version: '1.4.8'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
RootModule = 'Check-PrivateMarketPlace'

# Version number of this module.
ModuleVersion = '1.1.3'
ModuleVersion = '1.1.4'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $Object = New-Object PSObject
[PSCustomObject] $ErrorList = New-Object System.Collections.ArrayList

try {
[String] $PrivateMarketPlace= Get-AzMarketplacePrivateStore -ErrorAction Stop
$PrivateMarketPlace = Get-AzMarketplacePrivateStore -ErrorAction Stop
}
catch {
$ErrorList.Add("Failed to execute the 'Get-AzMarketplacePrivateStore'--ensure that the Az.Marketplace module is installed `
Expand All @@ -27,12 +27,23 @@ if($null -eq $PrivateMarketPlace){
$Object| Add-Member NoteProperty -Name Comments -Value $msgTable.mktPlaceNotCreated
$MitigationCommands = $msgTable.enableMktPlace
}
else {
else {
$IsCompliant= $true
$Object| Add-Member NoteProperty -Name ComplianceStatus -Value $IsCompliant
$Object| Add-Member NoteProperty -Name Comments -Value "$($msgTable.mktPlaceCreated) - $($PrivateMarketPlace.PrivateStoreId)"
$MitigationCommands = ""

# Extract availability for the private store
$availability = $PrivateMarketPlace.Availability
if ($availability -eq "enabled"){
$Object| Add-Member NoteProperty -Name Comments -Value "$($msgTable.mktPlaceCreatedEnabled) - $($PrivateMarketPlace.PrivateStoreId)"
$MitigationCommands = ""
}
else{
$IsCompliant= $false
$Object| Add-Member NoteProperty -Name Comments -Value $msgTable.mktPlaceCreatedNotEnabled
$MitigationCommands = $msgTable.enableMktPlace
}
}

$Object| Add-Member NoteProperty -Name ComplianceStatus -Value $IsCompliant
$Object| Add-Member -MemberType NoteProperty -Name ControlName -Value $ControlName -Force | Out-Null
$Object| Add-Member -MemberType NoteProperty -Name ReportTime -Value $ReportTime -Force | Out-Null
$Object| Add-Member -MemberType NoteProperty -Name MitigationCommands -Value $MitigationCommands -Force| Out-Null
Expand Down
3 changes: 2 additions & 1 deletion src/GuardRails-Localization/GR-ComplianceChecks-Msgs.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ severityNotificationToEmailConfigured = Severity Notifications to a Primary Emai
# GuardRail #12
mktPlaceCreation = MarketPlaceCreation
mktPlaceCreated = The Private Marketplace has been created.
mktPlaceCreatedEnabled = The Private Marketplace has been created and enabled.
mktPlaceCreatedNotEnabled = The Private Marketplace has been created but not enabled.
mktPlaceNotCreated = The Private Marketplace has not been created.
enableMktPlace = Enable Azure Private MarketPlace as per: https://docs.microsoft.com/en-us/marketplace/create-manage-private-azure-marketplace-new
Expand Down
2 changes: 1 addition & 1 deletion src/GuardRails-Localization/GR-ComplianceChecks.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
RootModule = 'GR-ComplianceChecks'

# Version number of this module.
ModuleVersion = '1.4.7'
ModuleVersion = '1.4.8'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ severityNotificationToEmailConfigured = Notifications de sévérité à un e-mai
# GuardRail #12
mktPlaceCreation = Création Place de marché
mktPlaceCreated = Le marché privé a été créé.
mktPlaceCreatedEnabled = Le marché privé a été créé et activé.
mktPlaceCreatedNotEnabled = Le marché privé a été créé, mais n'est pas activé.
mktPlaceNotCreated = Le marché privé n'a pas été créé.
enableMktPlace = Activer Azure Private MarketPlace selon: https://docs.microsoft.com/en-us/marketplace/create-manage-private-azure-marketplace-new
Expand Down

0 comments on commit f57a5de

Please sign in to comment.