Skip to content

Commit 8e53b2b

Browse files
authored
Merge pull request #105273 from memildin/asc-melvyn-jitWork
Refactoring the JIT topic and added cleaner notes
2 parents dd0e7ff + ddde877 commit 8e53b2b

File tree

2 files changed

+87
-76
lines changed

2 files changed

+87
-76
lines changed

articles/security-center/security-center-just-in-time.md

Lines changed: 56 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -7,73 +7,40 @@ manager: rkarlin
77

88
ms.service: security-center
99
ms.topic: conceptual
10-
ms.date: 09/10/2019
10+
ms.date: 02/25/2020
1111
ms.author: memildin
1212

1313
---
14-
# Manage virtual machine access using just-in-time
15-
16-
Just-in-time (JIT) virtual machine (VM) access can be used to lock down inbound traffic to your Azure VMs, reducing exposure to attacks while providing easy access to connect to VMs when needed.
17-
18-
> [!NOTE]
19-
> The just-in-time feature is available on the Standard tier of Security Center. See [Pricing](security-center-pricing.md) to learn more about Security Center's pricing tiers.
14+
# Secure your management ports with just-in-time access
2015

16+
If you're on Security Center's standard pricing tier (see [pricing](/azure/security-center/security-center-pricing)), you can lock down inbound traffic to your Azure VMs with just-in-time (JIT) virtual machine (VM) access. This reduces exposure to attacks while providing easy access to connect to VMs when needed.
2117

