Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » AWS/Azure/OpenShift » How to secure access to your Virtual Machine with Just-in-Time (JIT) VM Access
  • 0227 15
    How to set Execution Policy via Windows PowerShell Windows Server
  • FailedRegistration
    DNS Bad key 9017: The Cluster Name registration failed of one or more associated DNS names Virtualization
  • image 37
    There was an error opening the Trusted Platform Module snap-in: You do not have permission to open the Trusted Platform Module Console Windows
  • Remove icons from Launchpad
    Remove an icon from launchpad that has been deleted Mac
  • system
    How to fix the system cannot find the file specified when adding LP, LIP, and FoD packages to Windows Images Windows Server
  • updates
    Out-of-Band Security Update for PrintNightmare: Patch released for Windows Print Spooler Remote Code Execution Vulnerability Security | Vulnerability Scans and Assessment
  • slide office 365 79
    Configure WSUS Email Notification for Office365 Windows Server
  • Header picture 1
    Find BIOS Serial Number and System Information on Windows 11 Windows

How to secure access to your Virtual Machine with Just-in-Time (JIT) VM Access

Posted on 27/08/202129/09/2023 Imoh Etuk By Imoh Etuk No Comments on How to secure access to your Virtual Machine with Just-in-Time (JIT) VM Access
azure-just-in-time

Just-in-Time (JIT) Access is one of the features of Azure Security Center. Azure Security Center by Microsoft is a solution that gives unified security management across hybrid cloud workloads. It offers threat protection for data centers within both cloud workloads and on-premises. The platform also works with hybrid clouds that aren’t a part of Azure. If you’re looking to learn how to secure access to Virtual Machine with Just-in-Time (JIT) Access VM Access? You’re in the right place.

The Azure Security Center works to resolve important issues when you start a cloud migration journey for your organization. The cloud customer has to take more responsibilities when upgrading to Infrastructure-as-a-Service (IaaS) as compared to cloud solutions like Platform-as-a-Service (PaaS) and Software-as-a-Service (SaaS), where the cloud service providers take care of most tasks related to securing the network and the services.

Just-in-Time (JIT) access is a fundamental security practice where the privilege granted to access applications or systems is limited to a period of time, thereby minimizing the risk of standing privileges that attackers or malicious insiders can exploit.

Securing Access to Virtual Machine Through Just-in-Time (JIT)

Let’s get more in-depth into Azure Security Center (ASC):

ASC-image-1
Overview of Azure Security Center Dashboard

What is Azure Security Center?

When moving to the IaaS solution in the cloud, securing your environment means securing your network ecosystem and the underlying services. Furthermore, you will do this solely just as the cloud provider takes responsibility for securing processes within the PaaS and SaaS solutions.

Azure Security Center offers a unified and dedicated portal for securing and managing your workloads to cope with the challenges of protecting your hybrid and cloud workloads.

Benefits of Azure Security Center

The platform provides your organization with the following:

  • Enables your IT team to have a clearer view of all the statuses of your cloud resources after accessing your cloud environment. This type of assessment helps you to fully understand whether your resources are secured or not
  • Helps in generating security alerts by providing threat preventive measures and make recommendations where neccessary. It constantly monitors your workloads to detect security vulnerabilities and rules violations.
  • It automatically provisions services since the Security Center is a native part of the overall Azure Cloud System. By doing this, you can deploy a feature in the Security Center seamlessly within your Azure-powered cloud environments.

With Azure Security Center, you can easily control the security of an ever-growing and fast-changing number of cloud services under constant threat by a growing number of sophisticated malware activities.

Navigating Microsoft Azure

Keeping your systems safe is a joint effort between your cloud provider, Microsoft Azure, and you, the customer. You have to make sure your workloads are secure as you move to the cloud, and at the same time, when you move to IaaS (Infrastructure as a Service) there is more customer responsibility than there was in PaaS (platform as a service), and SaaS (Software as a Service). In addition, Azure Security Center provides you the tools needed to harden your network, secure your services and make sure you’re on top of your security scenarios.

Managing your IT systems both On-premises and in the Cloud can be very challenging. Hackers are constantly getting smarter than you on a daily basis, hence, one of the reasons why Microsoft has put together some important security features in Azure Security Center to help in preventing some tempered or unauthorized access to your workloads across hybrid and native cloud environments.

This will take us to explore what Just-In-Time (JIT) Access as a feature in Azure Security Center is all about. 

secure access to your Virtual Machine with Just-in-Time (JIT) VM Access-JIT-Access
JIT VM Access Interface

What is Just-In-Time Access?

