Skip to content

Commit 02313fe

Browse files
Document the RBAC management UI for Calico Enterprise
Add "Manage roles in the web console" under Operations > Calico Enterprise Manager UI, covering what the feature needs to be usable: turning it on, creating and scoping a role, granting it to a subject, binding it to an identity provider group, reviewing who holds what, and exporting roles to another cluster. Scoped to Calico Enterprise 3.24 (next) only, plus its sidebar entry and a cross-link from "Configure user roles and permissions". Behaviour the page is deliberate about, since each is easy to get wrong: - Role names take any non-empty string up to 253 characters, matching ValidateIdentity. Spaces, '@' and non-ASCII are all valid and necessary, since the name has to equal the group claim the IdP sends. - Turning the feature off uses get | jq | kubectl replace, because tigera-network-admin holds get and update on rbac-ui-config, not patch. - Subjects added by hand go on the ClusterRoleBindings. Those are what FindExistingMemberSubjects reads back, so a subject added only to a namespaced RoleBinding is dropped the next time the role is edited in the console. - IdP group binding is LDAP-only and single-homed on the management cluster: the manager's egress opens 389/636 only when Authentication.spec.ldap is set and scopes the destination to spec.ldap.host, and the /team/idp-groups routes always target the management cluster. The directory-sync secret is a second secret, distinct from tigera-ldap-credentials. - Export carries bindings, not the ClusterRoles they reference, so the target cluster needs role management on and the same tiers and namespaces. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 021dbf4 commit 02313fe

3 files changed

Lines changed: 145 additions & 0 deletions

