> For the complete documentation index, see [llms.txt](https://docs.p0.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.p0.dev/integrations/resource-integrations/rdp.md).

# RDP

Install P0 for Remote Desktop Protocol (RDP) so people can request just-in-time RDP sessions to Windows virtual machines in Azure.

Use the RDP integration to give people temporary Remote Desktop access to Windows virtual machines (VMs) in Microsoft Azure. A person requests a session to one VM. When the request is approved, P0 gives their Microsoft Entra ID user the roles that let them sign in to that VM through your Azure Bastion host. When access ends, P0 disconnects the Bastion sessions to that VM and removes the roles.

To learn more, see:

* [Installing RDP](https://docs.p0.dev/integrations/resource-integrations/rdp/installation.md)
* [Requesting RDP access](https://docs.p0.dev/integrations/resource-integrations/rdp/requesting-access.md)

## What P0 changes in Azure

| When                                                           | What P0 does                                                                                                                                                                                                                                                                                                        |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A request is approved                                          | Assigns **Virtual Machine User Login** to the person on the VM and on its network interface. With admin access, also assigns **Virtual Machine Administrator Login** on the VM. On the Bastion host, assigns the role you entered as **Standard user role id** when you configured the subscription's bastion host. |
| The VM is in a different virtual network from the Bastion host | Peers the two virtual networks, so the Bastion host can reach the VM.                                                                                                                                                                                                                                               |
| Access ends                                                    | Disconnects every Bastion session to the VM, then removes the role assignments. Removes the peering once no open RDP session needs it.                                                                                                                                                                              |

A person who has two open requests for the same VM keeps its roles until the last one ends. P0 keeps the Bastion host role while the person has an open RDP request for any VM behind that Bastion host.

## Access policies

In access policies, RDP is the service `rdp`. Its access type is `session`. See [Configuring access policies](https://docs.p0.dev/policy-studio/policy-studio/configure-your-first-access-policy.md#resource).

### Available filters

| Filter        | Key                     | What it matches            | Example                                                                                                            |
| ------------- | ----------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `destination` | `name`                  | The VM's name in Azure     | `win-build-01`                                                                                                     |
| `destination` | `full-resource-name`    | The VM's Azure resource ID | `/subscriptions/<subscription-id>/resourceGroups/<group>/providers/Microsoft.Compute/virtualMachines/win-build-01` |
| `admin`       | None. Set `value: true` | Requests for admin access  | `true`                                                                                                             |

### Example access policy

These policies send requests for VMs whose names start with `win-build-` to your Security Reviewers, and deny admin access to every VM:

```yaml
- requestor:
    type: any
  resource:
    type: integration
    service: rdp
    accessType: session
    filters:
      destination:
        effect: keep
        key: name
        pattern: ^win-build-
  approval:
    - type: p0
- requestor:
    type: any
  resource:
    type: integration
    service: rdp
    accessType: session
    filters:
      admin:
        effect: keep
        value: true
  approval:
    - type: deny
```

## Limitations

* RDP supports Windows VMs in Azure only.
* P0 connects through an Azure Bastion host only. A subscription whose bastion host is a custom jump host can't use RDP.
* A VM appears in P0 only when the `AADLoginForWindows` extension is installed on it.
* `p0 rdp` opens a session from a Windows computer only.
* P0 grants access on a VM's first network interface only.
* There is no P0 Terraform resource for RDP. Install it from the P0 app.
