Wildcards in repository names
When defining the repositories in the scope-map, can you use wildcards? So if you have a convention that each repository is named <team_name>/<project_name>, you could use <team_name>/* to provide a team with access to all of their repositories without listing each one individually and also automatically provide access to any future repositories created by this team?
Dokumentdetails
⚠ Bearbeiten Sie diesen Abschnitt nicht. Er ist für die Verknüpfung von docs.microsoft.com zum GitHub-Artikel erforderlich.
- ID: ef39d073-f33a-44c5-9cd1-4f30ea881230
- Version Independent ID: a28f7fa6-d25a-c205-14e7-aa8d474a87c9
- Content: az acr scope-map
- Content Source: src/azure-cli/azure/cli/command_modules/acr/_help.py
- Service: container-registry
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @stevelasker, @sajayanthony
Thanks for the suggestions. Repository based permission control is still under preview, and we will take this feedback into consideration and update here when we roll out any improvements.
I am also looking for a help on "Wildcards in repository names ", any update on this?
Hi folks. We’re looking into various options. Can you provide more details on what the result is you’re looking to accomplish?
I created a scope map with a wildcard so that many repositories can make use of it. And with this scope map generated a token and logged in to the registry. But I couldn't perform any operation like a pull or push.
e.g repositories:
test/myrepo test/myrepo1 test/myrepo2 test/myrepo3
Scope-map I have created:
az acr scope-map create --name MyScopeMap --registry MyRegistry --repository test/* content/read content/write --description "test scope map"
Result: { "actions": [ "repositories/test/*/content/read", "repositories/test/*/content/write" ], "creationDate": "2020-04-20T11:27:49.643716+00:00", "description": "test scope map", "id": "/subscriptions/----/resourceGroups/mytest-rg/providers/Microsoft.C ontainerRegistry/registries/MyRegistry/scopeMaps/MyScopeMap", "name": "MyScopeMap", "provisioningState": "Succeeded", "resourceGroup": "mytest-rg", "scopeMapType": "UserDefined", "type": "Microsoft.ContainerRegistry/registries/MyScopeMap" }
Scope map has created successfully and even token too. But when I logged in with that token and try to pull/push I ended up with below message:
pull - docker pull myregistry.azurecr.io/test/myrepo:v1
message:
"Error response from daemon: repository myregistry.azurecr.io/test/myrepo not found: does not exist or no pull access"
push - docker push myregistry.azurecr.io/test/myrepo:v2
message:
The push refers to a repository [myregistry.azurecr.io/test/myrepo] a65c16532822: Preparing 75b1b9938a41: Preparing 94a7e5001357: Preparing fea4f503ccf8: Preparing 3172a1c8308a: Preparing 264a7fdea008: Waiting 3b10514a95be: Waiting denied: requested access to the resource is denied
@shwetazambre, thanks for the details. We don’t support wildcards like this. Based on feedback like this, we’re re-evaluating the approach and are seeking feedback. Can you explain what you’re trying to accomplish? Are you looking to have management delegation to team leads for a set of repos? Or, can a single set of people manage permissions for all teams? In other words, do you need permissions isolation between teams? TeamA can manage their set of repos, while teamB manages their repositories? The owners of TeamA can’t manage TeamBs repos
@shwetazambre, thanks for the details. We don’t support wildcards like this. Based on feedback like this, we’re re-evaluating the approach and are seeking feedback. Can you explain what you’re trying to accomplish? Are you looking to have management delegation to team leads for a set of repos? Or, can a single set of people manage permissions for all teams? In other words, do you need permissions isolation between teams? TeamA can manage their set of repos, while teamB manages their repositories? The owners of TeamA can’t manage TeamBs repos
That is the approach we were looking for as well. We need to be able to assign repo based permissions and would prefer not to have to define it for every single repo since we work with prefixes for teams.
We’re considering two approaches. The wildcard approach, which could give different groups different access. The second approach is about delegating management to teams. Imagine an Org like management approach similar to github or docker hub. The later is a lot more complicated to split permissions and logs. But, we’d rather understand that now, before we implement wildcards that won’t scale. Which approach do you need?
As far as I know, we are looking for an approach similar to the first one. Here I consider the group as a project/team. If we assign read-only permission for project1/team1 then all repositories under that project/team will have the same permission. Different projects will have different permissions and all repositories, sub-repositories will work according to that permissions.
We like the concept of namespaces, as that is described in a section in the "best practices". I'd like to enable teams full access to one or several "namespaces". I guess that could work with tokens & wildcard scope maps, but I can imagine this not scaling well. So we'd prefer a "full fledged" solution to be able to control access to namespaces for groups - ideally without tokens - distributing these will definitely not scale.
We're looking for this feature too and would upgrade to the Premium SKU if it was available. Our needs are fairly simple right now, so the first approach would be sufficient for us, but I could see some benefit to the second approach as well.
+1 on this request. Given that a docker push can dynamically create new repositories, creating a read or write token that has access to company/* would be super helpful.
I should add that the only reason I need to define custom scope-maps is because the built in scope maps don't include metadata read/write. That is:
_repositories_pushdoesn't includemetadata/readormetadata/write_repositories_pulldoesn't includemetadata/read
Which breaks docker buildx as used in Docker's official docker/build-push-action@v2 github action.
It would also seem there are a few more votes for this at https://feedback.azure.com/forums/903958-azure-container-registry/suggestions/40878493-give-the-repositories-pull-repositories-push-m
+1 on this request. Not being able to use wildcards or use directories to scope permissions makes this nigh unusable.
+1
+1 something like reponame/* or "shortcut" reponame/
+1 This would be very useful when planning deployment scenarios where product names are namespaces and access needs to given in multiple setups.
@SteveLasker any further news in this area? I want everyone in my company share a single ACR, but only allow individual teams push permissions to their own "namespace".
companyacr.azurecr.io/customerteam/* companyacr.azurecr.io/productteam/*
This is the plan, to align AAD objects, Tokens and namespace hierarchy of access. We have been discussing the root namespace for a team can have slashes to account for these types of paths
companyacr.azurecr.io/baseartifacts/ companyacr.azurecr.io/org1/teama/ companyacr.azurecr.io/org2/teama/ companyacr.azurecr.io/prod/ companyacr.azurecr.io/archive
It won’t actually be star wildcards, rather repo path based.
Will that work? @mangalorereshmi for details.
@SteveLasker not sure what you mean by "teams" in this context? We have multiple teams working with group of products (sometimes same people work also on different products) so our scheme would be
companyacr.azurecr.io/product-a/service-a companyacr.azurecr.io/product-a/service-b companyacr.azurecr.io/product-b/service-c companyacr.azurecr.io/product-b/service-d
We'd like to create push Scope maps to match e.g. companyacr.azurecr.io/product-a/* to be able to push to all repositories under a single product and pull Scope maps with read access to product-a/* and product-b/* so we can combine containers from multiple products.
Not sure how this team model would work in this case?
Perhaps the * wildcard could work in tandem with the team feature? We're basically just looking to avoid typing and managing all of the repositories manually.
@galigula2, Reshmi is off this week, so let me try and explain a bit.
Reshmi has designed a repo-group option, which is essentially a github or docker hub org. The big difference is we can provide /'s within the org name, or the repo name so you get more flexibility.
Using your example above, you could create companyacr.azurecr.io/product-a/ and all repos below it would be managed by the admin of product-a.
What this can also look like is:
companyacr.azurecr.io/baseartifacts/- is the root of this "repo-group" Below, you may have several repos, with additional nesting to give groups (teams) a hierarchy to work with:companyacr.azurecr.io/baseartifacts/publicimages/node- notice the node image is in the root of publicimagescompanyacr.azurecr.io/baseartifacts/publicimages/dotnet/sdk- in the donnet case, there are several images within dotnet, so you can use additional/'s in the namecompanyacr.azurecr.io/baseartifacts/publicimages/dotnet/runtimecompanyacr.azurecr.io/baseartifacts/publicimages/dotnet/aspnetcompanyacr.azurecr.io/baseartifacts/publicimages/java/sdkcompanyacr.azurecr.io/baseartifacts/publicimages/java/runtime
The root of the repo-group may also have /'s in the names, so you can structure your repo-groups alongside your company lines.
companyacr.azurecr.io/org1/team-a/- team-a within org 1 has it's own admin to assign permissions to identitiescompanyacr.azurecr.io/org1/team-a/service-acompanyacr.azurecr.io/org1/team-a/service-bcompanyacr.azurecr.io/org1/team-a/service-ccompanyacr.azurecr.io/org1/team-a/build-components/thing1companyacr.azurecr.io/org1/team-a/build-components/thing2Team-b is in another org of the company, so you can group teams while still having the appearance of hierarchy
companyacr.azurecr.io/org2/team-b/companyacr.azurecr.io/org2/team-b/service-fcompanyacr.azurecr.io/org2/team-b/service-gMaybe another root repo, where you keep all production deployments, and no developers have access. An operational person assigns permissions for service identities to pull repos from below this location:
companyacr.azurecr.io/prod/-companyacr.azurecr.io/prod/service-acompanyacr.azurecr.io/prod/service-bcompanyacr.azurecr.io/prod/service-cAnd another root repo managed by a team that accounts for all archived content
companyacr.azurecr.io/archivecompanyacr.azurecr.io/archive/service-acompanyacr.azurecr.io/archive/service-bcompanyacr.azurecr.io/archive/service-c