2218
> [!NOTE]
2319
> Security Center just-in-time VM access currently supports only VMs deployed through Azure Resource Manager. To learn more about the classic and Resource Manager deployment models see [Azure Resource Manager vs. classic deployment](../azure-resource-manager/management/deployment-models.md).
2420
25-
## Attack scenario
26-
27-
Brute force attacks commonly target management ports as a means to gain access to a VM. If successful, an attacker can take control over the VM and establish a foothold into your environment.
28-
29-
One way to reduce exposure to a brute force attack is to limit the amount of time that a port is open. Management ports don't need to be open at all times. They only need to be open while you're connected to the VM, for example to perform management or maintenance tasks. When just-in-time is enabled, Security Center uses [network security group](../virtual-network/security-overview.md#security-rules) (NSG) and Azure Firewall rules, which restrict access to management ports so they cannot be targeted by attackers.
30-
31-
![Just-in-time scenario](./media/security-center-just-in-time/just-in-time-scenario.png)
32-
33-
## How does JIT access work?
34-
35-
When just-in-time is enabled, Security Center locks down inbound traffic to your Azure VMs by creating an NSG rule. You select the ports on the VM to which inbound traffic will be locked down. These ports are controlled by the just-in-time solution.
36-
37-
When a user requests access to a VM, Security Center checks that the user has [Role-Based Access Control (RBAC)](../role-based-access-control/role-assignments-portal.md) permissions for that VM. If the request is approved, Security Center automatically configures the Network Security Groups (NSGs) and Azure Firewall to allow inbound traffic to the selected ports and requested source IP addresses or ranges, for the amount of time that was specified. After the time has expired, Security Center restores the NSGs to their previous states. Those connections that are already established are not being interrupted, however.
38-
39-
> [!NOTE]
40-
> If a JIT access request is approved for a VM behind an Azure Firewall, then Security Center automatically changes both the NSG and firewall policy rules. For the amount of time that was specified, the rules allow inbound traffic to the selected ports and requested source IP addresses or ranges. After the time is over, Security Center restores the firewall and NSG rules to their previous states.
41-
42-
43-
## Permissions needed to configure and use JIT
44-
45-
| To enable a user to: | Permissions to set|
46-
| --- | --- |
47-
| Configure or edit a JIT policy for a VM | *Assign these actions to the role:* <ul><li>On the scope of a subscription or resource group that is associated with the VM:<br/> `Microsoft.Security/locations/jitNetworkAccessPolicies/write` </li><li> On the scope of a subscription or resource group of VM: <br/>`Microsoft.Compute/virtualMachines/write`</li></ul> |
48-
|Request JIT access to a VM | *Assign these actions to the user:* <ul><li>On the scope of a subscription or resource group that is associated with the VM:<br/> `Microsoft.Security/locations/jitNetworkAccessPolicies/initiate/action` </li><li>On the scope of a subscription or resource group that is associated with the VM:<br/> `Microsoft.Security/locations/jitNetworkAccessPolicies/*/read` </li><li> On the scope of a subscription or resource group or VM:<br/> `Microsoft.Compute/virtualMachines/read` </li><li> On the scope of a subscription or resource group or VM:<br/> `Microsoft.Network/networkInterfaces/*/read` </li></ul>|
49-
21+
[!INCLUDE [security-center-jit-description](../../includes/security-center-jit-description.md)]
5022

5123
## Configure JIT on a VM
5224

5325
There are three ways to configure a JIT policy on a VM:
5426

5527
- [Configure JIT access in Azure Security Center](#jit-asc)
56-
- [Configure JIT access in an Azure VM blade](#jit-vm)
28+
- [Configure JIT access in an Azure VM page](#jit-vm)
5729
- [Configure a JIT policy on a VM programmatically](#jit-program)
5830

59-
## Configure JIT in Security Center
31+
## Configure JIT in Azure Security Center
6032

6133
From Security Center, you can configure a JIT policy and request access to a VM using a JIT policy
6234

63-
6435
### Configure JIT access on a VM in Security Center <a name="jit-asc"></a>
6536

6637
1. Open the **Security Center** dashboard.
6738

68-
2. In the left pane, select **Just-in-time VM access**.
39+
1. In the left pane, select **Just-in-time VM access**.
6940

7041
![Just-in-time VM access tile](./media/security-center-just-in-time/just-in-time.png)
7142

72-
The **Just-in-time VM access** window opens.
73-
74-
![Enable just-in-time access](./media/security-center-just-in-time/enable-just-in-time.png)
75-
76-
**Just-in-time VM access** provides information on the state of your VMs:
43+
The **Just-in-time VM access** window opens and shows information on the state of your VMs:
7744

7845
- **Configured** - VMs that have been configured to support just-in-time VM access. The data presented is for the last week and includes for each VM the number of approved requests, last access date and time, and last user.
7946
- **Recommended** - VMs that can support just-in-time VM access but haven't been configured to. We recommend that you enable just-in-time VM access control for these VMs.
@@ -82,26 +49,26 @@ From Security Center, you can configure a JIT policy and request access to a VM
8249
- Classic VM - Security Center just-in-time VM access currently supports only VMs deployed through Azure Resource Manager. A classic deployment is not supported by the just-in-time solution.
8350
- Other - A VM is in this category if the just-in-time solution is turned off in the security policy of the subscription or the resource group, or if the VM is missing a public IP and doesn't have an NSG in place.
8451

85-
3. Select the **Recommended** tab.
52+
1. Select the **Recommended** tab.
8653

87-
4. Under **VIRTUAL MACHINE**, click the VMs that you want to enable. This puts a checkmark next to a VM.
54+
1. Under **VIRTUAL MACHINE**, click the VMs that you want to enable. This puts a checkmark next to a VM.
8855

89-
5. Click **Enable JIT on VMs**.
90-
-. This blade displays the default ports recommended by Azure Security Center:
91-
- 22 - SSH
92-
- 3389 - RDP
93-
- 5985 - WinRM
94-
- 5986 - WinRM
95-
6. You can also configure custom ports:
56+
![Enable just-in-time access](./media/security-center-just-in-time/enable-just-in-time.png)
9657

97-
1. Click **Add**. The **Add port configuration** window opens.
98-
2. For each port you choose to configure, both default and custom, you can customize the following settings:
58+
1. Click **Enable JIT on VMs**. A pane opens displaying the default ports recommended by Azure Security Center:
59+
- 22 - SSH
60+
- 3389 - RDP
61+
- 5985 - WinRM
62+
- 5986 - WinRM
63+
1. Optionally, you can add custom ports to the list:
9964

100-
- **Protocol type**- The protocol that is allowed on this port when a request is approved.
101-
- **Allowed source IP addresses**- The IP ranges that are allowed on this port when a request is approved.
102-
- **Maximum request time**- The maximum time window during which a specific port can be opened.
65+
1. Click **Add**. The **Add port configuration** window opens.
66+
1. For each port you choose to configure, both default and custom, you can customize the following settings:
67+
- **Protocol type**- The protocol that is allowed on this port when a request is approved.
68+
- **Allowed source IP addresses**- The IP ranges that are allowed on this port when a request is approved.
69+
- **Maximum request time**- The maximum time window during which a specific port can be opened.
10370

104-
3. Click **OK**.
71+
1. Click **OK**.
10572

10673
1. Click **Save**.
10774

@@ -115,43 +82,48 @@ To request access to a VM via Security Center:
11582

11683
1. Under **Just-in-time VM access**, select the **Configured** tab.
11784

118-
2. Under **Virtual Machine**, click the VMs that you want to request access for. This puts a checkmark next to the VM.
119-
85+
1. Under **Virtual Machine**, click the VMs that you want to request access for. This puts a checkmark next to the VM.
12086

12187
- The icon in the **Connection Details** column indicates whether JIT is enabled on the NSG or FW. If it’s enabled on both, only the Firewall icon appears.
12288

12389
- The **Connection Details** column provides the information required to connect the VM, and its open ports.
12490

12591
![Request just-in-time access](./media/security-center-just-in-time/request-just-in-time-access.png)
12692

127-
3. Click **Request access**. The **Request access** window opens.
93+
1. Click **Request access**. The **Request access** window opens.
12894

12995
![JIT details](./media/security-center-just-in-time/just-in-time-details.png)
13096

131-
4. Under **Request access**, for each VM, configure the ports that you want to open and the source IP addresses that the port is opened on and the time window for which the port will be open. It will only be possible to request access to the ports that are configured in the just-in-time policy. Each port has a maximum allowed time derived from the just-in-time policy.
97+
1. Under **Request access**, for each VM, configure the ports that you want to open and the source IP addresses that the port is opened on and the time window for which the port will be open. It will only be possible to request access to the ports that are configured in the just-in-time policy. Each port has a maximum allowed time derived from the just-in-time policy.
13298

133-
5. Click **Open ports**.
99+
1. Click **Open ports**.
134100

135101
> [!NOTE]
136102
> If a user who is requesting access is behind a proxy, the option **My IP** may not work. You may need to define the full IP address range of the organization.
137103
104+
105+
138106
## Edit a JIT access policy via Security Center
139107

140108
You can change a VM's existing just-in-time policy by adding and configuring a new port to protect for that VM, or by changing any other setting related to an already protected port.
141109

142110
To edit an existing just-in-time policy of a VM:
111+
143112
1. In the **Configured** tab, under **VMs**, select a VM to which to add a port by clicking on the three dots within the row for that VM.
144113

145114
1. Select **Edit**.
115+
146116
1. Under **JIT VM access configuration**, you can either edit the existing settings of an already protected port or add a new custom port.
147117
![jit vm access](./media/security-center-just-in-time/edit-policy.png)
148118

119+
120+
149121
## Audit JIT access activity in Security Center
150122

151123
You can gain insights into VM activities using log search. To view logs:
152124

153125
1. Under **Just-in-time VM access**, select the **Configured** tab.
154-
2. Under **VMs**, select a VM to view information about by clicking on the three dots within the row for that VM and select **Activity Log** in the menu. The **Activity log** opens.
126+
2. Under **VMs**, select a VM to view information about by clicking on the three dots within the row for that VM and select **Activity Log** from the menu. The **Activity log** opens.
155127

156128
![Select activity log](./media/security-center-just-in-time/select-activity-log.png)
157129

@@ -174,7 +146,7 @@ To make it easy to roll out just-in-time access across your VMs, you can set a V
174146
1. From the [Azure portal](https://ms.portal.azure.com), search for and select **Virtual machines**.
175147
2. Select the virtual machine you want to limit to just-in-time access.
176148
3. In the menu, select **Configuration**.
177-
4. Under **Just-in-time-access**, select **Enable just-in-time policy**.
149+
4. Under **Just-in-time access**, select **Enable just-in-time**.
178150

179151
This enables just-in-time access for the VM using the following settings:
180152

@@ -191,15 +163,15 @@ If a VM already has just-in-time enabled, when you go to its configuration page
191163

192164
![jit config in vm](./media/security-center-just-in-time/jit-vm-config.png)
193165

194-
### Request JIT access to a VM via the Azure VM blade
166+
### Request JIT access to a VM via an Azure VM's page
195167

196168
In the Azure portal, when you try to connect to a VM, Azure checks to see if you have a just-in-time access policy configured on that VM.
197169

198-
- If you do have a JIT policy configured on the VM, you can click **Request access** to enable you to have access in accordance with the JIT policy set for the VM.
170+
- If you have a JIT policy configured on the VM, you can click **Request access** to grant access in accordance with the JIT policy set for the VM.
199171

200172
>![jit request](./media/security-center-just-in-time/jit-request.png)
201173
202-
The access is requested with the following default parameters:
174+
Access is requested with the following default parameters:
203175

204176
- **source IP**: ‘Any’ (*) (cannot be changed)
205177
- **time range**: Three hours (cannot be changed) <!--Isn't this set in the policy-->
@@ -208,19 +180,19 @@ In the Azure portal, when you try to connect to a VM, Azure checks to see if you
208180
> [!NOTE]
209181
> After a request is approved for a VM protected by Azure Firewall, Security Center provides the user with the proper connection details (the port mapping from the DNAT table) to use to connect to the VM.
210182
211-
- If you do not have JIT configured on a VM, you will be prompted to configure a JIT policy it.
183+
- If you do not have JIT configured on a VM, you will be prompted to configure a JIT policy on it.
212184

213185
![jit prompt](./media/security-center-just-in-time/jit-prompt.png)
214186

215187
## Configure a JIT policy on a VM programmatically <a name="jit-program"></a>
216188

217189
You can set up and use just-in-time via REST APIs and via PowerShell.
218190

219-
## JIT VM access via REST APIs
191+
### JIT VM access via REST APIs
220192

221193
The just-in-time VM access feature can be used via the Azure Security Center API. You can get information about configured VMs, add new ones, request access to a VM, and more, via this API. See [Jit Network Access Policies](https://docs.microsoft.com/rest/api/securitycenter/jitnetworkaccesspolicies), to learn more about the just-in-time REST API.
222194

223-
## JIT VM access via PowerShell
195+
### JIT VM access via PowerShell
224196

225197
To use the just-in-time VM access solution via PowerShell, use the official Azure Security Center PowerShell cmdlets, and specifically `Set-AzJitNetworkAccessPolicy`.
226198

@@ -256,7 +228,7 @@ Run the following in PowerShell to accomplish this:
256228

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

259-
#### Request access to a VM via PowerShell
231+
### Request access to a VM via PowerShell
260232

261233
In the following example, you can see a just-in-time VM access request to a specific VM in which port 22 is requested to be opened for a specific IP address and for a specific amount of time:
262234

@@ -276,18 +248,26 @@ Run the following in PowerShell:
276248

277249
Start-AzJitNetworkAccessPolicy -ResourceId "/subscriptions/SUBSCRIPTIONID/resourceGroups/RESOURCEGROUP/providers/Microsoft.Security/locations/LOCATION/jitNetworkAccessPolicies/default" -VirtualMachine $JitPolicyArr
278250

279-
For more information, see the PowerShell cmdlet documentation.
251+
For more information, see the [PowerShell cmdlet documentation](https://docs.microsoft.com/powershell/scripting/developer/cmdlet/cmdlet-overview).
252+
253+
254+
## Automatic cleanup of redundant JIT rules
255+
256+
Whenever you update a JIT policy, a cleanup tool automatically runs to check the validity of your entire ruleset. The tool looks for mismatches between rules in your policy and rules in the NSG. If the cleanup tool finds a mismatch, it determines the cause and, when it's safe to do so, removes built-in rules that aren't needed any more. The cleaner never deletes rules that you've created.
257+
258+
Examples scenarios when the cleaner might remove a built-in rule:
259+
260+
- When two rules with identical definitions exist and one has a higher priority than the other (meaning, the lower priority rule will never be used)
261+
- When a rule description includes the name of a VM which doesn't match the destination IP in the rule
262+
280263

281264
## Next steps
265+
282266
In this article, you learned how just-in-time VM access in Security Center helps you control access to your Azure virtual machines.
283267

284268
To learn more about Security Center, see the following:
285269

286270
- [Setting security policies](tutorial-security-policy.md) — Learn how to configure security policies for your Azure subscriptions and resource groups.
287271
- [Managing security recommendations](security-center-recommendations.md) — Learn how recommendations help you protect your Azure resources.
288272
- [Security health monitoring](security-center-monitoring.md) — Learn how to monitor the health of your Azure resources.
289-
- [Managing and responding to security alerts](security-center-managing-and-responding-alerts.md) — Learn how to manage and respond to security alerts.
290-
- [Monitoring partner solutions](security-center-partner-solutions.md) — Learn how to monitor the health status of your partner solutions.
291-
- [Security Center FAQ](security-center-faq.md) — Find frequently asked questions about using the service.
292-
- [Azure Security blog](https://blogs.msdn.microsoft.com/azuresecurity/) — Find blog posts about Azure security and compliance.
293-
273+
- [Azure Security Center FAQ](security-center-faq.md) — Find frequently asked questions about using the service.

0 commit comments

Comments
 (0)