Handle RBAC propagation when an already-granted permission is denied
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- azure, go
- Ambito
- authorization, cloud, security
Direzione di ricerca
Inizia con TestTerraformACIWithInitialPermissions e traccia i percorsi di analisi dei fallimenti di autorizzazione, deduplicazione delle autorizzazioni e aggiornamento dei ruoli che esercita. Usa i criteri di accettazione per definire quando il lavoro è completato: gestisci correttamente le varianti di maiuscole/minuscole e le azioni miste, limita i tentativi di propagazione senza mutare i ruoli e aggiungi la copertura dei test unitari per l'input di ripresa, il filtraggio e i timeout.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 66
- Fork
- 11
- Merge medio
- 1g 14h
- PR unite (30g)
- 6
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/mpf
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
CreateUpdateCustomRole returns nil after exhausting its retry budget, reporting success when the role was never updatedForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug
-
Add optional flag which does not destroy the resources created including the custom role definitionApertaenhancement terraform
-
For Terraform azurerm provider resources which use LRO polling add RESOURCE_TYPE/operationStatuses/read permissionsForse già presa @bgdnext64 l’ha presa 69 giorni fa. Apertaenhancement terraform
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
prime-radiant-inc/evener#3726 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
`scan <Dockerfile>` fails with "unsupported target type" (scan router has no Dockerfile case)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
temporalio/deputy#400 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Async engine endpoint-label relationship counts include pending relationships of every typeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
status/0-needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno