Commit 68b8866
committed
Use ACR-scoped token for registry authentication
The access token scope for Azure Container Registry was derived
from cloud.ResourceManager, which resolves to the ARM endpoint
(e.g. https://management.azure.com/.default\). This is an ARM-scoped
token, not an ACR-scoped one.
Microsoft recommends disabling ARM audience authentication on ACR
registries for enhanced security and least-privilege compliance.
When organizations follow this recommendation and disable
authentication-as-arm, Flux's ARM-scoped tokens are rejected,
causing unauthorized errors for workload identity users.
Use azcontainerregistry.ServiceName audience instead, which
resolves to https://containerregistry.azure.net/.default -- the
correct ACR scope as documented by Microsoft:
https://learn.microsoft.com/en-us/azure/container-registry/container-registry-disable-authentication-as-arm
Signed-off-by: Lukáš Kubín <[email protected]>1 parent b7ef8ab commit 68b8866
2 files changed
Lines changed: 15 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
0 commit comments