A single leaked kubeconfig once gave an attacker full control of a production cluster.
That is the danger when Kubernetes RBAC guardrails are missing or weak. Role-Based Access Control in Kubernetes is the final lock between a malicious request and the keys to your workloads. Without strict, well-defined guardrails, a CI/CD pipeline can become the easiest way in for an intruder—and the fastest way to lose everything.
RBAC in Kubernetes is precise by design. It defines what a user, service account, or pipeline process can do, down to the API verb and resource. But most clusters ship with wide roles—cluster-admin defaults, over-permissive bindings, and service accounts that can do more than necessary. Attackers know this. Automated scanners know this.
Securing a CI/CD pipeline starts at identity. Every pipeline runner, GitOps agent, and build step should use a dedicated Kubernetes service account. Bind it only to the namespace and resources it needs. Deny * access. Avoid granting secrets read unless required. Always separate service accounts for staging, testing, and production.