Handle RBAC propagation when an already-granted permission is denied
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- azure, go
- Área
- authorization, cloud, security
Línea de trabajo
Comienza con TestTerraformACIWithInitialPermissions y sigue los flujos de análisis de fallos de autorización, deduplicación de permisos y actualización de roles que ejercita. Usa los criterios de aceptación para definir cuándo se considera terminado: gestiona correctamente las variantes de mayúsculas y minúsculas y las acciones mixtas, limita los reintentos de propagación sin mutar los roles y añade cobertura de pruebas unitarias para la entrada de reanudación, el filtrado y los timeouts.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
MPF can receive an Azure AuthorizationFailed response for an action already present in the service principal's newly assigned custom role while Azure RBAC assignment or role-definition changes are still propagating.
MPF currently treats the response as a newly discovered permission, appends it to the result, updates the role, and increments the discovery iteration. Permission action strings are also compared and deduplicated case-sensitively, so variants such as:
Microsoft.Resources/subscriptions/resourcegroups/read
Microsoft.Resources/subscriptions/resourceGroups/read
can be returned as two permissions even though Azure RBAC action names are case-insensitive.
Evidence
TestTerraformACIWithInitialPermissions supplies all nine expected permissions initially but intermittently completes with one discovery iteration and ten raw permissions:
- 33682617228 — AzureRM 5.3.0
- 34059711895 — AzureRM 5.4.0
- 34404410581 — AzureRM 5.4.0
- 34529691278 — AzureRM 5.5.0
The initial custom role includes Microsoft.Resources/subscriptions/resourcegroups/read. After the five-second post-assignment wait, AzureRM can receive a 403 for Microsoft.Resources/subscriptions/resourceGroups/read. MPF records the differently cased action as new, updates the role, waits again, and succeeds.
Passing runs with the same provider versions demonstrate that the trigger is intermittent RBAC propagation rather than a new provider permission. The behavior predates Go 1.27.
Related to #231, which tracks eventual consistency after role detachment. This issue focuses on propagation after initial assignment and subsequent role updates.
Proposed behavior
- Treat Azure RBAC action names as case-insensitive across result deduplication, role membership checks, invalid-action filtering, and resume-from-file inputs.
- Define and preserve a stable canonical spelling in user-facing results.
- When parsing authorization failures, split actions into already-granted and genuinely missing sets using case-insensitive comparisons.
- Retry without role mutation or discovery-iteration increment only when all parsed actions are already granted at the relevant assignment scope.
- If any parsed action is genuinely missing, add only those actions and continue normal discovery.
- Account for wildcard actions,
NotActions, deny assignments, and assignment scope so persistent denials are not misclassified as propagation lag. - Use bounded backoff with a separate propagation-retry counter and return an explicit timeout error.
- Apply the behavior after initial role assignment and subsequent role-definition updates.
- Avoid mutating caller-provided permission slice backing arrays while building updated roles.
Acceptance criteria
- Casing variants of one Azure action appear once in MPF results and resume files.
- A temporary denial for an already-granted action does not mutate the role or increment the discovery count.
- Mixed authorization errors still add genuinely missing permissions.
- Scope, wildcard,
NotActions, and persistent-denial cases do not silently retry as propagation lag. - Retries are bounded, separately accounted for, and timeout failures are explicit.
- Unit tests cover casing variants, eventual success, mixed actions, resume input, invalid-action filtering, and timeout behavior.
- Existing genuine permission discovery remains unchanged.
A separate test-only PR will stabilize Terraform E2E assertions while this product behavior is designed and implemented. The E2E tolerance will remain visible in logs so this issue can track whether propagation lag continues occurring.
- Lenguaje dominante
- Go
- Estrellas
- 66
- Forks
- 11
- Merge medio
- 4 h 30 min
- PR fusionados (30 d)
- 6
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Azure/mpf
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
CreateUpdateCustomRole returns nil after exhausting its retry budget, reporting success when the role was never updatedPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
govulncheck: vulnerabilities detected on mainPosiblemente ocupada @maniSbindra la tomó hace 4 días. Abiertogovulncheck
Dificultad 3/5 Medio día Aptitud para principiantes 40/100
-
E2E Tests: Intermittent TestTerraformModuleTest failures due to stale RBAC permissions from previous testPosiblemente ocupada @maniSbindra la tomó hace 232 días. Abiertobug
-
Add optional flag which does not destroy the resources created including the custom role definitionQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertoenhancement terraform
Issues similares
-
area: watch bug priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
mariadb-operator/mariadb-operator#1962 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
eugenioenko/ttt#919 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
QuantumNous/new-api#7839 ·
Los mantenedores suelen responder en 1 día
-
bug needs-triage service/costoptimizationhub
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
hashicorp/terraform-provider-aws#50507 · 1 comentario ·
Los mantenedores suelen responder en 1 día