Skip to main content

RBAC

GitOps Export has three permission contexts: installer, runtime, and end user.

Installer Permissions

The installer runs:

oc apply -k manifests/overlays/install

Namespaced resources in gitops-export-console:

ResourceAPI groupVerbs
Deploymentapps/v1create, get, patch
Servicev1create, get, patch
ConfigMapv1create, get, patch
ServiceAccountv1create, get, patch
Jobbatch/v1create, get, patch

Cluster-scoped resources:

ResourceAPI groupVerbs
Namespacev1create, get, patch
ConsolePluginconsole.openshift.io/v1create, get, patch
ClusterRolerbac.authorization.k8s.io/v1create, get, patch
ClusterRoleBindingrbac.authorization.k8s.io/v1create, get, patch

The patcher Job uses a dedicated ClusterRole with get, list, patch, and update on consoles.operator.openshift.io.

Runtime Permissions

The nginx plugin pod serves static files and makes no Kubernetes API calls. It requires no additional RBAC grants.

End-user Permissions

The browser uses the current user's console session. The plugin needs list on each selected resource kind in the target namespace.

KindResourceDefault selected
Deploymentdeployments.appsyes
StatefulSetstatefulsets.appsyes
DaemonSetdaemonsets.appsyes
Jobjobs.batchyes
CronJobcronjobs.batchyes
Serviceservicesyes
Routeroutes.route.openshift.ioyes
Secretsecretsyes
ConfigMapconfigmapsyes
PersistentVolumeClaimpersistentvolumeclaimsyes
NetworkPolicynetworkpolicies.networking.k8s.ioyes
HorizontalPodAutoscalerhorizontalpodautoscalers.autoscalingyes
BuildConfigbuildconfigs.build.openshift.ioyes
ImageStreamimagestreams.image.openshift.ioyes
ImageStreamTagimagestreamtags.image.openshift.iono
Roleroles.rbac.authorization.k8s.iono
RoleBindingrolebindings.rbac.authorization.k8s.iono
ServiceAccountserviceaccountsno

Minimum Reader Role

Use this as a starting point for a user who should scan all supported resource kinds in one namespace.

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: gitops-export-reader
namespace: my-app
rules:
- apiGroups: [""]
resources:
- configmaps
- persistentvolumeclaims
- secrets
- serviceaccounts
- services
verbs: ["list"]
- apiGroups: ["apps"]
resources:
- daemonsets
- deployments
- statefulsets
verbs: ["list"]
- apiGroups: ["batch"]
resources:
- cronjobs
- jobs
verbs: ["list"]
- apiGroups: ["autoscaling"]
resources:
- horizontalpodautoscalers
verbs: ["list"]
- apiGroups: ["networking.k8s.io"]
resources:
- networkpolicies
verbs: ["list"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources:
- rolebindings
- roles
verbs: ["list"]
- apiGroups: ["route.openshift.io"]
resources:
- routes
verbs: ["list"]
- apiGroups: ["build.openshift.io"]
resources:
- buildconfigs
verbs: ["list"]
- apiGroups: ["image.openshift.io"]
resources:
- imagestreams
- imagestreamtags
verbs: ["list"]

Check access with:

oc auth can-i list deployments -n my-app
oc auth can-i list secrets -n my-app
oc auth can-i list rolebindings.rbac.authorization.k8s.io -n my-app