TMAegis
Aturan lainnya untuk gke

TMA-GKE-4.1.9

Avoid binding RBAC roles to all authenticated users

TinggiLevel 1Otomatisgke

Deskripsi

Avoid non-default RoleBinding and ClusterRoleBinding objects that grant RBAC permissions to the system:authenticated group. This group represents all authenticated Kubernetes API requests from users signed in with a Google Account, including Gmail accounts, so it should not be used for custom access grants. Requires kubectl with cluster-wide read access (KUBECONFIG); system namespaces are excluded and listed resources must be remediated or documented as exceptions. The default system:basic-user, system:discovery and system:public-info-viewer bindings are ignored.

Cara pemeriksaan

Metode audit: Perintah shell

shell
out=$(kubectl get clusterrolebindings,rolebindings -A -o go-template='{{range .items}}{{$b:=.metadata.name}}{{range .subjects}}{{if eq .name "system:authenticated"}}{{$b}}{{"\n"}}{{end}}{{end}}{{end}}') || exit 1
bad=$(printf '%s\n' "$out" | grep -v '^$' | grep -Evx 'system:basic-user|system:discovery|system:public-info-viewer' | sort -u)
if [ -z "$bad" ]; then echo compliant; else printf '%s\n' "$bad" | head -n 25; fi
Output yang diharapkan
compliant

Cara perbaikan

Metode perbaikan: Panduan atau patch infrastruktur

Remove any non-default binding to system:authenticated identified in the audit and replace it with explicit, least privilege access for specific authenticated subjects. Do not remove the expected default ClusterRoleBindings system:basic-user, system:discovery, or system:public-info-viewer. RBAC permissions should be granted through defined users, groups, or service accounts rather than the broad system:authenticated group. • Review each non-default RoleBinding or ClusterRoleBinding returned by the audit and identify the referenced Role or ClusterRole • Determine the specific API groups, resources, verbs, and namespace scope required for the affected users, tools, or automation • Create or update a least privilege Role or ClusterRole that grants only the required access • Bind the replacement role to a specific user, Google Group, IAM service account, or Kubernetes service account • ...

Properti

Sistem operasi
Apa saja
Tag
gkepoliciesrbac
Referensi
CIS Google Kubernetes Engine (GKE) Benchmark v2.0.0 - 4.1.9 Avoid binding RBAC roles to all authenticated users

Periksa host ini

Jalankan ini pada mesin yang diizinkan untuk Anda audit. Pemindaian bersifat hanya baca.

shell
tmaegis scan --target gke