Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Handle RBAC propagation when an already-granted permission is denied

未关闭
#334 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
azure, go

调研方向

从 TestTerraformACIWithInitialPermissions 开始,跟踪它所执行的授权失败解析、权限去重和角色更新路径。使用验收标准定义完成条件:正确处理大小写变体和混合操作,在不改变角色的情况下限制传播重试次数,并为恢复输入、过滤和超时添加单元测试覆盖。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Go
星标
66
派生
11
平均合并
2 天 9 小时
30 天内合并 PR
5

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/mpf 的其他 Issue

查看 Azure/mpf 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。