Skip to content
IROSG.
Articles

Kubernetes RBAC in practice: roles, cluster roles and least privilege

A source-backed practical IROSG IT guide.

Kubernetes RBAC in practice: roles, cluster roles and least privilege

Scope

This original IROSG guide covers طراحی least-privilege authorization با Kubernetes RBAC using the cited primary documentation.

Core model

Kubernetes RBAC مجوز را به verb، resource، namespace و subject وصل می‌کند. Role معمولاً namespace-scoped است و ClusterRole می‌تواند permission سراسری یا مجموعه‌ای قابل reuse از ruleها باشد. Binding مشخص می‌کند چه user، group یا ServiceAccount این permission را بگیرد.

Practical workflow

از permission موجود شروع نکنید؛ از action واقعی application شروع کنید. با kubectl auth can-i رفتار را از دید ServiceAccount تست کنید، ruleهای wildcard را حذف کنید و permissionهای write را از read جدا نگه دارید.

Failure modes

دادن cluster-admin برای رفع سریع خطا، استفادهٔ بی‌رویه از * و reuse کردن ServiceAccount مشترک attribution و blast radius را خراب می‌کند. RoleBinding اشتباه به group گسترده نیز می‌تواند دسترسی ناخواسته بسازد.

Lab

یک namespace آزمایشی بسازید، ServiceAccount بدون دسترسی ایجاد کنید و سپس فقط get/list روی ConfigMap را اضافه کنید. یک create یا secret read را به‌عنوان test منفی اجرا کنید و مطمئن شوید رد می‌شود.

Production method

Capture a baseline, change one variable at a time, test positive and negative paths, preserve evidence, and rehearse rollback before broad rollout.

TRACEABLE KNOWLEDGE

Sources & further reading

01
Kubernetes — مرجع رسمیhttps://kubernetes.io/docs/reference/access-authn-authz/rbac/

Editorial review date:

IROSG / EDITORIAL

News and pioneer profiles use original writing with source attribution. Image credits and licenses are kept in each page’s sources section instead of beneath the images. CVE reference data credits its primary sources.

Editorial and image policy ↗

Keep exploring.

Articles ↗
VyOS network operating systemArticles
Networking

VyOS network operating system

Original Persian technical editorial based on the official sources below. It covers the subject, architecture, practical use cases, important limitations and defensive considerations.

1 min readRead story
Routinator RPKI validatorArticles
Networking

Routinator RPKI validator

Original Persian technical editorial based on the official sources below. It covers the subject, architecture, practical use cases, important limitations and defensive considerations.

1 min readRead story
ISC Kea DHCP High AvailabilityArticles
Networking

ISC Kea DHCP High Availability

Original Persian technical editorial based on the official sources below. It covers the subject, architecture, practical use cases, important limitations and defensive considerations.

1 min readRead story