<p>We are enabling Google Cloud Groups RBAC in our existing GKE clusters.</p>
<p>For that, we first created all the groups in Workspace, and also the required &quot;gke-security-groups@ourdomain.com&quot; according to documentation.</p>
<p>Those groups are created in Workspace with an integration with Active Directory for Single Sign On.</p>
<p>All groups are members of &quot;gke-security-groups@ourdomain&quot; as stated by documentation. And all groups can View members.</p>
<p>The cluster was updated to enabled the flag for Google Cloud Groups RBAC and we specify the value to be &quot;gke-security-groups@ourdomain.com&quot;.</p>
<p>We then Added one of the groups (let's called it group_a@ourdomain.com) to IAM and assigned a custom role which only gives access to:</p>
<pre><code>&quot;container.apiServices.get&quot;,
&quot;container.apiServices.list&quot;,
&quot;container.clusters.getCredentials&quot;,
&quot;container.clusters.get&quot;,
&quot;container.clusters.list&quot;,
</code></pre>
<p>This is just the minimum for the user to be able to log into the Kubernetes cluster and from there being able to apply Kubernetes RBACs.</p>
<p>In Kubernetes, we applied a Role, which provides list of pods in a specific namespace, and a role binding that specifies the group we just added to IAM.</p>
<pre><code>kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: test-role
  namespace: custom-namespace
rules:
- apiGroups: [&quot;&quot;]
  resources: [&quot;pods&quot;]
  verbs: [&quot;get&quot;, &quot;list&quot;, &quot;watch&quot;]
</code></pre>
<hr />
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: test-rolebinding
  namespace: custom-namespace
roleRef:
  kind: Role
  name: test-role
  apiGroup: rbac.authorization.k8s.io
subjects:
  - kind: Group
    name: group_a@ourdomain.com
</code></pre>
<p>Everything looks good until now. But when trying to list the pods of this namespace with the user that belongs to the group &quot;group_a@ourdomain.com&quot;, we get:</p>
<blockquote>
<p>Error from server (Forbidden): pods is forbidden: User
&quot;my-user@ourdomain.com&quot; cannot list resource &quot;pods&quot; in API group &quot;&quot;
in the namespace &quot;custom-namespace&quot;: requires one of [&quot;container.pods.list&quot;]
permission(s).</p>
</blockquote>
<p>Of course if I give container.pods.list to the group_a@ourdomain assigned role, I can list pods, but it opens for all namespaces, as this permission in GCloud is global.</p>
<p>What am I missing here?</p>
<p>Not sure if this is relevant, but our organisation in gcloud is called for example &quot;my-company.io&quot;, while the groups for SSO are named &quot;...@groups.my-company.io&quot;, and the gke-security-groups group was also created with the &quot;groups.my-company.io&quot; domain.</p>
<p>Also, if instead of a Group in the RoleBinding, I specify the user directly, it works.</p>

<p>It turned out to be an issue about case-sensitive strings and nothing related with the actual rules defined in the RBACs, which were working as expected.</p>
<p>The names of the groups were created in Azure AD with a camel case model. These group names where then showed in Google Workspace all lowercase.</p>
<p><strong>Example in Azure AD:</strong>
thisIsOneGroup@groups.mycompany.com</p>
<p><strong>Example configured in the RBACs as shown in Google Workspace:</strong>
thisisonegroup@groups.mycompany.com</p>
<p>We copied the names from the Google Workspace UI all lowercase and we put them in the bindings and that caused the issue. Kubernetes GKE is case sensitive and it didn't match the name configured in the binding with the email configured in Google Workspace.</p>
<p>After changing the RBAC bindings to have the same format, everything worked as expected.</p>
