How to Configure RBAC Kubesphere

Published
Length
3 min read

Luis Felipe Dias

All posts

Setting up rbac kubesphere rules controls which users can read or change cluster resources. You build a safe setup by mapping team duties to scoped roles before users log in. Kubernetes permissions can grow messy when many teams share the same cluster. KubeSphere groups these permissions into clear levels so admins can manage user roles with less work. Instead of writing raw manifest files for every user, you assign roles at the platform, workspace, or project level. This structure helps teams

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Setting up rbac kubesphere rules controls which users can read or change cluster resources. You build a safe setup by mapping team duties to scoped roles before users log in.

Kubernetes permissions can grow messy when many teams share the same cluster. KubeSphere groups these permissions into clear levels so admins can manage user roles with less work. Instead of writing raw manifest files for every user, you assign roles at the platform, workspace, or project level. This structure helps teams isolate their apps while sharing the same base cluster.

How rbac kubesphere roles work across tiers

The platform splits permissions into four main levels to match how teams work. Platform roles control global settings, user accounts, and the whole cluster setup. Workspace roles group multiple projects together for a single department or business unit. Project roles map to a single Kubernetes namespace where developers run their apps. DevOps roles manage build pipelines and code delivery tasks for a specific team.

Every user or workload principal gets a role at the level they need. A platform admin can view and change all clusters and workspaces. A workspace manager can create new projects and invite team members into that space. A project operator can deploy containers and update config maps inside one namespace. A viewer role lets a user read logs and status pages without making changes.

Safe defaults start with giving each person the smallest role for their job. Do not give platform or cluster admin roles to regular app developers. Put shared apps in dedicated workspaces and grant developers project roles only where they ship code. When a team needs custom rules, create a role that lists only the exact actions required.

How to map external groups to workspace roles

Managing permissions one user at a time causes mistakes as a company grows. When people switch teams or leave, admins often forget to remove old project roles. Connecting an external identity provider lets you sync team groups straight into the platform. You can link a central group to a workspace role so new members get access right away.

Keep group rules simple by matching one identity group to one workspace role. Create separate groups for viewers, operators, and admins in each department. When an engineer needs to fix a live bug, add them to the operator group for that shift. Remove them from the group once the fix is done to keep standing permissions low.

Azure RBAC + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Checking permissions and closing session gaps

Admins should check role bindings often to spot users with too much access. Review workspace member lists every month and remove accounts that no longer run apps there. Check cluster audit logs to see which users run change commands or read secret values. Regular checks catch broad roles that were granted during past incidents and left behind.

Static role setups still leave security gaps after a user logs into a session. Once a project role allows pod execution or secret reading, the platform trusts every command inside that scope. A developer with legitimate access can run a shell inside a container and read raw config data. Role rules also cannot mask sensitive fields like emails, phone numbers, or card numbers returned in command output.

Native cluster roles check who starts a request, not what data comes back during an active session. If an engineer queries a service or reads a pod log containing national IDs, the raw text prints on screen. Closing this gap requires inspecting commands at runtime and rewriting matched fields in results before they reach the user.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.

First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

What is the difference between a workspace and a project in KubeSphere?

A project matches a single Kubernetes namespace where containers and services run. A workspace is a higher folder that holds multiple projects and DevOps pipelines for one team.

How do custom roles work when built-in roles are too broad?

Admins can create custom roles at the platform, workspace, or project level by picking individual permission items. You combine only the needed read or write rules and assign that custom role to users.

Do project roles stop users from reading sensitive data inside pods?

A viewer role can block a user from opening a pod shell or reading Kubernetes secret objects. Still, anyone granted pod execution rights can read files and variables inside that container during their session.

The query runs. The emails stay hidden.