Support least-privilege RBAC for apiops publish — avoid requiring Resource Group Reader in preflight
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- azure, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 44
- Fork
- 14
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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
- Leggi la 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/apiops-cli
-
type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
Azure/apiops-cli#350 ·
-
stale
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
Azure/apiops-cli#333 · 1 commento ·
-
extract fails when a policy uses set-backend-service backend-id="{{namedValue}}"Forse già presa @dannyward630 l’ha presa 37 giorni fa. Apertastale type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Azure/apiops-cli#331 · 1 commento ·
-
Docs example says products are auto-included transitively, but they aren't extracted with `products: []`Forse già presa @cdayne l’ha presa 27 giorni fa. Apertastale type:question
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Azure/apiops-cli#277 · 1 commento ·
-
Extractor mistakes set-body json response as transitive dependency which causes pipeline failureApertatype:bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
Azure/apiops-cli#349 ·
Tutte le issue di Azure/apiops-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
tashfeenahmed/freellmapi#2217 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 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 linesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Slider: Escape during a thumb drag keeps and commits the dragged value, unlike ui-sdk's other dragsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vercel-labs/ui#1758 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nicobailon/pi-subagents#3425 ·
I maintainer di solito rispondono entro 1 giorno