Just-in-time VM access enables you to lock down your VMs at the network level by blocking inbound traffic to specific ports. Furthermore, it enables you to control the access and reduce the attack surface to your VMs, by allowing access only upon a specific need.

It is a way to enforce the principle of least privilege to ensure users and non-human identities are given the minimum level of privileges. JIT access can also ensure that privileged activities are conducted in line with an organization’s Identity Access Management (IAM) policies along with its workflows as it is very essential that any JIT access strategy enables an organization to maintain a full audit trail of privileged activities.

How does it work? When a user made a request, based on Azure RBAC, Security Center will decide whether to grant access. If a request is approved, Security Center automatically configures the NSGs to allow inbound traffic to these ports, for the requested amount of time, after which it restores the NSGs to their previous states.

Ways of securing access to your Azure Virtual Machine (VM) with Just-in-Time

  1. Through Azure Security Center – You can enable JIT with your own custom options for one or more VMs using Security Center. Meanwhile, the recommended ports and 3 hours time range are given by default. These can be modified to suit your security needs.
secure access to your Virtual Machine with Just-in-Time (JIT) VM Access-JIT-Config
JIT VM Access configuration

You can request JIT access for additional ports not listed among the default ports by clicking on the Add tab and providing your desired port number as shown in the screenshot below

secure access to your Virtual Machine with Just-in-Time (JIT) VM Access-Add-Custom-Port-to-JIT
Adding a custom port
  1. Through Azure Virtual Machine Blade –  From the selected VM to enable JIT Access, i.e., -> Virtual Machine Name -> Configuration tab -> Enable just-in-time. Therefore, see the demo below:
secure access to your Virtual Machine with Just-in-Time (JIT) VM Access-JIT-enabled
Enabling JIT VM Access through virtual machine blade

Enable JIT on your VMs using PowerShell

The JIT VM access can be enabled using PowerShell, to do this use the official Azure Security Center PowerShell cmdlet Set-AzJitNetworkAccessPolicy. To have first-hand knowledge of what PowerShell cmdlet is about, see my previous post on Provisioning Azure Resources using Azure Az PowerShell Cmdlet from Cloud Shell.

Example – Enable just-in-time VM access on a specific VM with the following rules:

  • Close ports 22 and 3389 (SSH and RDP port numbers)
  • Set a maximum time window of 3 hours for each so they can be opened per approved request
  • Allow the user who is requesting access to control the source IP addresses
  • Allow the user who is requesting access to establish a successful session upon an approved just-in-time access request

The following PowerShell commands create this JIT configuration:

  1. Assign a variable that holds the just-in-time VM access rules for a VM:
$JitPolicy = (@{
    id="/subscriptions/SUBSCRIPTIONID/resourceGroups/RESOURCEGROUP/providers/Microsoft.Compute/virtualMachines/VMNAME";
    ports=(@{
         number=22;
         protocol="*";
         allowedSourceAddressPrefix=@("*");
         maxRequestAccessDuration="PT3H"},
         @{
         number=3389;
         protocol="*";
         allowedSourceAddressPrefix=@("*");
         maxRequestAccessDuration="PT3H"})})

2. Insert the VM just-in-time VM access rules into an array: 

$JitPolicyArr=@($JitPolicy)

3. Configure the just-in-time VM access rules on the selected VM:

Set-AzJitNetworkAccessPolicy -Kind "Basic" -Location "LOCATION" -Name "default" -ResourceGroupName "RESOURCEGROUP" -VirtualMachine $JitPolicyArr

Use the –Name parameter to specify a VM. For example, to establish the JIT configuration for two different VMs, let’s say VMDEMO1 and VMDEMO2, use:

Set-AzJitNetworkAccessPolicy -Name VMDEMO1 and Set-AzJitNetworkAccessPolicy -Name VMDEMO2

Establishing connection to a JIT-enabled VM

To secure access to your Virtual Machine with Just-in-Time (JIT) VM Access, you need to create a connection. Here’s how to go about it.

When you enable JIT access on a VM, you have to request access to connect to it. You can request access in any of the supported ways, regardless of how you enabled JIT. Request access by clicking Connect -> Select RDP connection type if it’s a Windows VM as shown below:

secure access to your Virtual Machine with Just-in-Time (JIT) VM Access-VM-Connection
Establishing a connection to your JIT-enabled VM

Click on Request Access as shown below

secure access to your Virtual Machine with Just-in-Time (JIT) VM Access-JIT
Requesting JIT VM access screenshot

As you can see below, Just-in-time access is being requested.

