# Identity, Secrets and outbound access

Know which ServiceAccounts, Secrets and outbound connections Platforma expects before you install it.

Platforma does not keep any secret value in Terraform and does not create rights in a cloud or in the storage itself. It expects the identities, the Secrets and the network paths to exist, and the Backend (The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs.) uses them. So the security team of your company keeps full control of the keys and the rights, and the installation does not hold a copy of them. This page says what Platforma expects before the installation, and which options it supports.

## Service accounts and their identity

The Backend and its jobs (One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster.) use two Kubernetes (A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster.) ServiceAccounts in the namespace of the instance: one for the Backend pod, one for all job pods. The infrastructure binds its identity (for example a cloud 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.)) to their names, so Platforma takes the names as inputs (see [Default names](/infrastructure-contract-names/)). By default, the installation creates the ServiceAccounts with these names; it can also use ServiceAccounts that exist.

Platforma supports two ways for a ServiceAccount to get its rights to the storage:

- [Cloud identity](#cloud-identity): rights without keys, in AWS and Google Cloud
- [Access keys](#access-keys): where there is no cloud identity, for example in the data center of your company

### Cloud identity

In a cloud, the cloud binds a role to the ServiceAccount: IAM roles for service accounts in AWS, Workload Identity in Google Cloud. The binding is an annotation on the ServiceAccount, for example `eks.amazonaws.com/role-arn`, that the infrastructure gives. There are no keys to keep or rotate.

### Access keys

For storage that does not have a cloud identity, for example storage with an S3-compatible interface in the data center of your company, the access keys are in a Kubernetes Secret. The Backend reads them from there.

The jobs do not need direct access to the primary storage (The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files.) or to the data libraries (A folder or bucket with input data of the company. Users select files from it in the Desktop App. Platforma only reads it.): the Backend moves the data for them. For the rights that the Backend and the jobs need in AWS and Google Cloud, see [Permissions at run time](/plan-permissions-runtime/). For the rights that the operator (The person who installs and runs Platforma in your company, for example an IT engineer or a bioinformatician.) needs, see [Permissions](/plan-permissions/).

The Backend pod and all job pods run as one user and group that is not root. The namespace must accept such pods, and the same user and group own the workspace (The storage where the Backend and all jobs keep the working files of running jobs. The Backend and the jobs use it at the same time. In Kubernetes, it is a network file system; in Single Server mode, it is a folder on the server.).

## Secrets

Before the installation, Platforma expects these Kubernetes Secrets in the namespace of the instance:

- always the license and the master secret (except in one-user mode, which uses a token);
- for each feature that needs one, the Secret of the sign-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.), the storage keys or the image pull Secrets.

For the default names and keys of each Secret and the input that changes them, see [Secrets](/infrastructure-contract-names/#secrets).

Each setting that holds a secret is only a reference to a Secret (its name and key): the modules and the chart do not accept a secret value in place. The Backend never creates these Secrets. An administrator creates them, the installer creates them, or a sync from a secret manager creates them (for example External Secrets). The chart gives each secret to the Backend as a file mounted from its Secret, or as an environment variable from its Secret: a secret value is never on the command line of the Backend.

Job pods do not get any Secret by default. A job gets only the values that its Block (A small application for one step of an analysis, for example the import of reads or clustering. It can combine several tools.) asks for. It gets them as environment variables from the keys of one Secret: by default, the license Secret. For example, tools that check their license get the license key `MI_LICENSE`.

For what each secret protects and what happens when it changes, see [Secrets](/security-secrets/). For the sign-in providers, see [Authentication](/configuration-authentication/).

## Registries and mirrors

The installation, the Backend and the nodes of the cluster get the charts, the images, the Blocks and the assets from the registries of MiLaboratories and from `registry.k8s.io` (Kueue (A Kubernetes add-on that holds jobs in a queue until the cluster has free CPU, memory and GPU for them.)). The machine that runs the installation gets the Terraform 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.) from `github.com` (the repository `milaboratory/platforma-install`) and the Helm charts from `oci://ghcr.io/milaboratory/platforma-install`, or both from a clone of this repository. For each registry, Platforma needs access to it or to a mirror in the company. A mirror holds the same versions as the original: the same tags and digests.

MiLaboratories recommends a pull-through cache or a full mirror of `containers.pl-open.science` before the first Block runs. Some images of the tools are large, and each pull adds to the time of a Block run on a node that does not have the image.

For a mirror that needs credentials, Platforma supports the cloud identity of the nodes, an image pull Secret in the namespace, or a Helm sign-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".) for a chart mirror. For how to give the credentials, see [Registries](/configuration-registries/#credentials-of-a-mirror).

For the full list of hosts, see [Outbound connections](/security-outbound-connections/).

## License service

The Backend, and the jobs of tools that check their license, connect to `licensing-api.milaboratories.com`. A mirror is not possible: without this connection, the Backend does not get its license.

## Proxy and CA bundle

Platforma supports an HTTP(S) proxy for outbound connections. The proxy must not change the answers: a sign-in page or a changed answer from the license service makes the license invalid. The proxy must not close connections that wait without data either, because some outbound clients of the Backend wait for a long time. Connections inside the cluster and, in a cloud, to the metadata service of the cloud (`169.254.169.254`) do not go through the proxy.

When an outbound TLS connection needs a private certificate authority (a proxy that inspects TLS, a private mirror, storage with a private certificate), Platforma expects a ConfigMap with a full CA bundle (One PEM file with the certificate authorities that a program trusts. In Kubernetes, Platforma can give the Backend and all jobs one bundle with the public and the corporate certificate authorities.) in the namespace. The bundle is one PEM file with the public and the private certificate authorities. It replaces the trust store of each image, so a bundle with the private certificate authorities only breaks all other TLS connections. Platforma does not update the bundle: the infrastructure keeps it current, for example with trust-manager. The Backend pod and all job pods get it.

> **Caution:**
>
> Java tools and some other software do not read a PEM bundle. Jobs of such tools cannot use a private certificate authority through the bundle alone.

For how to set the proxy and the bundle, see [Proxy and custom CA](/configuration-proxy-and-custom-ca/).

## Clock

The clock of the node of the Backend is synchronized (NTP). The difference to the clocks of the object storage and of the identity provider is less than 5 seconds.

For the default names of all objects and how to change them, see [Default names](/infrastructure-contract-names/).

## Next

- [Default names and how to change them](/infrastructure-contract-names/)
- [Registries mirroring](/registries-mirroring/)

Source: https://docs.platforma.bio/infrastructure-contract-identity/
