Skip to content

Add RBAC aggregation labels to ObjectStore editor/viewer ClusterRoles #1102

Description

@stefanpeknik

The barman-plugin-objectstore-editor-role and barman-plugin-objectstore-viewer-role ClusterRoles are missing the standard Kubernetes RBAC aggregation labels. Without them, users bound to the built-in admin, edit, or view ClusterRoles can't access ObjectStore resources, even in namespaces where they have full access otherwise.

Any service account that relies on aggregated roles (e.g. an ArgoCD account bound to admin) gets a 403 on ObjectStore CRs:

objectstores.barmancloud.cnpg.io "my-store" is forbidden: User
"system:serviceaccount:my-namespace:my-service-account" cannot get resource "objectstores" in API
group "barmancloud.cnpg.io" in the namespace "my-namespace"

The fix is adding aggregation labels to both ClusterRoles.

On barman-plugin-objectstore-editor-role:

metadata:
  labels:
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
    rbac.authorization.k8s.io/aggregate-to-edit: "true"

On barman-plugin-objectstore-viewer-role:

metadata:
  labels:
    rbac.authorization.k8s.io/aggregate-to-view: "true"

The main CloudNative-PG operator already does this for its CRDs. Without these labels, every deployer has to create RoleBindings for the ObjectStore ClusterRoles manually in each namespace.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions