How to Configure JetBrains AI Kubernetes Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up jetbrains ai kubernetes read only access by binding a Role to a user account. This Role grants read verbs on cluster resources without allowing write actions. Many teams start by linking their editor tools to an existing admin profile. That shortcut lets an assistant change live workloads or read secret values by mistake. Broad roles turn a helpful coding aid into a risk for production systems. How to set up jetbrains ai kubernetes read only access Kubernetes role-based access cont

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.

You set up jetbrains ai kubernetes read only access by binding a Role to a user account. This Role grants read verbs on cluster resources without allowing write actions. Many teams start by linking their editor tools to an existing admin profile. That shortcut lets an assistant change live workloads or read secret values by mistake. Broad roles turn a helpful coding aid into a risk for production systems.

How to set up jetbrains ai kubernetes read only access

Kubernetes role-based access control uses rules that are purely additive. There are no deny rules in this system. You start with zero permissions and add specific read verbs like get, list, and watch. You define these rules inside a Role for one namespace. If the assistant needs to inspect the whole cluster, you use a ClusterRole instead.

A ClusterRole can cover cluster-scoped items like nodes or resources across all namespaces. Next, you link that role to the identity your editor uses. A RoleBinding grants those permissions inside a single namespace. A ClusterRoleBinding grants the permissions across the entire cluster. A RoleBinding can also reference a ClusterRole to keep rules inside one namespace.

You must also account for subresources when you build your read role. Kubernetes RBAC refers to resources by the exact name in the API URL. Subresources like pod logs use a slash between the resource and the subresource. To let your assistant debug a crashing app, you grant read rules on pods and pod logs. You should leave out the secret resource so the role does not expose keys.

What native RBAC solves and what it leaves open

Native RBAC stops the editor and its AI assistant from deleting pods or editing deployments. It sets a clear boundary around which API endpoints the user identity can call. If the assistant suggests a command that mutates state, the API server blocks it. This setup protects your cluster structure from accidental changes during a coding session.

Still, static RBAC only checks who logs in and which API group they call. It does not inspect the content flowing back from allowed read requests. Pod logs and config maps often hold sensitive customer data in plain text. When the assistant reads those logs, emails, phone numbers, and card numbers enter the prompt context. Native roles cannot rewrite matched fields in results before they reach the editor.

Auditor Read-Only Access + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static credentials on a developer laptop also stay active until someone rotates them. If a local kubeconfig file leaks, an attacker gets the same read view across your namespaces. RBAC also lacks a way to require peer approval for a single sensitive read command. Teams need a way to inspect commands in flight and mask sensitive output fields.

Managing subresources and local credentials safely

Careful teams split their roles by task rather than sharing one broad view role. You can create a base role that only views workload status and events. When a developer needs to read pod logs, they use a separate role for that namespace. You should also avoid granting create rules on the pod exec subresource. Exec permissions let a user run arbitrary shell commands inside a running container.

Even a read-only shell session can expose local files or memory inside the pod. Keep the kubeconfig used by your editor scoped to the smallest possible namespace. Review your bindings often to remove old accounts that no longer need cluster views.

Govern kubectl and API calls in flight

Identity providers and Kubernetes RBAC decide who logs into a cluster. They cannot redact keys inside returned JSON objects or hold a risky delete call for review. By design, hoop.dev runs as an open-source proxy, a sidecar for your Kubernetes API, checking requests and responses without replacing RBAC.

First, hoop.dev guardrails refuse banned methods, paths, or headers before they run. Next, hoop.dev data masking rewrites sensitive keys in returned Secret, ConfigMap, and log responses in memory, and writes each decision to the audit trail. Explore the repo on GitHub.

Frequently asked questions

Can Kubernetes RBAC block specific secrets while allowing others in a namespace?

Kubernetes RBAC rules are purely additive and do not support deny rules. You can list specific resource names to allow, which gets hard to maintain at scale.

How do I let JetBrains AI read pod logs without granting shell access?

Grant get and list verbs on the pods log subresource in your Role. Do not include the pods exec subresource in the rule list.

Does a read-only ClusterRole protect sensitive data inside pod logs?

No, a ClusterRole only controls access to the log API endpoint itself. Masking rewrites matched fields like emails or national IDs in results before the client reads them.

The query runs. The emails stay hidden.