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:
- By login: a list of logins.
- By group: the groups of the directory or the identity provider.
- By another attribute: for example, the email address.
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.
# in the provider entry; "\\." in HCL is "\." in the expressionadmin_users = ["alice\\.smith", "bob"]# in the provider entryadminUsers: ['alice\.smith', bob]--auth.admin-user='local=alice\.smith' \--auth.admin-user=local=bobBy 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
memberOfof the user, and withgroupBaseDNalso from a search for groups. Write a group as its name (cn) or its full DN. - SSO: from the claim that
map.groupsnames, for examplegroups. 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. Onlyroles.groupsworks with Google, notroles.groupRegexps.
# in the provider entryroles = { groups = ["admin=platforma-admins"] }# in the provider entryroles: groups: [admin=platforma-admins]--auth.role.group=corp=admin=platforma-adminsBy 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-projectsdeletes 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
-
Put a new value into the parameter of the master secret in Parameter Store. Use the
ClusterNameand theRegionof 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')" -
Update the stack with the current template and set
SecretsRevisionto a larger number. The deployer then writes the new value into the Secretplatforma-master-secret. See Change settings. -
Restart the Backend. Use the namespace from
PlatformaNamespace(defaultplatforma):Terminal window aws eks update-kubeconfig --name <ClusterName> --region <Region>kubectl rollout restart --namespace platforma deployment/platforma
Tool: install.sh in Cloud Shell
-
In Cloud Shell, go to the folder of the installer of the installation, and load the saved answers:
source platforma-answers.sh. -
Run the installer with a new value in
MASTER_SECRET. The value must be base64 of 32 bytes or more:Terminal window MASTER_SECRET="$(openssl rand -base64 32 | tr -d '\n')" bash install.shThe installer adds the value as a new version of the master secret in Secret Manager before it shows the review. Check the review and confirm. The installer writes the new value into the Secret
platforma-master-secretand showsKubernetes Secret platforma-master-secret updated.The new version of the secret restarts the Backend. Result: the installer showsDone.
Set MASTER_SECRET only on this run. Each run with MASTER_SECRET adds a new version and
restarts the Backend, also with the same value. Without it, the installer keeps the value that is
in Secret Manager. When you answer n at the review, the new version stays in Secret Manager, and
the next run of the installer applies it.
Tool: platforma-tf-* modules (cloud and cloud-agnostic)
-
Replace the value in the Secret of the master secret (by default
platforma-master-secret, keymaster-secret):Terminal window openssl rand -base64 32 | tr -d '\n' > master-secret.txtkubectl create secret generic platforma-master-secret --namespace <namespace> \--from-file=master-secret=master-secret.txt --dry-run=client -o yaml | kubectl apply -f - -
Restart the Backend. The Deployment has the name of the Helm release (
backend_service.release_name):Terminal window kubectl rollout restart --namespace <namespace> deployment/<release>
Tool: platforma-backend
-
Replace the value in the Secret of
secrets.masterSecret(by defaultplatforma-master-secret, keymaster-secret):Terminal window openssl rand -base64 32 | tr -d '\n' > master-secret.txtkubectl create secret generic platforma-master-secret --namespace <namespace> \--from-file=master-secret=master-secret.txt --dry-run=client -o yaml | kubectl apply -f - -
Restart the Backend. The Deployment has the name of the Helm release:
Terminal window kubectl rollout restart --namespace <namespace> deployment/<release>
Tool: platforma binary
-
Write a new value into the file of the master secret (
PL_MASTER_SECRET_FILE, for example/etc/platforma/master-secret):Terminal window openssl rand -base64 32 | tr -d '\n' | sudo tee /etc/platforma/master-secret > /dev/null -
Restart the Backend:
sudo systemctl restart 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.
backend_service = { auth = { show_user_list_to = "admins" }}auth: showUserListTo: adminsAdd the option --show-user-list-to to the start command of the Backend, or its variable to the
environment of the service:
PL_SHOW_USER_LIST_TO=admins # users (default), admins or nobodyTo 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.