fix: acotar permisos RBAC de weblate (wildcard → reglas específicas)#64
Open
dib-adhoc wants to merge 1 commit into
Open
fix: acotar permisos RBAC de weblate (wildcard → reglas específicas)#64dib-adhoc wants to merge 1 commit into
dib-adhoc wants to merge 1 commit into
Conversation
… específicas El Role admin-role tenía apiGroups/resources/verbs: ["*"] otorgando control total del namespace a cualquier usuario bindeado. Reemplazado por reglas explícitas que cubren las operaciones reales necesarias: StatefulSet, pods/logs/exec, events, services, CNPG CRDs, secrets y PVCs.
Contributor
There was a problem hiding this comment.
Pull request overview
Este PR reduce el alcance del RBAC del chart de Weblate reemplazando el Role con wildcards (* en apiGroups/resources/verbs) por un conjunto de reglas explícitas, manteniendo el RoleBinding como opt-in vía k8sAdmin.users.
Changes:
- Sustituye permisos RBAC tipo wildcard por reglas específicas para StatefulSets, Pods (logs/exec), Services, Events, recursos de CNPG, Secrets y PVCs.
- Actualiza el comentario de cabecera para documentar el propósito del Role y que el binding es opt-in.
Comment on lines
+12
to
+14
| - apiGroups: [""] | ||
| resources: ["pods", "pods/log", "pods/exec"] | ||
| verbs: ["get", "list", "create"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema
charts/weblate/templates/rbac.yamldefiníaadmin-roleconapiGroups/resources/verbs: ["*"]— control total del namespace para cualquier usuario enk8sAdmin.users.El binding es opt-in (vacío por defecto), pero con el wildcard cualquier usuario bindeado podía leer todos los Secrets, crear pods arbitrarios y modificar el CNPG Cluster.
Cambio
Reemplazado el wildcard por reglas explícitas que cubren las operaciones reales del administrador de Weblate:
apps/statefulsetspods,pods/log,pods/execevents,servicespostgresql.cnpg.io/clusters,backups,scheduledbackupssecretspersistentvolumeclaimsVerificación
Notas para el reviewer
secrets: get/listes necesario para gestión de SSH keys y credenciales — si se considera excesivo, puede eliminarse y agregarse on-demand.k8sAdmin.users: []por defecto) — no cambia comportamiento en instalaciones existentes sin usuarios configurados.