access-is-being-requested
JIT Access is being requested

You’ll get a JIT access approval within few minutes and the screen will appear as the one below.

download-RDP-PORTS
JIT Access Approved for RDP port 3389

Where Does Just-in-Time (JIT) Fit In? When thinking about security challenges posed by malware vulnerabilities, I know from my professional point of view that it’s quite a herculean task, hence, the need to utilize a feature such as JIT access as it will help in:

  1. Reducing the number of attack surface on your hybrid and cloud workloads within your arganization.
  2. Reducing the risk associated with users having privileged access.
  3. Reducing the risk of having open management ports on a virtual machine

I will focus on point 2 – reducing the risk associated with users having privileged access. Meanwhile, this requirement is currently adopted, as digital transformation leads to technological changes. We now need to worry about the risk associated with systems, Networks, APIs, and Service Accounts having too much privilege, as well as users.

Privilege really is a necessary evil but that doesn’t mean it’s a bad thing. It just means we have to apply controls around its usage. Thus, there are two things that JIT access will allow us to control here:

  1. Scope – Just Enough Access
    • What systems of applications can the user access?
    • How much privilege does the user or application require in order to perform its function?
  2. Time – Just-in-Time
    • When do they need the privilege?
    • How long do they need it for?

Wrap-Up

Threat actors are actively hunting for accessible Virtual machines (Networks) with open management ports, like RDP or SSH. All of your virtual machines are potential targets for an attack. When hackers have successfully gained access to your VM and have it compromised, they used it as the entry point to attack further resources within your environment. Hence, why it is important that you utilize some of the great features of the Azure Security Center!

If you haven’t getting started with Azure, sign up today to enjoy the awesome benefits of JIT Access for your resources! With this guide, you can now secure access to your Virtual Machine with Just-in-Time (JIT) VM Access,

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
AWS/Azure/OpenShift, Security | Vulnerability Scans and Assessment Tags:Azure, security, SSH

Post navigation

Previous Post: Clear TPM: How to enable or disable TPM in Windows
Next Post: Monitoring services using Zabbix

Related Posts

  • 1 8y62mmvjlr 5uovgoq6zmq
    How to download and install DriveLock on Windows Security | Vulnerability Scans and Assessment
  • Webp.net resizeimage 7
    Create a new Azure Disk: How to create and attach an extra Disk to Azure Virtual Machine AWS/Azure/OpenShift
  • AWS Budgets
    How to create AWS Budget AWS/Azure/OpenShift
  • Screenshot 2024 02 09 at 1.06.54 PM
    Programmatically Deploying App Service Resources in Azure AWS/Azure/OpenShift
  • EC2
    How to Add and Format a New Virtual Disk to an EC2 Instance AWS/Azure/OpenShift
  • Featured image BitLocker AES XTX 256
    Enable BitLocker AES-XTX 256 Encryption Security | Vulnerability Scans and Assessment

More Related Articles

1 8y62mmvjlr 5uovgoq6zmq How to download and install DriveLock on Windows Security | Vulnerability Scans and Assessment
Webp.net resizeimage 7 Create a new Azure Disk: How to create and attach an extra Disk to Azure Virtual Machine AWS/Azure/OpenShift
AWS Budgets How to create AWS Budget AWS/Azure/OpenShift
Screenshot 2024 02 09 at 1.06.54 PM Programmatically Deploying App Service Resources in Azure AWS/Azure/OpenShift
EC2 How to Add and Format a New Virtual Disk to an EC2 Instance AWS/Azure/OpenShift
Featured image BitLocker AES XTX 256 Enable BitLocker AES-XTX 256 Encryption Security | Vulnerability Scans and Assessment

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • 0227 15
    How to set Execution Policy via Windows PowerShell Windows Server
  • FailedRegistration
    DNS Bad key 9017: The Cluster Name registration failed of one or more associated DNS names Virtualization
  • image 37
    There was an error opening the Trusted Platform Module snap-in: You do not have permission to open the Trusted Platform Module Console Windows
  • Remove icons from Launchpad
    Remove an icon from launchpad that has been deleted Mac
  • system
    How to fix the system cannot find the file specified when adding LP, LIP, and FoD packages to Windows Images Windows Server
  • updates
    Out-of-Band Security Update for PrintNightmare: Patch released for Windows Print Spooler Remote Code Execution Vulnerability Security | Vulnerability Scans and Assessment
  • slide office 365 79
    Configure WSUS Email Notification for Office365 Windows Server
  • Header picture 1
    Find BIOS Serial Number and System Information on Windows 11 Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,832 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.