SecretManagement and accessing Linux VMs in Azure

Published 04-20-2021 12:24 AM 2,074 Views
Microsoft

Hello folks,

 

A couple weeks ago I wrote about how I leveraged PowerShell SecretManagement to generalize a demo environment.  In that article I only talked about Windows virtual machines running in Azure.  However, my colleague Thomas Maurer revisited the topic in his article,  Stop typing PowerShell credentials in demos using PowerShell SecretManagement.  Thomas really concentrated on how the local Secret Store can help when you have demos of local scripts that need secrets, versus my article that concentrated more on how the SecretManagement module paired with the Az.KeyVault module can help manage not only demo environment but help manage local accounts across production environments.

In response to both these articles we got a lot of questions, so I decided to address one of them here.

 

Will it work for linux?

 

Absolutely, you can have PowerShell on Linux, and import the modules mentioned in the articles. 

 

One of the differences that in most case we use SSH keys to access a VM running in Azure. And Azure has a couple ways of securely storing that information.  When creating a VM you can generate one at deployment, upload your own, or use an existing one already in azure. 

 

 

ssh2.png

 

When using “Use existing one stored in Azure” it refers to a separate repo in azure different than Azure Key Vault.  It actually saves the key in a portal service SSK Keys.

 

ssh4.png

 

The SSH Keys portal service give you the ability to download the public key so you can connect to the appropriate VMs. 

 

 

ssh5.png

 

 

In one of the production environment that I’m currently involved with. We do not allow public IP assigned to VMs without a proper business case.  I actually agree with this policy since it limits the number of attack vectors.  So, we use Azure Bastion.  Connecting  using Azure Bastion offers the possibility to use one of several ways to authenticate to the VMs. 

  • Password
  • SSH Private Key
  • SSH Private Key from Local File
  • SSH Private Key from Azure Key Vault

 

Using Azure Key Vault to securely store your keys and secrets allows you to manage the SSH keys by setting expiration dates, apply proper versioning, assign tags AND have them available to the Azure Bastion with the option of requesting the Passphrase.

 

 

ssh6.png

 

 

Just like my previous article.  In order to manage these keys, you can schedule an Azure Automation task, or an Azure Function to monitor the expiration dates and renew\regenerate the SSH Keys for you when appropriate.  As a proof-of-concept I used the same Azure Automation Account as my last article with a new runbook to create the SSH keys for my environment and store them in Azure Key Vault

 

 

 

 

 

param(

    [string]$ResourceGroupName = "Secret-Demo",
    [string]$vaultname = "SecretDemoVault"

)
Disable-AzContextAutosave -Scope Process

$VERSION = "1.0"
$SecretStoreName = "AzKeyVault"
$currentDay = (get-date).ToString("dMyyyyhhmmtt")
$ExpirationDate = (GET-DATE).AddMonths(2)

Write-Output "Runbook started. Version: $VERSION at $currentDay"
Write-Output "---------------------------------------------------"

# Authenticate with your Automation Account
	$connection = Get-AutomationConnection -Name AzureRunAsConnection
    # Wrap authentication in retry logic for transient network failures
    $logonAttempt = 0
    while(!($connectionResult) -and ($logonAttempt -le 10))
    {
        $LogonAttempt++
        # Logging in to Azure...
        $connectionResult = Connect-AzAccount `
                                -ServicePrincipal `
                                -Tenant $connection.TenantID `
                                -ApplicationId $connection.ApplicationID `
                                -CertificateThumbprint $connection.CertificateThumbprint

        Start-Sleep -Seconds 30
    }

# Set Azure Context

    $AzureContext = Get-AzSubscription -SubscriptionId $connection.SubscriptionID
    $SubID = $AzureContext.id

#Create Password

    $Length = 24
    $characters = @([char[]]@(48..57),[char[]]@(65..90),[char[]]@(97..122),@('!','#','%','^','*','(',')','-','+','/','{','}','~','[',']'))
    $SSH_KEY_PASSWORD = ($Characters | Get-Random -Count $Length ) -join ''

# Register keyvault

Register-SecretVault -Name $SecretStoreName -ModuleName Az.KeyVault -VaultParameters @{ AZKVaultName = $vaultname; SubscriptionId = $SubID }

# create key and set it in Key Vault

