solo-io / gloo-portal-issues

Public tracker for issues related to Gloo Portal
https://docs.solo.io/gloo-portal/latest/
1 stars 3 forks source link

Support RBAC for Admin Portal UI #187

Closed kcbabo closed 1 year ago

kcbabo commented 1 year ago

Background The Admin Portal UI is currently accessed through port-forwarding the gloo-portal-admin-server service without authentication or authorization for users in the UI. This issue covers the ability to enable authentication of users in the Portal Admin UI and to perform authorization checks to restrict which Portal resources a user can view/modify through the UI.

Authentication The Portal Admin UI should support configuring OIDC as an authentication option for accessing the Portal. When enabled, a login page should be presented in the Portal Admin UI along with a logout function in the menu bar. The IdP used in this OIDC configuration must be the same IdP used in the underlying Kubernetes cluster, which means any user logging in through the Portal Admin UI must be a valid user in the underlying Kubernetes environment. This will require:

The following resources provide additional information: https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/ https://kubernetes.io/docs/reference/access-authn-authz/authorization/

Authorization Authorization in the Portal Admin UI is driven by Kubernetes RBAC. User access to Portal resources is implemented by defining Roles and RoleBindings in the Kubernetes cluster. The Portal Admin UI defaults to the Gloo Portal controller namespace (e.g. gloo-portal) for creating resources, so Role and RoleBinding definitions should be defined for the same namespace. The Role definitions should only provide access to Portal resources that a user can view/modify through the UI.

UI Mapping This section details the behavior of UI pages based on associated Role configuration.

Top Nav Menu

Dashboard (/)

Portals (/portals)

APIs (/apis)

Access Control (/access-control)

Gloo Config (/gloo-configuration)

kcbabo commented 1 year ago

Related to https://github.com/solo-io/gloo/issues/7055

kcbabo commented 1 year ago

As an example, here's what the aud and iss claims look like in my local environment:

{
  "aud": [
      "https://kubernetes.default.svc.cluster.local"
    ],
  "iss": "https://kubernetes.default.svc.cluster.local"
}
nfuden commented 1 year ago

Looks like this is done as https://github.com/solo-io/dev-portal/pull/2511 has merged