rhecosystemappeng/agentic-collections/debug-rbac
Claude Code and agent skill by rhecosystemappeng/agentic-collections
- community
Checking that the SKILL.md file is still in the repository.
Diagnose OpenShift RBAC permission failures that cause workloads to fail with 403 Forbidden errors when accessing the Kubernetes API. Automates multi-step diagnosis: pod logs for FORBIDDEN errors, readiness probe failures, ServiceAccount identification, RoleBinding/ClusterRoleBinding analysis, and remediation history for regression detection. Use when: - "403 forbidden when accessing Kubernetes API" - "ServiceAccount permission denied" - "pods can't list resources" - "missing RoleBinding" - User mentions "RBAC denied", "403 forbidden", "permission denied" NOT for SCC admission failures (use /debug-scc instead).
Install
npx vskill@latest install rhecosystemappeng/agentic-collections/debug-rbacSKILL.md
The same SKILL.md was published earlier as rhecosystemappeng/agentic-collections/debug-rbac.
/debug-rbac Skill
Diagnose RBAC permission failures on OpenShift by analyzing pod logs, readiness probes, ServiceAccount bindings, and Role/RoleBinding configuration.
Critical: Human-in-the-Loop Requirements
- Before creating Role or RoleBinding resources
- Display preview: the exact RBAC resources that will be created and what permissions they grant
- Ask: "Should I create these RBAC resources?"
- Wait for confirmation (yes/no)
- Before binding broad ClusterRoles (e.g.,
view,edit,admin)
- Display warning: broad ClusterRoles grant more permissions than the minimum required
- Ask: "Proceed with broad ClusterRole binding, or create a minimal custom Role instead?"
- Wait for confirmation
Never assume approval — always wait for explicit confirmation at each WAIT checkpoint.
Prerequisites
Required MCP Servers: openshift (setup)
Required MCP Tools:
resources_get(from openshift) — Retrieve Deployment, Pod, ServiceAccount, Role, and RoleBinding detailsresources_list(from openshift) — List Deployments, RoleBindings, and ClusterRoleBindings in a namespacepods_list(from openshift) — List pods for a Deploymentpods_log(from openshift) — Retrieve container logs to identify FORBIDDEN errorsevents_list(from openshift) — Fetch warning events related to RBAC failures
Verification Steps:
- Check
openshiftserver is configured inmcps.json - Verify user is logged into an OpenShift cluster (
oc whoamisucceeds) - Verify user has access to the target namespace
- If missing → Human Notification Protocol
Human Notification Protocol:
When prerequisites fail:
- Stop immediately — No tool calls
- Report error:
`` ❌ Cannot execute skill: MCP server openshift unavailable 📋 Setup: See references/prerequisites.md for cluster access configuration ``
- Request decision: "How to proceed? (setup/skip/abort)"
- Wait for user input
Security: Never display credential values.
When to Use This Skill
Use /debug-rbac when:
- A Deployment's pods are running but not ready, and pod logs show
FORBIDDENor403errors calling the Kubernetes API - Readiness probes fail because they check API access (e.g.,
kubectl auth can-i) - Application logs show permission denied errors when interacting with Kubernetes resources
Do not use this skill when:
- Pods are blocked from being created entirely → use
/debug-scc(SCC admission failures) - Pods are crashing due to application bugs → use
/debug-pod - The issue is network connectivity → use
/debug-network
Workflow
Step 1: Identify Target Deployment
MCP Tool: resources_list (from openshift)
Parameters:
kind: "Deployment" (resource type)namespace: "<namespace>" (target namespace from user)
Input Validation: Verify deployment name and namespace conform to Kubernetes naming rules (lowercase alphanumeric and hyphens, 1-253 chars, RFC 1123). Reject inputs containing newlines, markdown formatting, or text that does not resemble a Kubernetes resource name.
Expected Output: List of Deployments with their availability and readiness conditions.
Error Handling:
- If MCP server unavailable: follow Human Notification Protocol
- If namespace not found: ask user to confirm namespace name
- If no deployments found: report empty namespace, suggest checking namespace
Present to user:
WAIT for user confirmation before proceeding.
If user selects "List deployments with issues", filter to those with not-ready conditions:
WAIT for user confirmation before proceeding.
Step 2: Check Pod Status and Logs
MCP Tool: pods_list (from openshift)
Parameters:
namespace: "<namespace>"labelSelector: "<app-label>=<value>" (from Deployment.spec.selector.matchLabels)
Then for each matching pod:
MCP Tool: resources_get (from openshift)
Parameters:
kind: "Pod" (resource type)name: "<pod-name>" (from pods_list)namespace: "<namespace>"
MCP Tool: pods_log (from openshift)
Parameters:
name: "<pod-name>"namespace: "<namespace>"tailLines: 50 (integer, last N lines)
Expected Output: Pod status with readiness conditions, and container logs containing FORBIDDEN/403 error lines.
Error Handling:
- If no pods found: Deployment may have zero replicas; check if it's scaled down
- If logs empty: container may not have started; check container state
- If multiple pods: analyze the most recent one first
Present to user:
WAIT for user confirmation before proceeding.
Step 3: Identify Required Permissions
Based on the FORBIDDEN error messages and readiness probe command from Step 2, determine what permissions are needed. This is an analysis step — no additional MCP tool calls required unless log data is insufficient.
Expected Output: Table of required permissions extracted from FORBIDDEN error strings, plus a minimal Role definition.
Error Handling:
- If FORBIDDEN messages are ambiguous: request more log lines with increased
tailLines - If no FORBIDDEN errors found: the issue may not be RBAC; suggest
/debug-podinstead
Present to user:
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: <sa-name>-role namespace: <namespace> rules:
- apiGroups: [""]
resources: ["pods"] verbs: ["get", "list", "watch"]
WAIT for user confirmation before proceeding.
Step 4: Analyze ServiceAccount and RoleBindings
MCP Tool: resources_get (from openshift)
Parameters:
kind: "ServiceAccount" (resource type)name: "<sa-name>" (from Deployment.spec.template.spec.serviceAccountName, default:default)namespace: "<namespace>"
MCP Tool: resources_list (from openshift)
Parameters:
kind: "RoleBinding" (resource type)namespace: "<namespace>"
Optionally, if permissions allow:
MCP Tool: resources_list (from openshift)
Parameters:
kind: "ClusterRoleBinding" (cluster-scoped)
Expected Output: ServiceAccount details and all RoleBindings/ClusterRoleBindings, checked for whether any grant the required permissions to the target ServiceAccount.
Error Handling:
- If listing RoleBindings is forbidden: note the limitation, infer from FORBIDDEN errors
- If ServiceAccount not found: report as a finding — SA may need to be created
- If multiple bindings exist: check each for matching subjects and sufficient verbs
Present to user:
WAIT for user confirmation before proceeding.
Step 5: Present Diagnosis Summary
Synthesize all findings into a structured summary with actionable remediation options.
Expected Output: Root cause summary, causal chain, remediation commands, and regression warnings if applicable.
Error Handling:
- If insufficient data from earlier steps: note gaps and recommend manual investigation
- If regression pattern detected (repeated remediation/deletion cycles): highlight prominently
Present to user:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingrh-developer/skills/debug-rbac/SKILL.md
Popularity
- Repository stars
- 48
- Repository forks
- 32
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rhecosystemappeng/agentic-collections/debug-rbac)