Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
There are three ways to manage table-level access in a Log Analytics workspace using role-based access control (RBAC). This article references all the methods, even though only granular RBAC is recommended.
Granular RBAC lets you finely tune access at the table or row level. Users with table-level access can read data and query from specified tables in both the workspace and the resource context. For more information, see Granular RBAC.
Configure granular RBAC for table-level access
Table-level access configuration using granular RBAC is less complex than earlier methods and offers the flexibility to implement row-level conditions. These steps just focus on configuring table-level access though. For more information, see Granular RBAC.
Configuring granular RBAC for table-level access requires these steps:
- Create granular RBAC custom role
- Build condition for the assigned role (permissive or restrictive)
Create granular RBAC custom role
The control plane "data action" is one of the things that sets granular RBAC apart from earlier methods of configuring table-level access. For more information, see Create granular RBAC custom role.
Here's the JSON for an example custom role:
{ "properties": {
"roleName": "Log Analytics Standard Table Access",
"description": "This custom role provides general access to all non-restricted tables.",
"assignableScopes": [
"/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/contoso-US-la-workspace"
],
"permissions": [
{
"actions": [
"Microsoft.OperationalInsights/workspaces/read",
"Microsoft.OperationalInsights/workspaces/query/read"
],
"notActions": [],
"dataActions": [
"Microsoft.OperationalInsights/workspaces/tables/data/read"
],
"notDataActions": []
}
]
}
}
Assign the custom role to a user or group. For more information, see Assign granular RBAC roles.
- From the Log Analytics workspace, select Access control (IAM).
- Select Add role assignment.
- Select the
Log Analytics Standard Table Access
example custom role you created, then select Next. - Select the user or group you want to assign the role to, then select Next. This example assigns the role to the network team security group.
- Select Conditions > Add condition > Add action.
- Choose the Read workspace data data action > Select.
Build permissive condition
This example builds a permissive condition using the Access to all data, except what isn't allowed strategy. Access is restricted to the SigninLogs
and SecurityEvent
tables but access is permitted to all other tables. To see an example of a restrictive condition, see Granular RBAC use cases.
- In the Build expression section, select Add expression
- Select Resource from the Attribute source dropdown.
- Select Table Name from the Attribute dropdown.
- Select ForAnyOfAllValues:StringNotEquals from the Operator dropdown.
- Type
SigninLogs
andSecurityEvent
in the Value fields.
Here's how the permissive table-level access condition looks when completed.
With a single role assignment, table-level access is configured separating restricted tables from standard tables. For more information, see granular RBAC considerations and troubleshooting granular RBAC.
Configure table-level access (dual role method)
The best practice is to use the granular RBAC method instead of this method. For reference, this section outlines the steps on how the dual role method is configured.
This method of table-level access control also uses Azure custom roles to grant users or groups access to specific tables in a workspace, but requires assigning two roles for each user or group.
Scope | Role Description |
---|---|
Workspace | A custom role that provides limited permissions to read workspace details and run a query in the workspace, but not to read data from any tables |
Table | A Reader role, scoped to the specific table |
Build workspace role
Create a custom role at the workspace level to let users read workspace details and run a query in the workspace, without providing read access to data in any tables:
- Navigate to your workspace and select Access control (IAM) > Roles.
- Right-click the Reader role and select Clone.
This opens the Create a custom role screen.
- On the Basics tab of the screen:
- Select the JSON tab > Edit:
- In the
"actions"
section, add these actions:"Microsoft.OperationalInsights/workspaces/read", "Microsoft.OperationalInsights/workspaces/query/read"
- In the
"not actions"
section, add:"Microsoft.OperationalInsights/workspaces/sharedKeys/read"
- In the
- Select Save > Review + Create > Create.
- Select Access control (AIM) > Add > Add role assignment.
- Select the custom role you created and select Next. This opens the Members tab of the Add custom role assignment screen.
- + Select members to open the Select members screen.
- Search for a user > Select.
- Select Review and assign.
The user can now read workspace details and run a query, but can't read data from any tables.
Assign table access role
- From the Log Analytics workspaces menu, select Tables.
- Select the ellipsis ( ... ) to the right of your table and select Access control (IAM).
- On the Access control (IAM) screen, select Add > Add role assignment.
- Select the Reader role and select Next.
- + Select members to open the Select members screen.
-
- Search for the user > Select.
- Select Review and assign.
The user can now read data from this specific table. Grant the user read access to other tables in the workspace, as needed.
Configure table-level access (legacy method)
The legacy method of table-level access control is no longer recommended. It doesn't support row-level conditions and is more complex than the granular RBAC method. The best practice is to use the granular RBAC method instead of this method. For reference, this section outlines the steps on how the legacy method was configured.
The legacy method of table-level also uses Azure custom roles to let you grant 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 regardless of the user's access mode.
To define access to a particular table, create a custom role:
- Set the user permissions in the Actions section of the role definition.
- Use
Microsoft.OperationalInsights/workspaces/query/*
to grant access to all tables. - 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.
Here are examples of custom role actions to grant and deny access to specific tables.
Grant access to the Heartbeat and AzureActivity tables:
"Actions": [
"Microsoft.OperationalInsights/workspaces/read",
"Microsoft.OperationalInsights/workspaces/query/read",
"Microsoft.OperationalInsights/workspaces/query/Heartbeat/read",
"Microsoft.OperationalInsights/workspaces/query/AzureActivity/read"
],
Grant access to only the SecurityBaseline table:
"Actions": [
"Microsoft.OperationalInsights/workspaces/read",
"Microsoft.OperationalInsights/workspaces/query/read",
"Microsoft.OperationalInsights/workspaces/query/SecurityBaseline/read"
],
Grant access to all tables except the SecurityAlert table:
"Actions": [
"Microsoft.OperationalInsights/workspaces/read",
"Microsoft.OperationalInsights/workspaces/query/read",
"Microsoft.OperationalInsights/workspaces/query/*/read"
],
"notActions": [
"Microsoft.OperationalInsights/workspaces/query/SecurityAlert/read"
],
Limitations of the legacy method related to custom tables
Custom tables store data you collect from data sources such as text logs and the HTTP Data Collector API. To identify the table type, view table information in Log Analytics.
Using the legacy method of table-level access, you can't grant access to individual custom log tables at the 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:
"Actions": [
"Microsoft.OperationalInsights/workspaces/read",
"Microsoft.OperationalInsights/workspaces/query/read",
"Microsoft.OperationalInsights/workspaces/query/Tables.Custom/read"
],
Considerations
- In the Log Analytics UI, users with table-level can see the list of all tables in the workspace, but can only retrieve data from tables to which they have access.
- The standard Reader or Contributor roles, which include the */read action, override table-level access control and give users access to all log data.
- A user with table-level access but no workspace-level permissions can access log data from the API but not from the Azure portal.
- Administrators and owners of the subscription have access to all data types regardless of any other permission settings.
- Workspace owners are treated like any other user for per-table access control.
- Assign roles to security groups instead of individual users to reduce the number of assignments. This best practice helps you use existing group management tools to configure and verify access.