- Lab
- A Cloud Guru
Securely Access Script Secrets in Azure Key Vault
Azure includes several services to help protect secret information for our applications and scripts. Key Vault is designed for secure programmatic access of secret information. However to access this information, we need to authenticate against Azure AD. This is where managed identities can help. And while, Key Vault is built for public accessibility, through the use of a resource firewall and Azure Private Link, we can ensure this communication remains private. In this hands-on lab, we'll configure secure connectivity for a VM to Azure Key Vault using Azure Private Link. We'll also enable managed identity for the VM to provide native Azure AD authentication to the Key Vault service. **Scenario** You've recently been hired as a security engineer and tasked with improving the security of some DevOps tasks that are performed at your company. Your manager has asked you to improve the security of an important automation VM, which is responsible for running several scripts. It has been found that some PowerShell scripts currently executing on the automation VM are using secret information hard-coded into the scripts in plain text. You must secure this solution by configuring Azure Key Vault, Private Link, and managed identities all to ensure the automation scripts can run securely by storing secrets in Key Vault.
Path Info
Table of Contents
-
Challenge
Associate the managed identity with the VM
- Locate the existing virtual machine
vm1
. - Associated the existing managed identity.
- Locate the existing virtual machine
-
Challenge
Configure Key Vault with Private Link
- Create a new Key Vault Service with the following settings:
- Only allow access via a private endpoint.
- Create a new Key Vault Service with the following settings:
-
Challenge
Use PowerShell to create and read secrets in Key Vault
- Connect to
vm1
using RDP. - Using PowerShell, log in to Azure using the managed identity.
Note: The necessary PowerShell modules to complete these steps has been installed on
vm1
for you. - Create a secret in Key Vault.
- Read your secret from Key Vault.
- Connect to
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.