From 901c8656da92799e14cfb38ea34c6161fe1234c0 Mon Sep 17 00:00:00 2001 From: singhgss <146129702+singhgss@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:50:18 -0500 Subject: [PATCH] [Enhancement] Encrypted Standard String (#316) * initial commit * update * undo changes * update * update * update * update modules --- .../Deploy-GuardrailsSolutionAccelerator.zip | Bin 0 -> 7568 bytes .../Deploy-GuardrailsSolutionAccelerator.psd1 | 2 +- .../Deploy-GuardrailsSolutionAccelerator.psm1 | 9 +++++---- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 psmodules/Deploy-GuardrailsSolutionAccelerator.zip diff --git a/psmodules/Deploy-GuardrailsSolutionAccelerator.zip b/psmodules/Deploy-GuardrailsSolutionAccelerator.zip new file mode 100644 index 0000000000000000000000000000000000000000..f8233bea4aa8881c93fa53b4f7e77e6579d22bbc GIT binary patch literal 7568 zcmb7pRZtxOuO_a=-Syz^uEpKu;O_3$QVzu_?(Xh(aCa?G+}#evwRHRM&g|^N-kE!o zhfFe)FK^!@`P7wQ;c%g#ppc-ZEK>{wC`|X+;h~^(F`%Fr|5ZO*yE(b~v&wm!dsumx z+dFw`xjK1!*}J+(T3T8=S$mj!xq7gKle(8;T4di;{*>RsEl^ z8zKiUdpqMd0u(M|uhfec-k<(l3J^%eNK_lMVn`%=_TJ^boyoRH*6C=L%XH6X>|hy8JG?0TrOJ+wiOQ?w$3e|f zsKBJg$y;sp2?6j4&mD>-fYmz9NRe>50`@9PjB46E18RU61g&Kvto;OuzarWlpemJJlWG$w&|0wkDY`scho0B&$u)t$1i2)j7C%V~>)Ldr8_lij1 zBK#oS=T(kJ94g)l8`vwK8yfiiyf|R?MTqp4CL}1R<85t`2+ybRmHhJ_obeL!`8RN3`m>v(};de1zExZe`pE$t&{;Oc3&rzSdUSaVr4qH1Wr&d0EVovEcM=_ zaqKVzwywnX?6jWw_UA|^hN4uOb-kt%J=(QX-Mi36ET-q5!g&^u}0H>&_E$?$4g zgGWa4syu&9ka|#h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sZg9s}&iTPoMM#dMt%fYu}o z()0)8EUaiAQw}-3N<5p%jLTSA=i;d`PGVYkDx=ywG=5V7 z8EPyEpMkA`1$zgsm&%mX`Y>iVHvLk5c8ku%uw%zZQo56VB2@oJa>Ufqtn{-+I!?`T zPT)3KC(+Q>GSRHm9uK7h-$jkhB8#Hn;^b#N_}0f-#_6Vj3d?TIjZ{?x1*@I*Pn=y}c*@jAqYtA#?M#o~6Mu?Eppn zP|&!<&$zHt@kYO)tR|Xv7F!ImmPrDqS8qzef{#e5--JdwHC$Tk=gj7UBv>)59~9^& zDh3u27ZJ9?r;?}-Jr8)K zIn9$c*)$-K+)8Hd1SLnT%nUBog@Ri4nzGGW2$Mf}{z!~g7u0UBF&f|p)nh8+cSy0ts z|4HtKQfHJ@zwIH&jvWDbGn$GdpIqW=pYnWBJs>&&b^*}!qEgJP zsw+Xm;KKgbYUV#d^M6}O=zqe0Tig79VgG;c`u_t81yvI2^G`bcZ^Alrsw=@G{HGP> NpV$41)1?2&{ug={TqFPh literal 0 HcmV?d00001 diff --git a/src/GuardrailsSolutionAcceleratorSetup/modules/Deploy-GuardrailsSolutionAccelerator/Deploy-GuardrailsSolutionAccelerator.psd1 b/src/GuardrailsSolutionAcceleratorSetup/modules/Deploy-GuardrailsSolutionAccelerator/Deploy-GuardrailsSolutionAccelerator.psd1 index cfd957ef..417410e6 100644 --- a/src/GuardrailsSolutionAcceleratorSetup/modules/Deploy-GuardrailsSolutionAccelerator/Deploy-GuardrailsSolutionAccelerator.psd1 +++ b/src/GuardrailsSolutionAcceleratorSetup/modules/Deploy-GuardrailsSolutionAccelerator/Deploy-GuardrailsSolutionAccelerator.psd1 @@ -14,7 +14,7 @@ RootModule = 'Deploy-GuardrailsSolutionAccelerator' # Version number of this module. -ModuleVersion = '1.0.12' +ModuleVersion = '1.0.13' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/src/GuardrailsSolutionAcceleratorSetup/modules/Deploy-GuardrailsSolutionAccelerator/Deploy-GuardrailsSolutionAccelerator.psm1 b/src/GuardrailsSolutionAcceleratorSetup/modules/Deploy-GuardrailsSolutionAccelerator/Deploy-GuardrailsSolutionAccelerator.psm1 index cb6daee9..e4fc0889 100644 --- a/src/GuardrailsSolutionAcceleratorSetup/modules/Deploy-GuardrailsSolutionAccelerator/Deploy-GuardrailsSolutionAccelerator.psm1 +++ b/src/GuardrailsSolutionAcceleratorSetup/modules/Deploy-GuardrailsSolutionAccelerator/Deploy-GuardrailsSolutionAccelerator.psm1 @@ -1,4 +1,3 @@ - # import sub-modules Import-Module ((Split-Path $PSScriptRoot -Parent) + "\Confirm-GSAConfigurationParameters\Confirm-GSAConfigurationParameters.psd1") Import-Module ((Split-Path $PSScriptRoot -Parent) + "\Confirm-GSAPrerequisites\Confirm-GSAPrerequisites.psd1") @@ -136,6 +135,7 @@ Function Deploy-GuardrailsSolutionAccelerator { #> [CmdletBinding(DefaultParameterSetName = 'newDeployment-configFilePath')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] param ( # path to the configuration file - for new deployments [Parameter(mandatory = $true, ParameterSetName = 'newDeployment-configFilePath')] @@ -433,8 +433,10 @@ Function Deploy-GuardrailsSolutionAccelerator { 'deployerAzureID' = $config['runtime']['userId'] } - $secretValue = (ConvertTo-SecureString -String (ConvertTo-Json $config -Depth 10) -AsPlainText -Force) - Set-AzKeyVaultSecret -VaultName $config['runtime']['keyVaultName'] -Name $configSecretName -SecretValue $secretValue -Tag $secretTags -ContentType 'application/json' -Verbose:$useVerbose | Out-Null + $secureConfig = (ConvertTo-SecureString -String (ConvertTo-Json $config -Depth 10) -AsPlainText -Force) + $encryptedConfig = $secureConfig | ConvertFrom-SecureString + $secureConfig.Dispose() + Set-AzKeyVaultSecret -VaultName $config['runtime']['keyVaultName'] -Name $configSecretName -SecretValue ($encryptedConfig | ConvertTo-SecureString) -Tag $secretTags -ContentType 'application/json' -Verbose:$useVerbose | Out-Null Write-Host "Completed deployment of the Guardrails Solution Accelerator!" -ForegroundColor Green } @@ -459,5 +461,4 @@ $functionsToExport = @( #'Update-GSAGuardrailPSModules' #'Update-GSAWorkbookDefintion ) - Export-ModuleMember -Function $functionsToExport