File tree

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
description: Create, scope, and export Calico Enterprise roles from the web console instead of writing Kubernetes RBAC manifests by hand.
3+
---
4+
5+
import IconUser from '/img/icons/user-icon.svg';
6+
7+
# Manage roles in the web console
8+
9+
## Big picture
10+
11+
Create and scope $[prodname] roles from the **Manage Team** page in the web console, instead of writing Kubernetes RBAC manifests by hand.
12+
13+
## Value
14+
15+
Giving a team access to one tier, one namespace, or one web console feature normally means hand-writing `ClusterRole` and `ClusterRoleBinding` manifests, and knowing which $[prodname] API resources each feature reads. **Manage Team** turns that into a list of named permissions: you pick what a role can view or modify and where it applies, and $[prodname] writes and reconciles the underlying Kubernetes RBAC for you.
16+
17+
## Concepts
18+
19+
### A role is a Kubernetes group
20+
21+
A role you create in the console is a Kubernetes **group name**. $[prodname] binds the permissions you select to that group using `ClusterRoleBindings`, or `RoleBindings` for permissions you scope to a namespace. Everything it writes is labeled `app.kubernetes.io/managed-by=calico-ui-rbac`.
22+
23+
A user gets a role when their authenticated identity carries that group. The console does not create or invite users: the **Users** tab is read-only, and lists the subjects it finds on the roles' bindings and in any bound identity provider groups, with the roles in effect for each.
24+
25+
### Role management is per cluster
26+
27+
Role management is off by default and is turned on one cluster at a time, including each managed cluster in a multi-cluster deployment. Roles are local to the cluster they were created on and are not synchronized; use **Export YAML** to copy them to another cluster.
28+
29+
## Before you begin
30+
31+
**Required**
32+
33+
- A cluster running $[prodname] 3.24.0-3.0 or later
34+
- [Access to the web console](access-the-manager.mdx) as a user bound to `tigera-network-admin`
35+
36+
**Limitations**
37+
38+
- Roles do not synchronize between clusters. Exported roles are a copy, not a link.
39+
40+
## How to
41+
42+
- [Turn on role management](#turn-on-role-management)
43+
- [Create a role](#create-a-role)
44+
- [Give a user a role](#give-a-user-a-role)
45+
- [Bind roles to identity provider groups](#bind-roles-to-identity-provider-groups)
46+
- [See who has access](#see-who-has-access)
47+
- [Copy roles to another cluster](#copy-roles-to-another-cluster)
48+
49+
### Turn on role management
50+
51+
1. In the web console, select the cluster you want to manage roles on.
52+
1. Click the user icon <IconUser width="20"/> > **Manage Team**.
53+
1. Click **Enable RBAC management**.
54+
55+
$[prodname] sets `rbac-ui-enabled` to `true` in the `rbac-ui-config` ConfigMap in the `calico-system` namespace, then builds the catalogue of permissions. This takes a few seconds, after which the **Roles** and **Users** tabs appear.
56+
57+
To turn role management off again, set the flag back to `false`; the console has no control for this. Roles you already created keep working, but are no longer manageable from the console.
58+
59+
```bash
60+
kubectl get configmap rbac-ui-config -n calico-system -o json \
61+
| jq '.data["rbac-ui-enabled"] = "false"' \
62+
| kubectl replace -f -
63+
```
64+
65+
`kubectl patch` fails here: `tigera-network-admin` holds `get` and `update` on this ConfigMap, not `patch`.
66+
67+
### Create a role
68+
69+
1. Click the user icon <IconUser width="20"/> > **Manage Team** > **Roles** > **Create Role**.
70+
1. If an LDAP directory is connected, **Create Role** opens on a choice between **Bind an IdP group** and **Manual group binding**. Select **Manual group binding** and click **Next** — to bind a directory group instead, see [Bind roles to identity provider groups](#bind-roles-to-identity-provider-groups). With no directory connected, the role form opens straight away.
71+
1. Enter a **Role Name** and **Description**. The name is the Kubernetes group this role binds to; any non-empty value up to 253 characters is accepted, spaces and `@` included. You attach users and service accounts to it afterwards — see [Give a user a role](#give-a-user-a-role).
72+
1. Click **Add Permission** and choose one. Permissions are per feature area — policies, network sets, dashboards, service graph, packet captures, egress gateways and so on — each offered as **View** or **Modify**. The picker lists what is available on the cluster. Note that **Alerts and Security Events Settings** covers alert configuration, not the events themselves.
73+
1. Scope the permission, where it supports it:
74+
- **Tier** — for policy permissions. Leave it as **all tiers** to apply the permission to every tier.
75+
- **Namespace** — for namespaced permissions. Leave it as **any namespace** to apply the permission cluster-wide.
76+
1. Add any further permissions, then click **Save**. A role must carry at least one permission.
77+
78+
To change a role later, select **Actions** > **Edit Permissions**. **Delete Role** removes the role and its bindings from this cluster; subjects bound to it lose the access it granted.
79+
80+
### Give a user a role
81+
82+
Because a role is a group, membership is what grants it. Create the role with [Bind an IdP group](#bind-roles-to-identity-provider-groups) and everyone in that group picks it up at their next sign-in, with nothing to do outside the console. Membership stays managed in your identity provider — see [Configure an external identity provider](configure-identity-provider.mdx).
83+
84+
To audit which group each role binds, list the bindings the console manages. Use the **Users** tab to see who currently holds them.
85+
86+
```bash
87+
kubectl get clusterrolebinding -l app.kubernetes.io/managed-by=calico-ui-rbac \
88+
-o custom-columns='NAME:.metadata.name,ROLE:.roleRef.name,GROUP:.subjects[0].name'
89+
```
90+
91+
### Bind roles to identity provider groups
92+
93+
A role can be bound to a group that already exists in your directory, so membership stays managed in your identity provider. Users in that group get the role the next time they sign in.
94+
95+
This requires the cluster to authenticate users with [LDAP](configure-identity-provider.mdx): $[prodname] permits directory-sync traffic only to the host named in `Authentication.spec.ldap.host`, and only on ports 389 and 636.
96+
97+
The directory is read on the management cluster only, so create the secret there and turn role management on there too — even when the role applies to a managed cluster. It is a second secret, separate from the `tigera-ldap-credentials` secret that authentication uses: different namespace, different field names, so copy the values across rather than the keys.
98+
99+
1. Create the directory-sync secret, using the same LDAP host as your `Authentication` resource — as a full URL here, where `Authentication.spec.ldap.host` takes `host:port`. $[prodname] walks the directory with these credentials and offers the groups it finds when you create a role.
100+
101+
```bash
102+
kubectl create secret generic tigera-idp-ldap-config -n calico-system \
103+
--from-literal=url=ldaps://ad.example.com:636 \
104+
--from-literal=bindDN='cn=admin,dc=example,dc=com' \
105+
--from-literal=bindPassword='<password>' \
106+
--from-literal=baseDN='ou=groups,dc=example,dc=com'
107+
```
108+
109+
Optionally add `groupFilter` (default `(objectClass=groupOfNames)`), `nameAttribute` (default `cn`; Active Directory typically uses `sAMAccountName`), `caBundle` for a private certificate authority, and `refreshIntervalSeconds` (default 300, clamped to 60–86400).
110+
111+
1. Click the user icon <IconUser width="20"/> > **Manage Team** > **Roles** > **Create Role**.
112+
1. Leave **Bind an IdP group** selected, choose a group from the list, and click **Next**. Groups that already back a role are shown as unavailable.
113+
1. Add permissions as you would for any role, then click **Save**. The form shows the bound group as a read-only **IdP Group**, alongside a **Role Display Name** you can edit. The display name is a label only, so nothing here has to match your directory.
114+
115+
The role appears in the list with type **Custom - IdP**. Membership is owned by your identity provider, so the role's subjects cannot be edited from the console. A group can back only one role; groups that already have one are marked in the picker.
116+
117+
### See who has access
118+
119+
Click the user icon <IconUser width="20"/> > **Manage Team** > **Users** to review which subjects hold which roles, and when each last signed in. Select a subject to see the permissions its roles carry.
120+
121+
The tab is read-only, and lists the subjects on the roles' bindings plus the members of any bound identity provider groups; **Last signed in** fills in once a subject authenticates. Effective permissions are the union of these roles and anything bound to the subject outside the console, which this view does not show.
122+
123+
### Copy roles to another cluster
124+
125+
Roles apply only to the cluster they were created on. To reuse them elsewhere, export them and apply them to a cluster that also has role management turned on. The export carries each role's bindings, not the permissions they point at, and those exist only where the console has built its catalogue.
126+
127+
1. Select the source cluster, then click the user icon <IconUser width="20"/> > **Manage Team** > **Roles** > **Export YAML**.
128+
1. Apply the file to each target cluster.
129+
130+
```bash
131+
kubectl apply -f <exported-file>.yaml
132+
```
133+
134+
Check first that the target cluster has the tiers and namespaces the roles were scoped to. A binding naming a tier that is missing there applies without error but grants nothing, and a binding into a namespace that does not exist is rejected.
135+
136+
The roles are independent copies: later changes on the source cluster are not propagated.
137+
138+
## Additional resources
139+
140+
- [Configure user roles and permissions](roles-and-permissions.mdx)
141+
- [Configure an external identity provider](configure-identity-provider.mdx)
142+
- [Configure RBAC for tiered policies](../../network-policy/policy-tiers/rbac-tiered-policies.mdx)

‎calico-enterprise/operations/cnx/roles-and-permissions.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ $[prodname] provides the following predefined roles and permissions:
4040

4141
## Additional resources
4242

43+
- [Manage roles in the web console](manage-roles.mdx) — create and scope roles without writing RBAC manifests.
44+
4345
For RBAC details on any given feature, see the feature. For example:
4446

4547
- [Tiered policy RBAC](../../network-policy/policy-tiers/rbac-tiered-policies.mdx)

‎sidebars-calico-enterprise.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ module.exports = {
549549
'operations/cnx/authentication-quickstart',
550550
'operations/cnx/configure-identity-provider',
551551
'operations/cnx/roles-and-permissions',
552+
'operations/cnx/manage-roles',
552553
],
553554
},
554555
'operations/comms/index',

0 commit comments

Comments
 (0)