Skip to content

Users and roles

guideconfiguration-users-and-roles

Choose who can sign in and who gets the administrator role.

For an installation made with an installer, see Install in cloud with installer.

Platforma has two roles: user, which every user who signs insign in — To show the Backend who you are, with a sign-in provider or a single-user token. The verb is "sign in"; the noun and the adjective are "sign-in". Glossary gets, and admin. An administrator can read and change the data of all users and act as any user, so give this role only to the people who must support the work of others. For what each role can do, see Roles.

When you set up the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary, you choose who can sign in and how users get the administrator roleadministrator role — The role in the Backend that can read and change the data of all users and run the pl-cli administrator commands. The operator sets rules that give it to users by login, group or attribute. Glossary. At each sign-in, the Backend applies these rules to the user: you do not manage the role of each user by hand.

Who can sign in

Who can sign in depends on the sign-in providersign-in provider — A configured way for users to sign in to the Backend: single sign-on (SSO), LDAP or a static list of users. One Backend can have more than one. Glossary:

  • Static list of usersstatic list of users — A sign-in provider that is a file with the logins and the password hashes of the users, in the htpasswd format. The Backend reads it again when it changes. Glossary: each login in the file. To add a user, add a line to the file.
  • LDAPLDAP — The directory of users of a company. The Backend can check logins and passwords in it. Glossary and SSOsingle sign-on — Sign-in through the identity service of the company, with the same account as for other company systems. Glossary: a person whom the directory or the identity provider accepts, and who has an account in the Backend. By default, the Backend does not create accounts for these providers: set createUsers: true, or make the accounts in advance with a CSV file of users. See New users at the first sign-in.

With createUsers: true, the directory or the identity provider decides who can sign in. Limit the access there: assign the application to the users of Platforma at the identity provider, or use a filter of search mode in LDAP.

Give the administrator role

Each provider has its own rules for the administrator role. You can use one or more of them:

A user who matches any rule gets the role. When several rules match, the highest role wins; a rule cannot take a role away.

MiLaboratories recommends that you keep at least one administrator on a static list of users: it does not depend on the directory or the identity provider. The pl-cli administrator commands work with the stored session of a user with the administrator role, from any sign-in provider, SSO included.

By login

adminUsers is a list of regular expressions. Each one must match the whole login. In a regular expression, a dot matches any character, so escape a dot in a login: alice\.smith.

terraform.tfvars
# in the provider entry; "\\." in HCL is "\." in the expression
admin_users = ["alice\\.smith", "bob"]
values.yaml
# in the provider entry
adminUsers: ['alice\.smith', bob]

By group

roles.groups gives a role to the members of a group, by its exact name: admin=<group>. roles.groupRegexps takes a regular expression in place of the name: admin=<regex>. The Backend gets the groups from the provider:

  • LDAP: from memberOf of the user, and with groupBaseDN also from a search for groups. Write a group as its name (cn) or its full DN.
  • SSO: from the claim that map.groups names, for example groups. The identity provider must put the groups into the token. See What to register at the identity provider.
  • Google Workspace: turn on google.groupFetch (see SSO), and write each group as its email address. Only roles.groups works with Google, not roles.groupRegexps.
LDAP group platforma-admins
terraform.tfvars
# in the provider entry
roles = { groups = ["admin=platforma-admins"] }
values.yaml
# in the provider entry
roles:
groups: [admin=platforma-admins]

By another attribute

roles.attrRegexps gives a role when a field of the user matches a regular expression in full: admin=<field>=<regex>, for example admin=email=.*@it\.example\.com. The field must come from the provider (see map in How the Backend finds the account of a user). In Single Server modeSingle Server mode — The mode in which the Backend and all its jobs run on one Linux machine, the server, with no Kubernetes cluster. Glossary, the option is --auth.role.attr-regex=<provider-id>=admin=<field>=<regex>.

When a change of role applies

The Backend gives the role at sign-in. A change of the role of a user, by a new rule or by a change of the groups at the identity provider or in the directory, applies at the next sign-in of the user. A change of the rules also restarts the Backend (see Change the sign-in settings). The user keeps the projects and the data: only the rights change.

Remove a user

To remove a user, take the user away where the logins come from: delete the line from the static list, or remove the user in the directory or at the identity provider. The user then cannot sign in again. The Backend refuses to renew the session of the user when it can check the user without the password: with a static list of users, LDAP in search mode and SSO. The Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary then continues to work with its current session for at most 7 days. With LDAP in direct bind, the Backend does not check the user at renewal. For each sign-in provider, see Sign-in.

To end the session of the user at once, change the master secret: see Change the master secret. This signs out all users, not only the removed user.

The account and its projects stay in the Backend. To delete the account, an administrator runs pl-cli admin delete-user, and chooses what happens to the projects:

  • --move-projects-to <login> moves them to another account;
  • --delete-projects deletes them with the account.

You cannot undo the deletion. For the full command, see Move projects.

With createUsers: true, a deleted user who can still sign in at the identity provider or in the directory gets a new, empty account.

Change the master secret

A new master secret ends the sessions of all users at once: use it when a removed user must lose access before the current session ends. All users sign in again. Projects and data stay; for the full effect, see The secrets of Platforma. The Backend reads the master secret only at start, so each path ends with a restart of the Backend. For what the restart does, see Restart of the Backend.

Keep a copy of the new value in the secret store of your company: a backup is restored with the master secret that was in use.

Tool: CloudFormation template

  1. Put a new value into the parameter of the master secret in Parameter Store. Use the ClusterName and the Region of the stack:

    Terminal window
    aws ssm put-parameter --name "/<ClusterName>/platforma/master-secret" \
    --type SecureString --overwrite --region <Region> \
    --value "$(openssl rand -base64 32 | tr -d '\n')"
  2. Update the stack with the current template and set SecretsRevision to a larger number. The deployer then writes the new value into the Secret platforma-master-secret. See Change settings.

  3. Restart the Backend. Use the namespace from PlatformaNamespace (default platforma):

    Terminal window
    aws eks update-kubeconfig --name <ClusterName> --region <Region>
    kubectl rollout restart --namespace platforma deployment/platforma

To check the result, look in the log of the Backend for the message Master secret was rotated: all sessions and signatures are invalidated. The Desktop App of each user then asks the user to sign in again.

Who sees the list of users

To share a project, a user chooses a colleague from the list of users. By default, every user sees this list. On an installation that several groups or companies share, the list shows the logins of all of them, so you can limit it:

  • All users (users, the default).
  • Administrators only (admins). Users cannot choose a colleague from the list, but they can still share a project: they type the login of the colleague exactly, letter for letter. Only the list of users is not shown.
  • Nobody (nobody).

Set the Helm value auth.showUserListTo, or the module input backend_service.auth.show_user_list_to: users (default), admins or nobody. The chart gives the value to the Backend, so do not add the option --show-user-list-to to the extra options or its variable to the environment: the chart refuses them.

terraform.tfvars
backend_service = {
auth = {
show_user_list_to = "admins"
}
}
values.yaml
auth:
showUserListTo: admins

To see the list yourself, run pl-cli admin user-list with an administrator login. It works with users and admins, not with nobody.

Roles and data libraries

The roles do not control the data librariesdata library — A folder or bucket with input data of the company. Users select files from it in the Desktop App. Platforma only reads it. Glossary, and there is no setting of a library for each user or role. Every user who signs in can read every data library that the Backend reads with its own identity, with access keys or from a folder. Only federated access and the Google account mode give each user the rights of their own identity. To keep a library for some users only, use one of these two modes, or a separate installation. See Access modes and Data libraries.

Next