You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally you can change the virtual machine user and password to access it
29
-
```bash
30
-
az vm user update \
31
-
--resource-group <RESOURCE_GROUP_NAME> \
32
-
--name <VM_NAME> \
33
-
--username <USERNAME> \
34
-
--password <NEW_PASSWORD>
35
-
```
39
+
Note that in order for a user to be able to access a Desktop or an app, he also needs the role `Virtual Machine User Login` or `Virtual Machine Administrator Login` over the VM.
According to the [**docs**](https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/compute#microsoftcompute), this permission lets you manage the OS of your resource via Windows Admin Center as an administrator. So it looks like this gives access to the WAC to control the VMs...
Copy file name to clipboardExpand all lines: src/pentesting-cloud/azure-security/az-services/az-virtual-desktop.md
+82-46Lines changed: 82 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,57 +9,101 @@ Virtual Desktop is a **desktop and app virtualization service**. It enables to d
9
9
### Host Pools
10
10
11
11
Host pools in Azure Virtual Desktop are collections of Azure virtual machines configured as session hosts, providing virtual desktops and apps to users. There are two main types:
12
-
-**Personal host pools**, where each virtual machine is dedicated to a single user, with its environments
13
-
-**Pooled host pools**, where multiple users share resources on any available session host. It has a configurable session limit and a session host configuration lets Azure Virtual Desktop automate the creation of session hosts based on a configuration
14
12
15
-
Every host pool has a **registration token** is used to register virtual machines within an host pool.
13
+
-**Personal host pools**, where each virtual machine is dedicated to a single user.
14
+
- It can be configured so the **admin can assign** specific users to VMs or having this done **automatically**.
15
+
- This is ideal for people with intensive workloads as each person will have its own VM. Moreover, they will be able to store files and configure settings in the OS disk and these will persist as **each user has its own VM (host)**.
16
16
17
-
### Application groups & Workspace
18
-
Application groups **control user access** to either a full desktop or specific sets of applications available on session hosts within a host pool. There are two types:
19
-
-**Desktop application groups**, which give users access to a complete Windows desktop (available with both personal and pooled host pools)
20
-
-**RemoteApp groups**, which allow users to access individual published applications (available only with pooled host pools).
21
-
A host pool can have one Desktop application group but multiple RemoteApp groups. Users can be assigned to multiple application groups across different host pools. If a user is assigned both desktop and RemoteApp groups within the same host pool, they only see resources from the preferred group type set by administrators.
17
+
-**Pooled host pools**, where multiple **users share resources** on available session hosts.
18
+
- It’s possible to configure a **maximum number of users** (sessions) per host.
19
+
- It’s possible to **add VMs manually** using a registration keys, or **allow Azure to automatically scale** the number of hosts without having the option of adding VMs using the registration key. It’s not possible to automatically scale VMs for personal pools.
20
+
- To persist files in users sessions, it’s needed to use **FSlogix**.
22
21
23
-
A **workspace** is a **collection of application groups**, allowing users to access the desktops and application groups assigned to them. Each application group must be linked to a workspace, and it can only belong to one workspace at a time.
22
+
### Session Hosts
23
+
24
+
These are the **VMs that users will connect to.**
25
+
26
+
- If automated scaling was selected, a template will be created with the **characteristics of the hosts** that need to be created for the pool.
27
+
- If not, when creating the Host pool it’s possible to indicate the **characteristics and the number of VMs** you want to create and Azure will create and add them for you.
28
+
29
+
The main features to **configure the VMs** are:
30
+
31
+
- The **prefix** name of the new VMs
32
+
- The **VM type**: This can be “Azure virtual machine” (to use Azure VMs) or “Azure Local virtual machine” which allow hosts to be deployed on-premises or at the edge.
33
+
- The location, zones, VM security options, image, CPU, memory, Disk size…
34
+
- The **VNet, security group and ports** to expose to the internet
35
+
- It’s possible to set credentials to automatically **join an AD domain**, or use Entra ID directory
36
+
- If Entra ID, It’s possible to automatically **enroll the new VM in Intune**
37
+
- It’s needed to set an **administrator username and password** unless Azure will scale the hosts, in that case a **secret must be configured with the username and another one with the password**
38
+
- It’s possible to **configure a script to be executed** for custom configuration
39
+
40
+
### Application Groups
41
+
42
+
**Application groups** control user access to either a full desktop or specific sets of applications available on session hosts within a host pool.
43
+
44
+
There are two types of application groups:
45
+
46
+
-**Desktop application groups**, which give users access to a complete Windows desktops and attached apps.
47
+
-**RemoteApp groups**, which allow users to access individual applications.
48
+
- It’s not possible to assign this kind of application group to a Personal Pool.
49
+
- It’s needed to indicate the path to the binary to execute inside the VM.
50
+
51
+
A Pooled Pool can have **one Desktop application** group and **multiple RemoteApp groups** and users can be assigned to multiple application groups across different host pools.
52
+
53
+
When a user is **granted access** it’s given the role **`Desktop Virtualization User`** over the application group.
54
+
55
+
### Workspaces & Connections
56
+
57
+
A **workspace** is a collection of application groups.
58
+
59
+
In order to **connect** to the Desktop or apps assigned it’s possible to do so from [https://windows365.microsoft.com/ent#/devices](https://windows365.microsoft.com/ent#/devices)
60
+
And there are other methods described on [https://learn.microsoft.com/en-us/azure/virtual-desktop/users/connect-remote-desktop-client](https://learn.microsoft.com/en-us/azure/virtual-desktop/users/connect-remote-desktop-client)
61
+
62
+
When a user access his account he is going to be **presented separated by workspaces everything he has access to**. Therefore, it’s needed to add **each application group to one workspace** in order for the defined accesses to be visible.
63
+
64
+
In order for a user to be able to access a Desktop or an app, he also needs the role **`Virtual Machine User Login`** or **`Virtual Machine Administrator Login`** over the VM.
65
+
66
+
### Managed Identities
67
+
68
+
It’s not possible to assign managed identities to host pools so the created VMs inside a pool will have them.
69
+
However, it’s possible to **assign system and user managed identities to the VMs** and then access the tokens from the metadata. Actually, after launching the host pools form the web, the 2 generated VMs have the system assigned managed identity enabled (although it doesn’t have any permissions).
24
70
25
-
### Key Features
26
-
-**Flexible VM Creation**: Create Azure virtual machines directly or add Azure Local virtual machines later.
27
-
-**Security Features**: Enable Trusted Launch (secure boot, vTPM, integrity monitoring) for advanced VM security (a virtual network is needed). Can integrate Azure Firewall and control traffic via Network Security Groups.
28
-
-**Domain Join**: Support for Active Directory domain joins with customizable configurations.
29
-
-**Diagnostics & Monitoring**: Enable Diagnostic Settings to stream logs and metrics to Log Analytics, storage accounts, or event hubs for monitoring.
30
-
-**Custom image templates**: Create and manage them to use when adding session hosts. Easily add common customizations or your own custom scripts.
31
-
-**Workspace Registration**: Easily register default desktop application groups to new or existing workspaces for simplified user access management.
32
71
33
72
### Enumeration
34
73
35
74
```bash
36
75
az extension add --name desktopvirtualization
37
76
38
-
# List HostPool of a Resource group
39
-
az desktopvirtualization hostpool list --resource-group <Resource_Group>
77
+
# List HostPools
78
+
az desktopvirtualization hostpool list
79
+
80
+
# List Workspaces
81
+
az desktopvirtualization workspace list
40
82
41
83
# List Application Groups
42
-
az desktopvirtualization applicationgroup list --resource-group <Resource_Group>
43
-
# List Application Groups By Subscription
44
-
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/applicationGroups?api-version=2024-04-03"
84
+
az desktopvirtualization applicationgroup list
85
+
45
86
# List Applications in a Application Group
46
87
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications?api-version=2024-04-03"
88
+
89
+
# Check if Desktops are enabled
90
+
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops?api-version=2024-04-03"
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts?api-version=2024-04-03"
53
100
54
-
# List Workspace in a resource group
55
-
az desktopvirtualization workspace list --resource-group <Resource_Group>
56
-
# List Workspace in a subscription
57
-
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces?api-version=2024-04-03"
58
-
59
-
# List App Attach Package By Resource Group
101
+
# List App Attach packages
60
102
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages?api-version=2024-04-03"
61
-
# List App Attach Package By Subscription
62
-
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/appAttachPackages?api-version=2024-04-03"
103
+
104
+
# List user sessions
105
+
az rest --method GET --url "https://management.azure.com/ssubscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostpools/{hostPoolName}/sessionhosts/{hostPoolHostName}/userSessions?api-version=2024-04-03"
106
+
63
107
64
108
# List Desktops
65
109
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops?api-version=2024-04-03"
@@ -69,37 +113,29 @@ az rest --method GET --url "https://management.azure.com/subscriptions/{subscrip
69
113
70
114
# List private endpoint connections associated with hostpool.
71
115
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections?api-version=2024-04-03"
116
+
72
117
# List private endpoint connections associated By Workspace.
73
118
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections?api-version=2024-04-03"
74
119
75
120
# List the private link resources available for a hostpool.
76
121
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources?api-version=2024-04-03"
122
+
77
123
# List the private link resources available for this workspace.
78
124
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources?api-version=2024-04-03"
79
-
80
-
# List sessionHosts/virtual machines.
81
-
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts?api-version=2024-04-03"
82
-
83
-
# List start menu items in the given application group.
84
-
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems?api-version=2024-04-03"
85
-
86
-
# List userSessions.
87
-
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions?api-version=2024-04-03"
88
-
# List userSessions By Host Pool
89
-
az rest --method GET --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions?api-version=2024-04-03"
90
-
91
125
```
92
126
93
-
### Connection
94
-
95
-
To connect to the virtual desktop via web you can access through https://client.wvd.microsoft.com/arm/webclient/ (most common), or https://client.wvd.microsoft.com/webclient/index.html (classic)
96
-
There are other methods that are described here [https://learn.microsoft.com/en-us/azure/virtual-desktop/users/connect-remote-desktop-client?tabs=windows](https://learn.microsoft.com/en-us/azure/virtual-desktop/users/connect-remote-desktop-client?tabs=windows)
0 commit comments