This chapter will detail how to:
- Grant/modify permissions (Roles) on given Resources to a User (Idp or Robot User).
- Remove all permissions on a Ressource from a User (Idp or Robot User).
- Root User: The activation of the Authentication and Authorization feature generates a Root User with unalterable and unrevokable
- Robot User: Robot users do not have any permission by default. They will need to be set by a
- The case of the Pipeline User: In Pachyderm, you do not explicitly grant users access to pipelines, they get set for you when you create or update a pipeline.
Rules to keep in mind
- A user or group can have one or more roles on a specific Resource.
- Roles are inherited: if a user has a role on a cluster, they have that role for all projects and repos in that cluster.
- The creator of a repo becomes its
- To update a pipeline, you must have at least
repoReader-level access to all pipeline inputs and
repoWriter-level access to the pipeline output. This is because pipelines read from their input repos and write to their output repos.
- When a user subscribes a pipeline to a repo, Pachyderm sets that user as an
repoOwner of that pipeline's output repo. If additional users need access to the output repository, the initial
repoOwner of a pipeline's output repo, or a
clusterAdmin, needs to grant that user access to the repo.
Set Roles to Users
To keep using our Auth0 example and illustrate the attribution of a given Role to a User, let's have our
Root User (with default clusterAdmin privileges) give
repoReader access to a repo to our
In particular, we will:
- Connect as our Root User again.
- Create a repo named
testinput containing one text file.
repoReader access on this repo to our user
email@example.com registered with our IdP (Auth0).
- See what happens when
firstname.lastname@example.org tries to write in the repo without the proper writing access.
First, let's connect as our Root User:
You will be asked to re-enter your Root token.
pachctl auth use-auth-token
Second, create a Repo as follow:
mkdir -p ./testinput
printf "this is a test" >./testinput/test.txt
pachctl create repo testinput
cd testinput && pachctl put file testinput@master -f test.txt
pachctl list repo will list your new repo and display your access level on that repo as a clusterAdmin.
repoReader access to our user
... and take a quick look at his access level:
pachctl auth set repo testinput repoReader user:email@example.com
The command returns the list of users granted access to this repo and their associated access level.
pachctl auth get repo testinput
Note that the user
firstname.lastname@example.org has a prefix
user. Pachyderm defines 4 prefixes depending on the type of user:
- pipeline (as mentioned above, this prefix will not be used in the context of granting privileges to users. However, it does exist. We are listing it here to give an exhauxtive list of all prefixes.)
Aditionnally, the "everyone" user
allClusterUsers has no specific prefix. See the example below to learn how to assign repoReader access to
allClusterUsers on a repo.
email@example.com try to add a file to
testinput without proper writing privileges:
The command returns an error message:
# Login as `firstname.lastname@example.org`
pachctl auth login
# Try to write into testinput repo
printf "this is another test" >./testinput/anothertest.txt
cd testinput && pachctl put file testinput@master -f anothertest.txt
user:email@example.com is not authorized to perform this operation - needs permissions [REPO_WRITE] on REPO testinput
--help to display the list of all available commands, arguments, and flags of the command
pachctl auth set.
To alter a user's privileges, simply re-run the
pachctl auth set command above with a different set of Roles. For example,
will give firstname.lastname@example.org
pachctl auth set repo testinput repoWriter user:email@example.com
repoWriter privileges when they were inially granted
You can remove all access level on a repo to a user by using the
none keyword. For example,
will remove any previous granted rights on the repo
pachctl auth set repo testinput none user:firstname.lastname@example.org
testinput to the user email@example.com.
repoReader access to
allClusterUsers on a repo:
pachctl auth set repo testinput repoReader allClusterUsers
Set Roles to Groups
If your IdP enables group support, you can grant access on Pachyderm ressources to a group of users.
Let's keep using our Auth0 example as an illustration, and:
- As a
clusterAdmin, create a Group in Auth0.
- Assign our user to the newly created group.
- Update our connector accordingly.
- Grant the group an owner access to a specific repo in Pachyderm.
To enable the Group creation in Auth0, you will need to install an
Authorization Extension to Auth0:
- Go to Auth0 Dashboard > Extensions.
- Select Auth0 Authorization and answer the prompt to install.
- Choose where you would like to store your data: Webtask Storage for this example and click Install
- Additionally, because Auth0 does not include the groups in the ID token when you use the Authorization Extension above, you will have to manually edit the following rule:
- In the Auth Pipeline menu on the left, in Rules, click on
auth0-authorization-extension. This will take you to the Edit Rule page of the extension.
- Copy the following
context.idToken['http://pachyderm.com/groups'] = user.groups; line 35 and Save your changes.
1- Group creation
An Authorization link should now show on your Auth0 webpage. In Authorization/Groups, create a group. Here
2- Add your user to your group
In Authorization/Users, select your user firstname.lastname@example.org and add them to your
testgroup as follow.
In User Mangement/Users, you user should now show the following addition to their app_metadata:
- 3- Update your connector
"scopes": ["groups", "email", "profile"],
Note the addition of the
claimMapping fields to your original connector configuration file. Update your connector:
Your group is all set to receive permissions to Pachyderm's ressources.
pachctl idp update-connector auth0 --version 2
4- Grant the group an admin access to a specific repo in Pachyderm.
A quick check at this repo should give you its updated list of users an their access level:
pachctl auth set repo testinput repoOwner group:testgroup
pachctl auth get repo testinput
The following command
pachctl auth get-groups lists the groups that have been defined on your cluster.
In this diagram, the
data-scientists group has been assigned the
repoReader role on the cluster. This gives them permissions to read all repos in all projects.
The IdP user
email@example.com has been assigned the
repoOwner role on the
nlp project. This gives them permission to read, write and grant permissions for repos within the nlp project. It does not give them any permission on the
image-recognition project, or on the
firstname.lastname@example.org was a member of the
data-scientists group, then they would cumulate both roles:
repoReader on all repo and
repoOwner on the
The IdP user
email@example.com has been assigned the
repoWriter role on the repo
categorize-text. This gives them permission to read and write in that repo, but not to access any other repo, project, or the cluster itself.
Last update: November 29, 2021