$KeyPath = $env:TEMP
New-RSAKeyPair -Length 2048 -Password $password -Path $KeyPath\id_rsa -Force

$SSH_PRIVATE_KEY_array = Get-Content $KeyPath/id_rsa
$SSH_PRIVATE_KEY = [string]$SSH_PRIVATE_KEY_array
$SSH_PUBLIC_KEY = Get-Content $KeyPath/id_rsa.pub
$SSH_PUBLIC_PEM_array = Get-Content $KeyPath/id_rsa.pem
$SSH_PUBLIC_PEM = [string]$SSH_PUBLIC_PEM_array

Set-Secret -Name "SSH-Passphrase-demo" -Secret $SSH_KEY_PASSWORD -Vault $SecretStoreName
Set-Secret -Name "SSH-PrivateKey-demo" -Secret $SSH_PRIVATE_KEY -Vault $SecretStoreName
Set-Secret -Name "SSH-PublicKey-demo" -Secret $SSH_PUBLIC_KEY -Vault $SecretStoreName
Set-Secret -Name "SSH-PublicKeypem-demo" -Secret $SSH_PUBLIC_PEM -Vault $SecretStoreName

 

 

 

 

Please note that this runbook uses the New-RSAKeyPair cmdlet from the  PEMEncrypt module imported in my Automantion environment from the PowerShell Galery. 

 

Now, again this is a proof-of-concept piece of code. For production use a lot of changes would be required (not an exhaustive list)

  • Expiration dates you be set.
  • A function to validate that the afore mentioned expiration is not imminent.
  • A function to update the key on each Linux VM in a set environment.

 

So, in conclusion,  yes,  you can use these new module on a Linux VM of you can use these new modules to help you manage the access to these Linux VMs.

 

I hope this helps.

 

Cheers!

 

 

 

1 Comment
Visitor

dont money

