Operator or Admin role) gets admin-level access to Kubernetes across all clusters.
Access Policies (ACLs) let you grant users additional access on specific clusters, beyond their Omni role. For example, a user with the Omni role Reader can be given full access to a staging cluster while keeping read-only access in production.
Only users with the Omni role Admin can view, create, or modify ACLs.
How Omni evaluates an access policy
All ACL rules are stored in a singleAccessPolicy resource with the ID access-policy. Applying a policy replaces the existing policy, so the applied file must include every rule.
When a user accesses a cluster, Omni evaluates every rule that matches both the user and the cluster, and combines the results:
- Role: The ACL grants the highest role among the matching rules. If no rule matches, the user’s Omni role applies. The effective role applies to the cluster’s resources in Omni, to
kubeconfigandtalosconfigdownloads, and to Talos API access through Omni. - Lists across all clusters: For lists of resources across all clusters, such as
omnictl get clusters, the role granted by the ACL applies when the rule’s cluster group usesmatch: "*". In other cases, the user’s Omni role applies to these lists. - Kubernetes groups: The user is assigned every group listed in
kubernetes.impersonate.groupsacross the matching rules. - Cluster-admin access: If the ACL grants the
OperatororAdminrole, Omni also assigns thesystem:mastersgroup, which grants cluster-admin access. This group does not need to be listed in the rule.
system:masters have no permissions until they are bound to a Role or ClusterRole through Kubernetes RBAC. If a user can connect to a cluster but receives Forbidden errors from kubectl, verify that an RBAC binding exists for the user’s groups. See Configure Kubernetes RBAC.
For a description of every field in the AccessPolicy resource, see the Access Policies reference.
Create an access policy
The following policy grants the usersupport@example.com the Operator role on the staging cluster, and read-only access to the my-app namespace on the production cluster. This example assumes that the user’s Omni role is Reader or None.
Save the policy to a file named acl.yaml:
- The first rule grants the
Operatorrole onstaging. Omni also assigns thesystem:mastersgroup, which grants cluster-admin access to that cluster. - The second rule grants the
Readerrole onproductionand assigns themy-app-read-onlygroup. The permissions for this group are defined in Configure Kubernetes RBAC. - The
testssection defines the expected result for each user and cluster pair.
Admin:
Tests compare only the groups listed in the rules. The
system:masters group that Omni assigns for the Operator and Admin roles is not included in the comparison. Do not list system:masters in a test’s expected groups unless a matching rule lists it.Group users and clusters
User groups and cluster groups allow a single rule to apply to multiple users or clusters. User groups are defined underusergroups, and cluster groups are defined under clustergroups. A rule references a group by its name with the group/ prefix, for example group/level-1. Entries in a rule without the group/ prefix must match a user identity or cluster name exactly, so patterns and label selectors are only available through groups.
Users in a user group can be matched in one of three ways:
name: Matches an exact user identity, such asadmin1@example.com.match: Matches user identities against a glob pattern, such aslevel-1*.labelselectors: Matches users by the labels on their identity. A user matches only if all selectors in the list match. When SAML is enabled, Omni adds labels to each identity based on the user’s SAML attributes, for examplesaml.omni.sidero.dev/role/<role-name>. See Configure SAML and ACLs.
name or match. Label selectors are not supported for clusters.
The following policy defines three user groups, one for each level of engineer, and three cluster groups, one for each environment:
Reader rules in this policy assign the read-only group. This group has no permissions until it is bound to a role through Kubernetes RBAC in each staging and production cluster. See Configure Kubernetes RBAC.
Configure Kubernetes RBAC
The role in an ACL rule determines what a user can do in Omni. Permissions inside a Kubernetes cluster are determined by the groups inkubernetes.impersonate.groups. Each group must be bound to a Role or ClusterRole through Kubernetes RBAC.
The following manifest binds the my-app-read-only group from Create an access policy to the built-in view cluster role in the my-app namespace. The view role grants read-only access to most resources in the namespace, excluding Secrets.
Save the manifest to a file named rbac.yaml:
production cluster as a user with cluster-admin access:
ClusterRoleBinding instead. The following manifest grants this access to the read-only group from Group users and clusters:
Verify access
To verify the policy, download akubeconfig for the production cluster as support@example.com. Downloading a kubeconfig requires at least the Reader role on the cluster.
If the user’s Omni role is None, download the kubeconfig with omnictl instead of the Omni web interface:
my-app namespace:
my-app-read-only group is bound to the view role in the my-app namespace.
Next, list the pods in a different namespace:
Forbidden error, because the user has no permissions outside the my-app namespace.
If
support@example.com has the Omni role Operator or Admin, the user is also assigned the system:masters group and can list pods in every namespace.