implementing-rbac-hardening-for-kubernetes

Featured

Harden Kubernetes Role-Based Access Control by implementing least-privilege policies, auditing role bindings, eliminating cluster-admin sprawl, and integrating external identity providers.

AI & Automation 36,355 stars 4443 forks Updated 2 months ago Apache-2.0

Install

View on GitHub

Quality Score: 94/100

Stars 20%
100
Recency 20%
75
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Implementing RBAC Hardening for Kubernetes ## Overview Kubernetes RBAC regulates access to cluster resources based on roles assigned to users, groups, and service accounts. Default configurations often grant excessive permissions, and without active hardening, RBAC becomes a primary attack vector for privilege escalation, lateral movement, and data exfiltration. Hardening requires implementing least-privilege principles, eliminating unnecessary ClusterRole bindings, separating service accounts, integrating external identity providers, and continuous auditing. ## When to Use - When deploying or configuring implementing rbac hardening for kubernetes capabilities in your environment - When establishing security controls aligned to compliance requirements - When building or improving security architecture for this domain - When conducting security assessments that require this implementation ## Prerequisites - Kubernetes cluster v1.24+ with RBAC enabled (default since v1.6) - kubectl access with cluster-admin for initial audit - External identity provider (OIDC) for user authentication - Audit logging enabled on the API server ## Core Hardening Principles ### 1. Eliminate cluster-admin Sprawl Audit and remove unnecessary cluster-admin bindings: ```bash # List all cluster-admin bindings kubectl get clusterrolebindings -o json | jq -r ' .items[] | select(.roleRef.name == "cluster-admin") | "\(.metadata.name) -> \(.subjects[]? | "\(.kind)/\(.name) (\(.namespace //...

Details

Author
mukul975
Repository
mukul975/Anthropic-Cybersecurity-Skills
Created
8 months ago
Last Updated
2 months ago
Language
Python
License
Apache-2.0

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

auditing-kubernetes-cluster-rbac

Auditing Kubernetes cluster RBAC configurations to identify overly permissive roles, wildcard permissions, dangerous ClusterRoleBindings, service account abuse, and privilege escalation paths using kubectl, rbac-tool, KubiScan, and Kubeaudit.

36,355 Updated 2 months ago
mukul975
AI & Automation Listed

auditing-kubernetes-workload-and-rbac-hardening

Audit Kubernetes manifests for a subject granted more than it needs or a workload that can escape its container, after the binding graph and admission policy are resolved. Covers a RoleBinding or ClusterRoleBinding to cluster-admin or a wildcard-verb role, a pod running privileged or with host namespaces or a sensitive hostPath mount, a container running as root or able to escalate privilege, dangerous added capabilities, a service-account token mounted where the workload does not need the API, and a workload left flat with no network policy. Use when reviewing the Kubernetes YAML plane (roles, bindings, and workload security contexts as declared), not the cloud identity graph or the image build. The manifest is the source, a cluster-admin subject or an escaping workload is the sink, and a grant or a privilege the binding graph and admission actually allow is the bug.

27 Updated 2 months ago
UnboundCompute
DevOps & Infrastructure Listed

kubernetes-security

Harden a Kubernetes cluster's data plane and control plane. Covers Pod Security Standards (Restricted, Baseline, Privileged), RBAC with least privilege, NetworkPolicy default-deny, secrets management without raw env vars, admission controllers (Kyverno, OPA Gatekeeper), image scanning, and audit logging. Invoke when provisioning a new cluster, inheriting one, or before adding a new tenant to a shared cluster.

21 Updated 3 weeks ago
GoldenWing-360