%3CLINGO-SUB%20id%3D%22lingo-sub-2278735%22%20slang%3D%22en-US%22%3ESecretManagement%20and%20accessing%20Linux%20VMs%20in%20Azure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2278735%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20folks%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20couple%20weeks%20ago%20I%20wrote%20about%20how%20I%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fitops-talk-blog%2Fleveraging-powershell-secretmanagement-to-generalize-a-demo%2Fba-p%2F2260548%3FWT.mc_id%3Dmodinfra-24236-pierrer%22%20target%3D%22_blank%22%3Eleveraged%20PowerShell%20SecretManagement%20to%20generalize%20a%20demo%20environment%3C%2FA%3E.%26nbsp%3B%20In%20that%20article%20I%20only%20talked%20about%20Windows%20virtual%20machines%20running%20in%20Azure.%26nbsp%3B%20However%2C%20my%20colleague%20Thomas%20Maurer%20revisited%20the%20topic%20in%20his%20article%2C%20%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fitops-talk-blog%2Fstop-typing-powershell-credentials-in-demos-using-powershell%2Fba-p%2F2272072%3FWT.mc_id%3Dmodinfra-24236-pierrer%22%20target%3D%22_blank%22%3EStop%20typing%20PowerShell%20credentials%20in%20demos%20using%20PowerShell%20SecretManagement%3C%2FA%3E.%26nbsp%3B%20Thomas%20really%20concentrated%20on%20how%20the%20local%20Secret%20Store%20can%20help%20when%20you%20have%20demos%20of%20local%20scripts%20that%20need%20secrets%2C%20versus%20my%20article%20that%20concentrated%20more%20on%20how%20the%20SecretManagement%20module%20paired%20with%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fcli%2Fazure%2Fkeyvault%3Fview%3Dazure-cli-latest%26amp%3BWT.mc_id%3Dmodinfra-24236-pierrer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAz.KeyVault%3C%2FA%3E%20module%20can%20help%20manage%20not%20only%20demo%20environment%20but%20help%20manage%20local%20accounts%20across%20production%20environments.%3C%2FP%3E%0A%3CP%3EIn%20response%20to%20both%20these%20articles%20we%20got%20a%20lot%20of%20questions%2C%20so%20I%20decided%20to%20address%20one%20of%20them%20here.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--492908735%22%20id%3D%22toc-hId--493623752%22%3EWill%20it%20work%20for%20linux%3F%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAbsolutely%2C%20you%20can%20have%20PowerShell%20on%20Linux%2C%20and%20import%20the%20modules%20mentioned%20in%20the%20articles.%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FMicrosoft.PowerShell.SecretManagement%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EMicrosoft.PowerShell.SecretManagement%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FMicrosoft.PowerShell.SecretStore%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EMicrosoft.PowerShell.SecretStore%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20of%20the%20differences%20that%20in%20most%20case%20we%20use%20SSH%20keys%20to%20access%20a%20VM%20running%20in%20Azure.%20And%20Azure%20has%20a%20couple%20ways%20of%20securely%20storing%20that%20information.%26nbsp%3B%20When%20creating%20a%20VM%20you%20can%20generate%20one%20at%20deployment%2C%20upload%20your%20own%2C%20or%20use%20an%20existing%20one%20already%20in%20azure.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ssh2.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F273999i553D5FF4C3E2F31D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ssh2.png%22%20alt%3D%22ssh2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20using%20%E2%80%9CUse%20existing%20one%20stored%20in%20Azure%E2%80%9D%20it%20refers%20to%20a%20separate%20repo%20in%20azure%20different%20than%20Azure%20Key%20Vault.%26nbsp%3B%20It%20actually%20saves%20the%20key%20in%20a%20portal%20service%20SSK%20Keys.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ssh4.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F274000i571C2B6BDE625695%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ssh4.png%22%20alt%3D%22ssh4.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20SSH%20Keys%20portal%20service%20give%20you%20the%20ability%20to%20download%20the%20public%20key%20so%20you%20can%20connect%20to%20the%20appropriate%20VMs.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ssh5.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F274001i295C38631657775C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ssh5.png%22%20alt%3D%22ssh5.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20one%20of%20the%20production%20environment%20that%20I%E2%80%99m%20currently%20involved%20with.%20We%20do%20not%20allow%20public%20IP%20assigned%20to%20VMs%20without%20a%20proper%20business%20case.%26nbsp%3B%20I%20actually%20agree%20with%20this%20policy%20since%20it%20limits%20the%20number%20of%20attack%20vectors.%26nbsp%3B%20So%2C%20we%20use%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fbastion%2Fbastion-overview%3FWT.mc_id%3Dmodinfra-24236-pierrer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Bastion%3C%2FA%3E.%26nbsp%3B%20Connecting%20%26nbsp%3Busing%20Azure%20Bastion%20offers%20the%20possibility%20to%20use%20one%20of%20several%20ways%20to%20authenticate%20to%20the%20VMs.%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPassword%3C%2FLI%3E%0A%3CLI%3ESSH%20Private%20Key%3C%2FLI%3E%0A%3CLI%3ESSH%20Private%20Key%20from%20Local%20File%3C%2FLI%3E%0A%3CLI%3ESSH%20Private%20Key%20from%20Azure%20Key%20Vault%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUsing%20Azure%20Key%20Vault%20to%20securely%20store%20your%20keys%20and%20secrets%20allows%20you%20to%20manage%20the%20SSH%20keys%20by%20setting%20expiration%20dates%2C%20apply%20proper%20versioning%2C%20assign%20tags%20AND%20have%20them%20available%20to%20the%20Azure%20Bastion%20with%20the%20option%20of%20requesting%20the%20Passphrase.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ssh6.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F274002i5BA99FCADF9B9BA8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ssh6.png%22%20alt%3D%22ssh6.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJust%20like%20my%20previous%20article.%26nbsp%3B%20In%20order%20to%20manage%20these%20keys%2C%20you%20can%20schedule%20an%20Azure%20Automation%20task%2C%20or%20an%20Azure%20Function%20to%20monitor%20the%20expiration%20dates%20and%20renew%5Cregenerate%20the%20SSH%20Keys%20for%20you%20when%20appropriate.%26nbsp%3B%20As%20a%20proof-of-concept%20I%26nbsp%3Bused%20the%20same%20Azure%20Automation%20Account%20as%20my%20last%20article%20with%20a%20new%20runbook%20to%20create%20the%20SSH%20keys%20for%20my%20environment%20and%20store%20them%20in%20Azure%20Key%20Vault%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3Eparam(%0A%0A%20%20%20%20%5Bstring%5D%24ResourceGroupName%20%3D%20%22Secret-Demo%22%2C%0A%20%20%20%20%5Bstring%5D%24vaultname%20%3D%20%22SecretDemoVault%22%0A%0A)%0ADisable-AzContextAutosave%20-Scope%20Process%0A%0A%24VERSION%20%3D%20%221.0%22%0A%24SecretStoreName%20%3D%20%22AzKeyVault%22%0A%24currentDay%20%3D%20(get-date).ToString(%22dMyyyyhhmmtt%22)%0A%24ExpirationDate%20%3D%20(GET-DATE).AddMonths(2)%0A%0AWrite-Output%20%22Runbook%20started.%20Version%3A%20%24VERSION%20at%20%24currentDay%22%0AWrite-Output%20%22---------------------------------------------------%22%0A%0A%23%20Authenticate%20with%20your%20Automation%20Account%0A%20%24connection%20%3D%20Get-AutomationConnection%20-Name%20AzureRunAsConnection%0A%20%20%20%20%23%20Wrap%20authentication%20in%20retry%20logic%20for%20transient%20network%20failures%0A%20%20%20%20%24logonAttempt%20%3D%200%0A%20%20%20%20while(!(%24connectionResult)%20-and%20(%24logonAttempt%20-le%2010))%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%24LogonAttempt%2B%2B%0A%20%20%20%20%20%20%20%20%23%20Logging%20in%20to%20Azure...%0A%20%20%20%20%20%20%20%20%24connectionResult%20%3D%20Connect-AzAccount%20%60%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-ServicePrincipal%20%60%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-Tenant%20%24connection.TenantID%20%60%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-ApplicationId%20%24connection.ApplicationID%20%60%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-CertificateThumbprint%20%24connection.CertificateThumbprint%0A%0A%20%20%20%20%20%20%20%20Start-Sleep%20-Seconds%2030%0A%20%20%20%20%7D%0A%0A%23%20Set%20Azure%20Context%0A%0A%20%20%20%20%24AzureContext%20%3D%20Get-AzSubscription%20-SubscriptionId%20%24connection.SubscriptionID%0A%20%20%20%20%24SubID%20%3D%20%24AzureContext.id%0A%0A%23Create%20Password%0A%0A%20%20%20%20%24Length%20%3D%2024%0A%20%20%20%20%24characters%20%3D%20%40(%5Bchar%5B%5D%5D%40(48..57)%2C%5Bchar%5B%5D%5D%40(65..90)%2C%5Bchar%5B%5D%5D%40(97..122)%2C%40('!'%2C'%23'%2C'%25'%2C'%5E'%2C'*'%2C'('%2C')'%2C'-'%2C'%2B'%2C'%2F'%2C'%7B'%2C'%7D'%2C'~'%2C'%5B'%2C'%5D'))%0A%20%20%20%20%24SSH_KEY_PASSWORD%20%3D%20(%24Characters%20%7C%20Get-Random%20-Count%20%24Length%20)%20-join%20''%0A%0A%23%20Register%20keyvault%0A%0ARegister-SecretVault%20-Name%20%24SecretStoreName%20-ModuleName%20Az.KeyVault%20-VaultParameters%20%40%7B%20AZKVaultName%20%3D%20%24vaultname%3B%20SubscriptionId%20%3D%20%24SubID%20%7D%0A%0A%23%20create%20key%20and%20set%20it%20in%20Key%20Vault%0A%0A%24KeyPath%20%3D%20%24env%3ATEMP%0ANew-RSAKeyPair%20-Length%202048%20-Password%20%24password%20-Path%20%24KeyPath%5Cid_rsa%20-Force%0A%0A%24SSH_PRIVATE_KEY_array%20%3D%20Get-Content%20%24KeyPath%2Fid_rsa%0A%24SSH_PRIVATE_KEY%20%3D%20%5Bstring%5D%24SSH_PRIVATE_KEY_array%0A%24SSH_PUBLIC_KEY%20%3D%20Get-Content%20%24KeyPath%2Fid_rsa.pub%0A%24SSH_PUBLIC_PEM_array%20%3D%20Get-Content%20%24KeyPath%2Fid_rsa.pem%0A%24SSH_PUBLIC_PEM%20%3D%20%5Bstring%5D%24SSH_PUBLIC_PEM_array%0A%0ASet-Secret%20-Name%20%22SSH-Passphrase-demo%22%20-Secret%20%24SSH_KEY_PASSWORD%20-Vault%20%24SecretStoreName%0ASet-Secret%20-Name%20%22SSH-PrivateKey-demo%22%20-Secret%20%24SSH_PRIVATE_KEY%20-Vault%20%24SecretStoreName%0ASet-Secret%20-Name%20%22SSH-PublicKey-demo%22%20-Secret%20%24SSH_PUBLIC_KEY%20-Vault%20%24SecretStoreName%0ASet-Secret%20-Name%20%22SSH-PublicKeypem-demo%22%20-Secret%20%24SSH_PUBLIC_PEM%20-Vault%20%24SecretStoreName%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20note%20that%20this%20runbook%20uses%20the%20New-RSAKeyPair%20cmdlet%20from%20the%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FPEMEncrypt%2F0.2.1%3FWT.mc_id%3Dmodinfra-24236-pierrer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EPEMEncrypt%20module%3C%2FA%3E%20imported%20in%20my%20Automantion%20environment%20from%20the%20PowerShell%20Galery.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%2C%20again%20this%20is%20a%20proof-of-concept%20piece%20of%20code.%20For%20production%20use%20a%20lot%20of%20changes%20would%20be%20required%20(not%20an%20exhaustive%20list)%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EExpiration%20dates%20you%20be%20set.%3C%2FLI%3E%0A%3CLI%3EA%20function%20to%20validate%20that%20the%20afore%20mentioned%20expiration%20is%20not%20imminent.%3C%2FLI%3E%0A%3CLI%3EA%20function%20to%20update%20the%20key%20on%20each%20Linux%20VM%20in%20a%20set%20environment.%3C%2FLI%3E%0A%3CLI%3E%E2%80%A6%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%2C%20in%20conclusion%2C%26nbsp%3B%20yes%2C%26nbsp%3B%20you%20can%20use%20these%20new%20module%20on%20a%20Linux%20VM%20of%20you%20can%20use%20these%20new%20modules%20to%20help%20you%20manage%20the%20access%20to%20these%20Linux%20VMs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20hope%20this%20helps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECheers!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%80%83%3C%2FP%3E%0A%3CP%3E%E2%80%83%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2278735%22%20slang%3D%22en-US%22%3E%3CP%3EA%20couple%20weeks%20ago%20I%20wrote%20about%20how%20I%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fitops-talk-blog%2Fleveraging-powershell-secretmanagement-to-generalize-a-demo%2Fba-p%2F2260548%3FWT.mc_id%3Dmodinfra-24236-pierrer%22%20target%3D%22_blank%22%3Eleveraged%20PowerShell%20SecretManagement%20to%20generalize%20a%20demo%20environment%3C%2FA%3E.%26nbsp%3B%20In%20that%20article%20I%20only%20talked%20about%20Windows%20virtual%20machines%20running%20in%20Azure.%26nbsp%3B%20However%2C%20my%20colleague%20Thomas%20Maurer%20revisited%20the%20topic%20in%20his%20article%2C%20%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fitops-talk-blog%2Fstop-typing-powershell-credentials-in-demos-using-powershell%2Fba-p%2F2272072%3FWT.mc_id%3Dmodinfra-24236-pierrer%22%20target%3D%22_blank%22%3EStop%20typing%20PowerShell%20credentials%20in%20demos%20using%20PowerShell%20SecretManagement%3C%2FA%3E.%26nbsp%3B%20Thomas%20really%20concentrated%20on%20how%20the%20local%20Secret%20Store%20can%20help%20when%20you%20have%20demos%20of%20local%20scripts%20that%20need%20secrets%2C%20versus%20my%20article%20that%20concentrated%20more%20on%20how%20the%20SecretManagement%20module%20paired%20with%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fcli%2Fazure%2Fkeyvault%3Fview%3Dazure-cli-latest%26amp%3BWT.mc_id%3Dmodinfra-24236-pierrer%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EAz.KeyVault%3C%2FA%3E%20module%20can%20help%20manage%20not%20only%20demo%20environment%20but%20help%20manage%20local%20accounts%20across%20production%20environments.%3C%2FP%3E%0A%3CP%3EIn%20response%20to%20both%20these%20articles%20we%20got%20a%20lot%20of%20questions%2C%20so%20I%20decided%20to%20address%20one%20of%20them%20here.%20Will%20it%20work%20for%20linux%3F%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2278735%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPierre%20Roman%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Apr 20 2021 07:20 AM
Updated by: