Skip to content

Commit 57e8f85

Browse files
authored
Update manage-access.md
------- cc: @guywi-ms
1 parent 439bd07 commit 57e8f85

File tree

1 file changed

+88
-7
lines changed

1 file changed

+88
-7
lines changed

articles/azure-monitor/logs/manage-access.md

Lines changed: 88 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,98 @@ In addition to using the built-in roles for a Log Analytics workspace, you can c
295295
- Add the following NonAction to block users from restoring archived logs: `Microsoft.OperationalInsights/workspaces/restoreLogs/write`
296296

297297

298-
## Set table-level read access
299-
300-
[Azure custom roles](../../role-based-access-control/custom-roles.md) let you grant specific users or groups access to specific tables in the workspace. 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).
298+
## Set table-level read access (preview)
299+
300+
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:
301+
302+
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:
303+
304+
1. Navigate to your workspace and select **Access control (IAM)** > **Roles**.
305+
306+
1. Right-click the **Reader** role and select **Clone**.
307+
308+
:::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":::
309+
310+
This opens the **Create a custom role** screen.
311+
312+
1. On the **Basics** tab of the screen, enter a **Custom role name** value and, optionally, provide a description.
313+
314+
:::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":::
315+
316+
1. Select the **JSON** tab > **Edit** and edit the `"actions"` section to include only `Microsoft.OperationalInsights/workspaces/query/read` and select **Save**.
317+
318+
:::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":::
319+
320+
1. Select **Review + Create** at the bottom of the screen, and then **Create** on the next page.
321+
322+
1. Assign your custom role to the relevant users or groups:
323+
1. Select **Access control (AIM)** > **Add** > **Add role assignment**.
324+
325+
:::image type="content" source="media/manage-access/manage-access-add-role-assignment-button.png" alt-text="Screenshot that shows the Access control screen with the Add role assignment button highlighted." lightbox="media/manage-access/manage-access-add-role-assignment-button.png":::
326+
327+
1. Select the custom role you created and select **Next**.
328+
329+
:::image type="content" source="media/manage-access/manage-access-add-role-assignment-screen.png" alt-text="Screenshot that shows the Add role assignment screen with a custom role and the Next button highlighted." lightbox="media/manage-access/manage-access-add-role-assignment-screen.png":::
330+
331+
332+
This opens the **Members** tab of the **Add custom role assignment** screen.
333+
334+
1. Click **+ Select members** to open the **Select members** screen.
335+
336+
:::image type="content" source="media/manage-access/manage-access-add-role-assignment-select-members.png" alt-text="Screenshot that shows the Select members screen." lightbox="media/manage-access/manage-access-add-role-assignment-select-members.png":::
337+
338+
1. Search for and select the relevant user or group and click **Select**.
339+
1. Select **Review and assign**.
340+
341+
1. Grant the users or groups read access to specific tables in a workspace by calling the `https://management.azure.com/batch?api-version=2020-06-01` POST API and sending the following details in the request body:
342+
343+
```json
344+
{
345+
"requests": [
346+
{
347+
"content": {
348+
"Id": "<GUID_1>",
349+
"Properties": {
350+
"PrincipalId": "<user_object_ID>",
351+
"PrincipalType": "User",
352+
"RoleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7",
353+
"Scope": "/subscriptions/<subscription_ID>/resourceGroups/<resource_group_name>/providers/Microsoft.OperationalInsights/workspaces/<workspace_name>/Tables/<table_name>",
354+
"Condition": null,
355+
"ConditionVersion": null
356+
}
357+
},
358+
"httpMethod": "PUT",
359+
"name": "<GUID_2>",
360+
"requestHeaderDetails": {
361+
"commandName": "Microsoft_Azure_AD."
362+
},
363+
"url": "/subscriptions/<subscription_ID>/resourceGroups/<resource_group_name>/providers/Microsoft.OperationalInsights/workspaces/<workspace_name>/Tables/<table_name>/providers/Microsoft.Authorization/roleAssignments/<GUID_1>?api-version=2020-04-01-preview"
364+
}
365+
]
366+
}
367+
```
368+
369+
Where:
370+
- You can generate a GUID for `<GUID 1>` and `<GUID 2>` using any GUID generator.
371+
- `<user_object_ID>` is the object ID of the user to which you want to grant table read access.
372+
- `<subscription_ID>` is the ID of the subscription related to the workspace.
373+
- `<resource_group_name>` is the resource group of the workspace.
374+
- `<workspace_name>` is the name of the workspace.
375+
- `<table_name>` is the name of the table to which you want to assign the user or group permission to read data from.
376+
377+
### Legacy method of setting table-level read access
378+
379+
[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.
380+
381+
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).
301382

302383
To define access to a particular table, create a [custom role](../../role-based-access-control/custom-roles.md):
303384

304385
* Set the user permissions in the **Actions** section of the role definition.
305386
* Use `Microsoft.OperationalInsights/workspaces/query/*` to grant access to all tables.
306387
* To exclude access to specific tables when you use a wildcard in **Actions**, list the tables excluded tables in the **NotActions** section of the role definition.
307388

308-
### Examples
389+
#### Examples
309390

310391
Here are examples of custom role actions to grant and deny access to specific tables.
311392

@@ -344,14 +425,14 @@ Grant access to all tables except the _SecurityAlert_ table:
344425
],
345426
```
346427
347-
### Custom tables
428+
#### Custom tables
348429
349430
Custom tables store data you collect from data sources such as [text logs](../agents/data-sources-custom-logs.md) and the [HTTP Data Collector API](data-collector-api.md). To identify the table type, [view table information in Log Analytics](./log-analytics-tutorial.md#view-table-information).
350431
351432
> [!NOTE]
352433
> Tables created by the [Logs ingestion API](../essentials/../logs/logs-ingestion-api-overview.md) don't yet support table-level RBAC.
353434
354-
You can't grant access to individual custom log table level, but you can grant access to all custom log tables. To create a role with access to all custom log tables, create a custom role by using the following actions:
435+
You can't grant access to individual custom log tables, but you can grant access to all custom logs. To create a role with access to all custom log tables, create a custom role by using the following actions:
355436
356437
```
357438
"Actions": [
@@ -367,7 +448,7 @@ Some custom logs come from sources that aren't directly associated to a specific
367448
368449
For example, if a specific firewall is sending custom logs, create a resource group called *MyFireWallLogs*. Make sure that the API requests contain the resource ID of *MyFireWallLogs*. The firewall log records are then accessible only to users who were granted access to *MyFireWallLogs* or those users with full workspace access.
369450
370-
### Considerations
451+
#### Considerations
371452
372453
- If a user is granted global read permission with the standard Reader or Contributor roles that include the _\*/read_ action, it will override the per-table access control and give them access to all log data.
373454
- If a user is granted per-table access but no other permissions, they can access log data from the API but not from the Azure portal. To provide access from the Azure portal, use Log Analytics Reader as its base role.

0 commit comments

Comments
 (0)