Access control
See how users sign in, what each role can do, and which rights Platforma needs in the cloud account of your company.
Sign-in
Users sign 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 with the accounts that they already have, or with a token. They sign in with one of three kinds of 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, or with a token:
- SSO: at the corporate identity provider.
- LDAP: with the corporate LDAPLDAP — The directory of users of a company. The Backend can check logins and passwords in it. Glossary directory.
- Static list of users: names and passwords in a file.
- Single-user token: one user, for example a test installation.
In each case, every request to the API needs a session: there is no anonymous access. The client asks for the length of its session, and the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary gives at most 7 days. The Desktop App asks for a long session, so its session lasts 7 days; a client that does not ask for any length gets 24 hours. The client renews its session at half of its time, so users do not sign in again while they work. Between renewals, the Backend checks only the session itself: API calls do not contact the sign-in provider.
At each renewal, the Backend checks that the user is still valid, when the sign-in provider lets it check without the password of the user:
| Sign-in provider | Check at the renewal | After the user is removed |
|---|---|---|
| Static liststatic 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 | The login must still be in the file. | The Backend refuses to renew the session. |
| LDAP, search mode | The service account searches for the user again. | The Backend refuses to renew the session. |
| LDAP, direct bind | The Backend does not check the user at renewal. | — |
| SSOsingle sign-on — Sign-in through the identity service of the company, with the same account as for other company systems. Glossary | The Backend renews the tokens of the identity provider every hour in the background (SSO). | When the identity provider refuses the refresh token, the Backend refuses to renew the session. The identity provider decides when it refuses. |
When the Backend refuses to renew a session, 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 continues to work with its current session until this session ends: at most 7 days after its last renewal. Then the user must sign in again, and the sign-in fails.
To end the sessions of a removed user at once, the operatoroperator — The person who installs and runs Platforma in your company, for example an IT engineer or a bioinformatician. Glossary changes the master secret. This ends the sessions of all users, not only of the removed user: all users sign in again. For the steps, see Change the master secret.
SSO
Platforma uses OpenID Connect with the authorization code flow and PKCE, as a public client. It does not support a confidential client. The Desktop App runs the flow and gets the tokens from the identity provider. The Backend checks the result and keeps the tokens of the identity provider.
- The Desktop App asks the Backend for the settings of the identity provider (the issuer, the client ID and the scopes) and for a nonce that the Backend accepts one time only. When the operator set a client secret, the Backend also gives it to the Desktop App.
- The Desktop App opens the system browser of the computer. The user signs in at the corporate identity provider: the password goes only there, and the policies of the identity provider apply, for example multi-factor authentication.
- The identity provider sends the authorization code back to the Desktop App, to a local address
of the computer (
http://127.0.0.1:<port>/callback). The Desktop App checks thestatevalue and exchanges the code for the tokens with the PKCE verifier. - The Desktop App sends the token response to the Backend and does not keep any token of the identity provider.
- The Backend checks the ID token: the signature (with the keys from the discovery document of the identity provider), the issuer, the audience (the client ID), the expiry and the nonce. Then it gives the Desktop App a session of Platforma. The Desktop App keeps this session in its data folder on the computer of the user.
The Backend keeps the ID token, the access token and the refresh token of each user in its database, encrypted with a key made from the master secret. A background process runs every hour and renews, with the refresh token, the tokens that are near their end. The Backend does not ask the identity provider at each renewal of a session of Platforma. The identity provider can refuse the refresh token, for example because the user is blocked. Then the Backend ends the session of the user with the identity provider and refuses to renew the session of Platforma. The Desktop App continues to work with its current session until this session ends (see Sign-in).
The identity provider must:
- give a refresh token: by default, the Desktop App asks for the scopes
openid,profile,emailandoffline_access; - publish a discovery document that the Backend can read at start: without it, the Backend does not start.
By default, the login of a user is the sub claim of the ID token. The Backend uses an email
address only when the identity provider has verified it. 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 can come from the
groups of the user at the identity provider.
LDAP
The Desktop App sends the login and the password of the user to the Backend, inside its connection to the Backend. This connection uses TLS when TLS is on in the Backend (always through the entry point in KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary; optional 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 Backend checks them with a bind to the corporate LDAP directory, in one of two modes:
- Direct bind. The Backend puts the login into a DN template, for example
uid=<login>,ou=people,dc=example,dc=com, and binds as this DN with the password of the user. - Search mode. The Backend binds with a service account of the directory. It searches for the entry of the user with a filter (for example, only the members of one group, or only accounts that are not disabled). Then it binds as the DN that it found, with the password of the user.
In both modes, the Backend can read the groups of the user (from memberOf, and in search mode
also with a search for groups) and give the administrator role from them. It reads the groups at
sign-in only.
The Backend does not keep or log the password of the user: the password is in memory only for the bind. Each sign-in is a bind to the directory, so the lockout policy of the directory applies; the Backend does not have any limit of its own on failed attempts. By default, the Backend does not create users: a login that it does not know is refused.
The connection to the directory can use ldaps:// or StartTLS, with a check of the certificate
of the server, a custom CA and a client certificate. Without TLS, the password of the user and
the password of the service account go over the network in clear text.
Static list of users
The names of the users and the hashes of their passwords are in a file that the operator keeps on the side of the Backend. The Backend checks the password with this file and does not connect to any outside service. For the format of the file, see The secrets of Platforma.
The Backend accepts all formats of the htpasswd tool: bcrypt, and also weak hashes (MD5, SHA-1)
and passwords in plain text. The operator chooses the format by the security rules of your
company. MiLaboratories recommends bcrypt, a strong, slow hash.
When a sign-in provider fails
A sign-in provider that fails does not stop the users of the other providers. For example, when the LDAP directory is unreachable, the users of a static list of users can still sign in. The Backend gives each provider at most 20 seconds to check a login and a password. A provider that does not answer in this time fails.
The client decides which providers the Backend checks:
- The Desktop App sends the provider that the user selects on the sign-in screen. The Backend checks only this provider. When this provider fails, the sign-in fails with an authentication error, and the details are in the log of the Backend.
- pl-clipl-cli — The command-line client of Platforma. Administrators use it to manage users and projects on the Backend. Glossary names the provider at
pl-cli login --method <id>. A command with a login and a password of its own (-uwith-p) does not name a provider: it sends only the login and the password. The Backend then checks the providers that take a password, in the order of the list.
When the Backend checks the providers in order, it does this with the result of each provider:
| Result of the provider | What the Backend does |
|---|---|
| It accepts the login and the password. | The user signs in. The Backend does not check the next providers. |
| It refuses the login or the password. | The Backend checks the next provider. |
| It fails: the server is unreachable, it does not answer in 20 seconds, or its settings are wrong. | The Backend writes the error to its log and checks the next provider. |
When no provider accepts, the sign-in fails. When all providers refused, the error says that the credentials are not valid. When one or more providers failed, the error does not say this: a failed provider could accept the credentials. The error names the failed providers. The text of their errors can contain internal host names, so it goes only to the log of the Backend. The Backend uses the same rules when it checks a request that has a login and a password.
An administrator login in a static list of users, next to SSO or LDAP, is an emergency sign-in. Whether this login exists depends on the installation pathinstallation path — A set of tools and steps that installs Platforma. There are five installation paths: the AWS installer, the Google Cloud installer, the Terraform modules, the Helm chart and Single Server mode. Glossary:
- AWS installer and Google Cloud installer: the installer always makes the administrator login
platformain a static list of users, with a password that it makes. No installer parameter turns it off. - Terraform modulesTerraform modules — The Terraform code that MiLaboratories provides to install Platforma. The cloud-specific Terraform modules make the cluster and its cloud parts in AWS or Google Cloud; the cloud-agnostic Terraform modules install Platforma into the cluster. Glossary, Helm chart and Single Server mode: there is no static list of users by default. The emergency sign-in exists only when the operator adds a static list of users with an administrator login to the sign-in providers: see Static list of users and Users and roles.
When the emergency sign-in exists, it works while the Backend runs. When a sign-in provider is unreachable while the Backend starts, this happens:
- LDAP: the Backend starts. It connects to the LDAP directory only at a sign-in.
- SSO: the Backend does not start. It must read the discovery document of the identity provider when it starts. The emergency sign-in does not help. The Backend starts again when the identity provider is reachable, or when the operator removes the SSO provider from the settings: see Start the Backend while the identity provider is down.
Users
Roles
| Role | Can do |
|---|---|
| User | Work with their own projects, and with the projects that other users share with them |
| Administrator | Everything a user can do; also read and change the data of every user, act as any user, and share data, such as projects, with all users |
When the operator sets up the Backend, they choose how users get the administrator role: by a list of logins, or by groups or other attributes from the sign-in provider. At each sign-in, the Backend gives the role to the users who match.
Separation of users
Each user sees only their own projects and the projects that others share. The Backend gives each user references to data that work only in the session of that user, so a user cannot open data by guessing its ID. It checks the permissions each time data is used, so a removed permission works at once. When a user shares a project, the colleague gets a copy, and the copy belongs to the colleague: a removed share does not remove a copy that the colleague already made.
Infrastructure
Identities in the cluster
In Kubernetes, the parts of Platforma have these rights:
| Who | Cloud rights | Rights in Kubernetes |
|---|---|---|
| Backend | Read and write the primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary; read 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. On Google Cloud, also sign the links to files. | In its namespace: start and stop jobs, read pods, logs and events, read its settings and all Secrets of its namespace. Read the state of its two job queues. |
| Jobs | None, on every installation path. On AWS, the jobs have an IAM role without policies; the operator can add policies to it. On Google Cloud, the jobs do not have a cloud identitycloud identity — The identity that the cloud gives to the Platforma pod (IAM roles for service accounts on AWS, Workload Identity on Google Cloud). With it, Platforma needs no access keys. Glossary. | None |
| Nodes | Pull images from the corporate mirrors | — |
The Backend can read every Secret in its namespace, not only the Secrets of Platforma. So the operator installs Platforma in a namespace of its own, with no Secrets of other applications.
The Backend gets its cloud rights through a cloud identity bound to its Kubernetes service account (IAM roles for service accounts on AWS, Workload Identity on Google Cloud), so there are no keys. On AWS, its rights apply to the whole bucket of Platforma by default, and only to one folder when the operator sets a folder prefix; on Google Cloud, to the whole bucket of Platforma.
Rights to install
Each part of the installation can go to the team that owns it. The installation has three steps, and each step needs only its own rights:
- Cloud: the network, the cluster, the storage and the identities. Needs rights in the cloud account.
- Cluster: the entry pointentry point — The way in to the Backend from outside the cluster, a load balancer or an Ingress with a DNS name. It usually ends TLS and sends the traffic to the Backend pod. Glossary, the job queues and the storage classes. Needs full admin rights in the cluster.
- Platforma: the Backend. Needs only admin rights in one namespace that already exists. The cluster step gives the Backend its read right on the two job queues.
Each step gives the next one a hand-off file: the names and addresses that it made, with no secrets.
Pod security
The Backend and all jobs run as one non-root user (1010 by default). They cannot get more privileges, and they do not have any extra Linux rights (capabilities). All services of Platforma are internal to the cluster; only the entry point is open to clients.
The nodes that the modules make use encrypted disks.