Skip to content

Commit acf97e4

Browse files
authored
Review "Team LBAC" page (grafana#83406)
1 parent 213e399 commit acf97e4

File tree

2 files changed

+34
-50
lines changed

2 files changed

+34
-50
lines changed
File renamed without changes.

docs/sources/administration/data-source-management/teamlbac/_index.md

Lines changed: 34 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,71 +14,55 @@ weight: 100
1414

1515
# Team LBAC
1616

17-
{{% admonition type="note" %}}
18-
Creating Team LBAC rules is available for preview for logs with Loki in Grafana Cloud. Report any unexpected behavior to the Grafana Support team.
19-
{{% /admonition %}}
17+
Team Label Based Access Control (LBAC) simplifies and streamlines data source access management based on team memberships.
2018

21-
**Current Limitation:**
19+
{{< admonition type="note" >}}
20+
Creating Team LBAC rules is available for preview for logs with Loki in Grafana Cloud.
21+
Report any unexpected behavior to the Grafana Support team.
22+
{{< /admonition >}}
2223

23-
- Any user with `query` permissions for a Loki data source can query all logs if there are no Team LBAC rules configured for any of the users team.
24-
- An admin that is part of a team, would have it's Team LBAC rules applied to the request.
25-
- Team LBAC rules will not be applied if the linked Cloud Access Policy has label selectors.
24+
You can configure user access based upon team memberships using LogQL.
25+
Team LBAC controls access to logs depending on the rules set for each team.
2626

27-
Grafana's new **Team LBAC** (Label Based Access Control) feature for Loki is a significant enhancement that simplifies and streamlines data source access management based on team memberships.
27+
This feature addresses two common challenges faced by Grafana users:
2828

29-
**Team LBAC** in the context of Loki, is a way to control access to logs based on labels present depending on the rules set for each team. Users wanting fine grained access to their logs in Loki, can now configure their users access based on their team memberships via **LogQL**.
29+
1. Having a high number of Grafana Cloud data sources.
30+
Team LBAC lets Grafana administrators reduce the total number of data sources per instance from hundreds, to one.
31+
1. Using the same dashboard across multiple teams.
32+
Team LBAC lets Grafana Teams use the same dashboard with different access control rules.
3033

31-
This feature addresses two common challenge faced by Grafana users:
34+
To set up Team LBAC for a Loki data source, refer to [Configure Team LBAC](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/administration/data-source-management/teamlbac/configure-teamlbac-for-loki/).
3235

33-
1. High volume of Grafana Cloud datasource. Team LBAC lets Grafana Admins reduce the total volume of data sources per instance from hundreds, to one.
34-
1. Hard for teams to share dashboard. Team LBAC lets Grafana Teams share the same dashboard despite different access control rules.
36+
## Limitations
3537

36-
For setting up Team LBAC for a Loki data source, refer to [Configure Team LBAC]({{< relref "./configure-teamlbac-for-loki/" >}}).
38+
- If there are no Team LBAC rules for a user's team, that user can query all logs.
39+
- If an administrator is part of a team with Team LBAC rules, those rules are applied to the administrator requests.
40+
- Cloud Access Policies (CAP) LBAC rules override Team LBAC rules.
41+
Cloud Access Policies are the access controls from Grafana Cloud.
42+
If there are any CAP LBAC rules configured for the same data source, then only the CAP LBAC rules are applied.
3743

38-
#### Datasource Permissions
44+
You must remove any label selectors from your Cloud Access Policies to use Team LBAC.
45+
For more information about CAP label selectors, refer to [Use label-based access control (LBAC) with access policies](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/label-access-policies/).
3946

40-
Datasource permissions allow the users access to query the datasource. The permissions are set at the datasource level and are inherited by all the teams and users that are part of the datasource.
47+
## Data source permissions
4148

42-
#### Recommended setup
49+
Data source permissions allow the users access to query the data source.
50+
Administrators set the permissions at the data source level.
51+
All the teams and users that are part of the data source inherit those permissions.
4352

44-
We recommend to create a loki datasource dedicated for Team LBAC rules with only teams having `query` permission. This will allow you to have a clear separation of datasources for Team LBAC and the datasources that are not using Team LBAC. Another loki datasource would be setup for full access to the logs.
53+
## Recommended setup
4554

46-
Ex:
47-
48-
1. Datasource `loki-full-access`, same setup for the loki tenant, the users querying this datasource would not have team lbac rules and have `query` permissions.
49-
2. Datasource `loki-lbac`, same setup, the users querying the data source would have to be part of a team and a LBAC rule.
55+
It's recommended that you create a single Loki data source for using Team LBAC rules so you have a clear separation of data sources using Team LBAC and those that aren't.
56+
All teams should have with only teams having `query` permission.
57+
You should create another Loki data source configured without Team LBAC for full access to the logs.
5058

5159
## Team LBAC rules
5260

53-
Team LBAC rules are added to the http request to Loki data source. Setting up Team LBAC rules for any team will apply those rules to the teams.
54-
Users who want teams with a specific set of label selectors can add rules for each team.
55-
56-
Configuring multiple rules for a team, each rule is evaluated separately. If a team has `X` number of rules configured for it, all rules will be applied to the request and the result will be the an "OR" operation of the `X` number of rules.
57-
58-
Only users with data source Admin permissions can edit LBAC rules at the data source permissions tab. Changing LBAC rules requires the same access level as editing data source permissions (admin permission for data source).
59-
60-
For setting up Team LBAC Rules for the data source, refer to [Create Team LBAC rules]({{< relref "./create-teamlbac-rules/" >}}).
61-
62-
### FAQ
63-
64-
> #### "If I want a user to have full access to the logs, but they are part of a team with LBAC rules?"
65-
>
66-
> The user should use another loki datasource that is specifically used to have full access to the logs. See best practices.
67-
68-
**Note:** A user who is part of a team within Grafana with a rule will only be able to query logs with that rule.
69-
70-
> #### "If a team does not have a rule, what happens?"
71-
72-
If a team does not have a rule; any users that are part of that team having query permissions for loki will have access to **all** logs.
73-
74-
> #### "Can I use CAPs (cloud access policies) together with TeamLBAC rules?"
75-
76-
No, CAP (cloud access policies) always have precedence. If there are any CAP LBAC configured for the same datasource and there are TeamLBAC rules configured, then only the CAP LBAC will be applied.
77-
78-
Cloud access policies are the access controls from Grafana Cloud, the CAP configured for loki should only to be used to gain read access to the logs.
61+
Grafana adds Team LBAC rules to the HTTP request via the Loki data source.
7962

80-
> #### "If administrator forget to add rule for a team, what happens?"
63+
If you configure multiple rules for a team, each rule is evaluated separately.
64+
Query results include lines that match any of the rules.
8165

82-
The teams that does not have a rule applied to it, would be able to query all logs if `query` permissions are setup for their role within Grafana.
66+
Only users with data source `Admin` permissions can edit Team LBAC rules in the **Data source permissions** tab because changing LBAC rules requires the same access level as editing data source permissions.
8367

84-
**Note:** A user who is part of a team within Grafana without a rule will be able to query all logs if the user has a role with `query` permissions.
68+
To set up Team LBAC for a Loki data source, refer to [Configure Team LBAC](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/administration/data-source-management/teamlbac/configure-teamlbac-for-loki/).

0 commit comments

Comments
 (0)