Support least-privilege RBAC for apiops publish — avoid requiring Resource Group Reader in preflight
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- azure, typescript
Hướng nghiên cứu
Start in src/clients/apim-client.ts at validatePreFlight() and trace the two sequential resource checks used by apiops publish. Confirm the chosen behavior preserves the APIM service existence check while allowing identities without resource-group read access; done means service-scoped publishing passes preflight without requiring Resource Group Reader.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem or use case
apiops publish fails preflight validation unless the executing identity has
Reader (or broader) at the Resource Group scope, even though publishing
itself only ever touches the target APIM service/workspace.
validatePreFlight() (src/clients/apim-client.ts) performs two sequential
existence checks before publishing:
GET {armEndpoint}/subscriptions/{sub}/resourceGroups/{rg}— requires
Microsoft.Resources/subscriptions/resourceGroups/read, granted only by
Reader(or higher) at resource group or subscription scope.GET {baseUrl}(the APIM service resource itself) — satisfied by
Reader/Service Readerat APIM service scope.
Step 1 fails with a 403 for any identity scoped only to the APIM service,
before step 2 (the actually-relevant check) even runs:
AuthorizationFailed: The client does not have authorization to perform action
'Microsoft.Resources/subscriptions/resourceGroups/read' over scope
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
Use case: organizations running a shared-APIM, multi-team model (one
resource group, several teams' service principals) currently must choose
between granting every team broad RG-scoped read access to every other
resource in the RG (other APIM instances, storage, App Insights, etc.), or
funneling all publishes through a single centrally-scoped identity — both
work against per-team least privilege. This also breaks parity with extract,
where workspace-scoped Reader + Service Reader (no RG scope) is already
sufficient.
Proposed solution
Scope the preflight check down to only what publish actually needs: read
access to the target APIM service. Step 2 above already GETs the APIM
service resource directly and will itself return 404 if the resource group
or instance doesn't exist, so the RG-level check in step 1 is purely
diagnostic (a slightly clearer "resource group not found" message) and isn't
load-bearing for correctness. Two options, in order of preference:
- Drop the RG-level check entirely and rely on the APIM-service GET
(step 2) for existence validation. Slightly less specific error message
on a missing RG vs. missing APIM instance, but removes the RGReader
requirement entirely. - Make the RG check non-fatal: if it returns 403 specifically, log a
warning and continue to step 2, only hard-failing on a genuine 404.
Preserves the diagnostic for identities that do have RG-level access,
without hard-blocking least-privilege ones.
Affected command
apiops publish
- Ngôn ngữ chính
- TypeScript
- Star
- 44
- Fork
- 14
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/apiops-cli
-
type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
Azure/apiops-cli#350 ·
-
stale
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
Azure/apiops-cli#333 · 1 bình luận ·
-
extract fails when a policy uses set-backend-service backend-id="{{namedValue}}"Có thể đã có người làm @dannyward630 đã nhận 37 ngày trước. Đang mởstale type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Azure/apiops-cli#331 · 1 bình luận ·
-
Docs example says products are auto-included transitively, but they aren't extracted with `products: []`Có thể đã có người làm @cdayne đã nhận 27 ngày trước. Đang mởstale type:question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/apiops-cli#277 · 1 bình luận ·
-
Extractor mistakes set-body json response as transitive dependency which causes pipeline failureĐang mởtype:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
Azure/apiops-cli#349 ·
Tất cả issue của Azure/apiops-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
tashfeenahmed/freellmapi#2217 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
remotion-dev/skills#37 ·
-
gui: a narrow window's gateway key row with a line under it wraps its faded badges onto blank linesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Slider: Escape during a thumb drag keeps and commits the dragged value, unlike ui-sdk's other dragsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
vercel-labs/ui#1758 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nicobailon/pi-subagents#3425 ·
Maintainer thường phản hồi trong vòng 1 ngày