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
Copy file name to clipboardExpand all lines: articles/azure-monitor/logs/manage-access.md
+26-15Lines changed: 26 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ The factors that define the data you can access are described in the following t
29
29
|[Access mode](#access-mode)| Method used to access the workspace. Defines the scope of the data available and the access control mode that's applied. |
30
30
|[Access control mode](#access-control-mode)| Setting on the workspace that defines whether permissions are applied at the workspace or resource level. |
31
31
|[Azure role-based access control (RBAC)](#azure-rbac)| Permissions applied to individuals or groups of users for the workspace or resource sending data to the workspace. Defines what data you have access to. |
32
-
|[Table-level Azure RBAC](#set-table-level-read-access-preview)| Optional permissions that define specific data types in the workspace that you can access. Apply to all users no matter your access mode or access control mode. |
32
+
|[Table-level Azure RBAC](#set-table-level-read-access)| Optional permissions that define specific data types in the workspace that you can access. Apply to all users no matter your access mode or access control mode. |
33
33
34
34
## Access mode
35
35
@@ -56,14 +56,14 @@ The following table summarizes the access modes:
56
56
|:---|:---|:---|
57
57
| Who is each model intended for? | Central administration.<br>Administrators who need to configure data collection and users who need access to a wide variety of resources. Also currently required for users who need to access logs for resources outside of Azure. | Application teams.<br>Administrators of Azure resources being monitored. Allows them to focus on their resource without filtering. |
58
58
| What does a user require to view logs? | Permissions to the workspace.<br>See "Workspace permissions" in [Manage access using workspace permissions](./manage-access.md#azure-rbac). | Read access to the resource.<br>See "Resource permissions" in [Manage access using Azure permissions](./manage-access.md#azure-rbac). Permissions can be inherited from the resource group or subscription or directly assigned to the resource. Permission to the logs for the resource will be automatically assigned. The user doesn't require access to the workspace.|
59
-
| What is the scope of permissions? | Workspace.<br>Users with access to the workspace can query all logs in the workspace from tables they have permissions to. See [Set table-level read access](./manage-access.md#set-table-level-read-access-preview). | Azure resource.<br>Users can query logs for specific resources, resource groups, or subscriptions they have access to in any workspace, but they can't query logs for other resources. |
59
+
| What is the scope of permissions? | Workspace.<br>Users with access to the workspace can query all logs in the workspace from tables they have permissions to. See [Set table-level read access](./manage-access.md#set-table-level-read-access). | Azure resource.<br>Users can query logs for specific resources, resource groups, or subscriptions they have access to in any workspace, but they can't query logs for other resources. |
60
60
| How can a user access logs? | On the **Azure Monitor** menu, select **Logs**.<br><br>Select **Logs** from **Log Analytics workspaces**.<br><br>From Azure Monitor [workbooks](../best-practices-analysis.md#workbooks). | Select **Logs** on the menu for the Azure resource. Users will have access to data for that resource.<br><br>Select **Logs** on the **Azure Monitor** menu. Users will have access to data for all resources they have access to.<br><br>Select **Logs** from **Log Analytics workspaces**. Users will have access to data for all resources they have access to.<br><br>From Azure Monitor [workbooks](../best-practices-analysis.md#workbooks). |
61
61
62
62
## Access control mode
63
63
64
64
The *access control mode* is a setting on each workspace that defines how permissions are determined for the workspace.
65
65
66
-
***Require workspace permissions**. This control mode doesn't allow granular Azure RBAC. To access the workspace, the user must be [granted permissions to the workspace](#azure-rbac) or to [specific tables](#set-table-level-read-access-preview).
66
+
***Require workspace permissions**. This control mode doesn't allow granular Azure RBAC. To access the workspace, the user must be [granted permissions to the workspace](#azure-rbac) or to [specific tables](#set-table-level-read-access).
67
67
68
68
If a user accesses the workspace in [workspace-context mode](#access-mode), they have access to all data in any table they've been granted access to. If a user accesses the workspace in [resource-context mode](#access-mode), they have access to only data for that resource in any table they've been granted access to.
69
69
@@ -245,24 +245,24 @@ The `/read` permission is usually granted from a role that includes _\*/read or_
245
245
246
246
In addition to using the built-in roles for a Log Analytics workspace, you can create custom roles to assign more granular permissions. Here are some common examples.
247
247
248
-
**Example 1: Grant a user access to log data from their resources.**
248
+
Grant a user access to log data from their resources:
249
249
250
250
- Configure the workspace access control mode to *use workspace or resource permissions*.
251
251
- Grant users `*/read` or `Microsoft.Insights/logs/*/read` permissions to their resources. If they're already assigned the [Log Analytics Reader](../../role-based-access-control/built-in-roles.md#reader) role on the workspace, it's sufficient.
252
252
253
-
**Example 2: Grant a user access to log data from their resources and configure their resources to send logs to the workspace.**
253
+
Grant a user access to log data from their resources and configure their resources to send logs to the workspace:
254
254
255
255
- Configure the workspace access control mode to *use workspace or resource permissions*.
256
256
- Grant users the following permissions on the workspace: `Microsoft.OperationalInsights/workspaces/read` and `Microsoft.OperationalInsights/workspaces/sharedKeys/action`. With these permissions, users can't perform any workspace-level queries. They can only enumerate the workspace and use it as a destination for diagnostic settings or agent configuration.
257
257
- Grant users the following permissions to their resources: `Microsoft.Insights/logs/*/read` and `Microsoft.Insights/diagnosticSettings/write`. If they're already assigned the [Log Analytics Contributor](../../role-based-access-control/built-in-roles.md#contributor) role, assigned the Reader role, or granted `*/read` permissions on this resource, it's sufficient.
258
258
259
-
**Example 3: Grant a user access to log data from their resources without being able to read security events and send data.**
259
+
Grant a user access to log data from their resources without being able to read security events and send data:
260
260
261
261
- Configure the workspace access control mode to *use workspace or resource permissions*.
262
262
- Grant users the following permissions to their resources: `Microsoft.Insights/logs/*/read`.
263
263
- Add the following NonAction to block users from reading the SecurityEvent type: `Microsoft.Insights/logs/SecurityEvent/read`. The NonAction shall be in the same custom role as the action that provides the read permission (`Microsoft.Insights/logs/*/read`). If the user inherits the read action from another role that's assigned to this resource or to the subscription or resource group, they could read all log types. This scenario is also true if they inherit `*/read` that exists, for example, with the Reader or Contributor role.
264
264
265
-
**Example 4: Grant a user access to log data from their resources and read all Azure AD sign-in and read Update Management solution log data from the workspace.**
265
+
Grant a user access to log data from their resources and read all Azure AD sign-in and read Update Management solution log data from the workspace:
266
266
267
267
- Configure the workspace access control mode to *use workspace or resource permissions*.
268
268
- Grant users the following permissions on the workspace:
@@ -276,21 +276,21 @@ In addition to using the built-in roles for a Log Analytics workspace, you can c
276
276
-`Microsoft.OperationalInsights/workspaces/query/ComputerGroup/read`: Required to be able to use Update Management solutions
277
277
- Grant users the following permissions to their resources: `*/read`, assigned to the Reader role, or `Microsoft.Insights/logs/*/read`
278
278
279
-
## Set table-level read access (preview)
279
+
## Set table-level read access
280
280
281
281
To create a [custom role](../../role-based-access-control/custom-roles.md) that lets specific users or groups read data from specific tables in a workspace:
282
282
283
-
1. Create a custom role that grants users permission to execute queries in the Log Analytics workspace, based on the built-in Azure Monitor Logs **Reader** role:
283
+
1. Create a custom role that grants read access to table data, based on the built-in Azure Monitor Logs **Reader** role:
284
284
285
-
1. Navigate to your workspace and select **Access control (IAM)** > **Roles**.
285
+
1. Navigate to your workspace and select **Access control (AIM)** > **Roles**.
286
286
287
287
1. Right-click the **Reader** role and select **Clone**.
288
288
289
289
:::image type="content" source="media/manage-access/access-control-clone-role.png" alt-text="Screenshot that shows the Roles tab of the Access control screen with the clone button highlighted for the Reader role." lightbox="media/manage-access/access-control-clone-role.png":::
290
290
291
291
This opens the **Create a custom role** screen.
292
292
293
-
1. On the **Basics** tab of the screen, enter a **Custom role name** value and, optionally, provide a description.
293
+
1. On the **Basics** tab of the screen enter a **Custom role name** value and, optionally, provide a description.
294
294
295
295
:::image type="content" source="media/manage-access/manage-access-create-custom-role.png" alt-text="Screenshot that shows the Basics tab of the Create a custom role screen with the Custom role name and Description fields highlighted." lightbox="media/manage-access/manage-access-create-custom-role.png":::
296
296
@@ -299,6 +299,17 @@ To create a [custom role](../../role-based-access-control/custom-roles.md) that
299
299
:::image type="content" source="media/manage-access/manage-access-create-custom-role-json.png" alt-text="Screenshot that shows the JSON tab of the Create a custom role screen with the actions section of the JSON file highlighted." lightbox="media/manage-access/manage-access-create-custom-role-json.png":::
300
300
301
301
1. Select **Review + Create** at the bottom of the screen, and then **Create** on the next page.
302
+
1. Copy the custom role ID:
303
+
1. Select **Access control (AIM)** > **Roles**.
304
+
1. Right-click on your custom role and select **Edit**.
305
+
306
+
This opens the **Custom Role** screen.
307
+
308
+
:::image type="content" source="media/manage-access/manage-access-role-definition-id.png" alt-text="Screenshot that shows the JSON tab of the Custom Role screen with the ID field highlighted." lightbox="media/manage-access/manage-access-role-definition-id.png":::
309
+
310
+
1. Select **JSON** and copy the `id` field.
311
+
312
+
You'll need the `/providers/Microsoft.Authorization/roleDefinitions/<definition_id>` value when you call the `https://management.azure.com/batch?api-version=2020-06-01` POST API.
302
313
303
314
1. Assign your custom role to the relevant users or groups:
304
315
1. Select **Access control (AIM)** > **Add** > **Add role assignment**.
@@ -328,9 +339,9 @@ To create a [custom role](../../role-based-access-control/custom-roles.md) that
@@ -349,15 +360,15 @@ To create a [custom role](../../role-based-access-control/custom-roles.md) that
349
360
350
361
Where:
351
362
- You can generate a GUID for `<GUID 1>` and `<GUID 2>` using any GUID generator.
352
-
- `<user_object_ID>` is the object ID of the user to which you want to grant table read access.
363
+
- `<custom_role_ID>` is the `/providers/Microsoft.Authorization/roleDefinitions/<definition_id>` value you copied earlier.
353
364
- `<subscription_ID>` is the ID of the subscription related to the workspace.
354
365
- `<resource_group_name>` is the resource group of the workspace.
355
366
- `<workspace_name>` is the name of the workspace.
356
367
- `<table_name>` is the name of the table to which you want to assign the user or group permission to read data from.
357
368
358
369
### Legacy method of setting table-level read access
359
370
360
-
[Azure custom roles](../../role-based-access-control/custom-roles.md) let you grant access to specific tables in the workspace, although we recommend defining [table-level read access](#set-table-level-read-access-preview) as described above.
371
+
[Azure custom roles](../../role-based-access-control/custom-roles.md) let you grant access to specific tables in the workspace, although we recommend defining [table-level read access](#set-table-level-read-access) as described above.
361
372
362
373
Azure custom roles apply to workspaces with either workspace-context or resource-context [access control modes](#access-control-mode) regardless of the user's [access mode](#access-mode).
0 commit comments