Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Handle RBAC propagation when an already-granted permission is denied

Open
#334 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
azure, go

Research direction

Start with TestTerraformACIWithInitialPermissions and trace the authorization-failure parsing, permission deduplication, and role-update paths it exercises. Use the acceptance criteria to define done: handle case variants and mixed actions correctly, bound propagation retries without mutating roles, and add unit coverage for resume input, filtering, and timeouts.

Written by the indexing model from the issue text.

Description

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:

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.

Dominant language
Go
Stars
66
Forks
11
Avg merge
1d 14h
Merged PRs (30d)
6

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/mpf

All issues in Azure/mpf

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.