Proxy and custom CA
Make Platforma work behind a corporate proxy, with a corporate certificate authority, or with access to fixed IP addresses only.
Platforma can run in a corporate network where the internet is reachable only through a proxy, where a proxy inspects TLS with a corporate certificate authority, or where the firewall allows only fixed IP addresses. Set the parts that the network needs:
- Proxy: outbound connections through a proxy.
- CA bundle: trust a corporate certificate authority.
- Restricted network mode: access to fixed IP addresses.
- Clients: proxy and registry of 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 and pl-clipl-cli — The command-line client of Platforma. Administrators use it to manage users and projects on the Backend. Glossary on each computer.
For what each part of Platforma needs behind a proxy that inspects TLS, see TLS inspection. For the hosts that Platforma connects to, see Outbound connections. For what Platforma expects from the proxy and the bundle, see Proxy and CA bundle.
For an installation made with an installer, see Install in cloud with installer.
Proxy
The BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary reads the standard proxy variables: HTTPS_PROXY, HTTP_PROXY and NO_PROXY.
NO_PROXY lists the addresses that the Backend reaches directly, not through the proxy.
Set the variables in the environment of the Backend pod: the Helm value env.variables, or the
Terraform input backend_service.env.variables of platforma-tf-services. NO_PROXY must hold:
.svcand.cluster.local: the services inside the cluster;169.254.169.254: the metadata service of the cloud;- the address of an object storage inside the cluster or the corporate network, when the Backend must reach it directly.
env: variables: HTTPS_PROXY: http://proxy.example.com:3128 HTTP_PROXY: http://proxy.example.com:3128 NO_PROXY: .svc,.cluster.local,169.254.169.254backend_service = { env = { variables = { HTTPS_PROXY = "http://proxy.example.com:3128" HTTP_PROXY = "http://proxy.example.com:3128" NO_PROXY = ".svc,.cluster.local,169.254.169.254" } }}When the proxy URL holds a password, keep the URL in a Secret, and give it with
env.secretVariables (Terraform: backend_service.env.secret_variables):
env: secretVariables: - name: HTTPS_PROXY secret: { name: platforma-proxy, key: url }backend_service = { env = { secret_variables = [ { name = "HTTPS_PROXY", secret = { name = "platforma-proxy", key = "url" } }, ] }}The chart stops when extraArgs or an env list has an option or a variable of these kinds:
- a secret value in plain text: give it with
env.secretVariables; - the license, the 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, or the list of users: set them with their chart values;
- the metrics listener, or an option that another chart value sets;
- the HTTP listener and the file-system storage 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 module gives extra_args and env to the chart, so the same applies to them. For the full
list, see Environment and extra options.
The nodes pull the images through the proxy settings of their container runtime. This is a setting of the nodes, outside Platforma. Or the nodes pull from mirrors inside the corporate network: see Registries.
After a change of the variables, apply the values: the Backend pod starts again.
Set the variables in the environment of the Backend service, for example in its systemd unit:
[Service]Environment=HTTPS_PROXY=http://proxy.example.com:3128Environment=HTTP_PROXY=http://proxy.example.com:3128Environment=NO_PROXY=localhost,127.0.0.1On a server in a cloud, also add 169.254.169.254, the metadata service, and the address of an
object storage that the Backend reaches directly.
With the Docker image of the Backend, give them with docker run -e. The jobsjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary get the
environment of the Backend, also when they run in Docker containers. Docker pulls the images of
the tools through the proxy settings of the Docker service: set them there, or use a mirror (see
Registries).
After a change of the variables, restart the Backend.
CA bundle
A CA bundleCA 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. Glossary lets Platforma trust a corporate certificate authority: of a proxy that inspects TLS, of a mirror, or of an object storage inside the corporate network.
Give Platforma a full bundle: one PEM file with the public certificate authorities and the corporate ones. The Backend pod and all job pods mount it read-only at the same path, so the Backend and the tools of the BlocksBlock — A small application for one step of an analysis, for example the import of reads or clustering. It can combine several tools. Glossary trust the same authorities.
-
Make a ConfigMap with the bundle in the namespace of the instance. The company keeps it current: for example, a trust-manager
Bundlejoins the public certificate authorities and the corporate one into this ConfigMap. Or make it by hand:Terminal window kubectl -n platforma create configmap corporate-ca-bundle \--from-file=ca-certificates.crt=./full-bundle.pem -
Give its name to Platforma:
Helm value Terraform input of platforma-tf-servicesDefault caBundle.configMap.nameinfrastructure.ca_bundle.config_map.name"": no bundle, each image keeps its own trust storecaBundle.configMap.keyinfrastructure.ca_bundle.config_map.keyca-certificates.crtcaBundle.filePathinfrastructure.ca_bundle.file_path/etc/ssl/certs/ca-certificates.crtvalues.yaml caBundle:configMap: { name: corporate-ca-bundle, key: ca-certificates.crt }On an own cluster with the 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, set
cloud_values.ca_bundleincluster_configwith the same keys. With the cloud-specific Terraform modulescloud-specific Terraform modules — The Terraform modules platforma-tf-cloud-base and platforma-tf-cloud-cluster. There is one pair for each cloud, AWS and Google Cloud. The roots cloud and cluster apply them. They make the network, the Kubernetes cluster, the storage, the cloud identities and the registry caches. They give the hand-off file cluster_config to the cloud-agnostic Terraform modules. Glossary, the hand-off fileinfrastructurehasca_bundle = null. Add the bundle in the rootservices:platforma-tf-services infrastructure = merge(jsondecode(file("infrastructure.json")), {ca_bundle = { config_map = { name = "corporate-ca-bundle" } }}) -
Apply. The Backend pod starts again with the bundle.
Each pod gets these variables, all set to the path of the bundle, so that common software finds
it: SSL_CERT_FILE, CURL_CA_BUNDLE, REQUESTS_CA_BUNDLE, CONDA_SSL_VERIFY,
MAMBA_SSL_VERIFY, PIP_CERT, NODE_EXTRA_CA_CERTS, npm_config_cafile,
YARN_HTTPS_CA_FILE_PATH, DENO_CERT, GIT_SSL_CAINFO, GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,
CARGO_HTTP_CAINFO, PERL_LWP_SSL_CA_FILE and HTTPS_CA_FILE. NODE_USE_SYSTEM_CA is 1.
Tools that check their license, such as MiXCR, do not use the bundle for the license service: see TLS inspection.
After the bundle changes, new job pods get the new bundle, but the running Backend pod keeps
the old one: restart the Backend (kubectl -n platforma rollout restart deployment/platforma).
There is no bundle setting. The Backend, and the jobs that run without Docker, use the trust
store of the server. Add the corporate certificate authority to it, for example with
update-ca-certificates on Debian and Ubuntu or update-ca-trust on Red Hat Enterprise Linux,
then restart the Backend. Jobs in Docker containers use the trust store of their image, not the
corporate certificate authorities of the server.
With the Docker image of the Backend, mount the full bundle into the container at
/etc/ssl/certs/ca-certificates.crt, or set SSL_CERT_FILE to the path of the bundle in the
container.
For tools that check their license, such as MiXCR, see TLS inspection.
TLS inspection
A proxy that inspects TLS opens each HTTPS connection and signs it again with a certificate authority of your company. A connection through this proxy works only when the part of Platforma that connects trusts this certificate authority. Each part reads its trust from its own place:
| Part | What to do |
|---|---|
| Backend | KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary cluster: give the CA bundle. Single Server mode: add the certificate authority to the trust store of the server. This covers all HTTPS connections of the Backend: the license service, the registries, the monitoring service, the identity provider and the storage. |
| Jobs | Kubernetes cluster: the job pods get the same CA bundle. Single Server mode: jobs without Docker use the trust store of the server; jobs in Docker containers use the trust store of their image. |
| Jobs of tools that check their license, such as MiXCR | Exclude licensing-api.milaboratories.com from the inspection. These tools check the certificate of the license service with their own trust store, not with the CA bundle. |
| Cluster nodes, or Docker on the server | The container runtime pulls the images. Add the certificate authority to the trust store of the nodes, or to the settings of the container runtime. This is a setting of the nodes, outside Platforma. Or the nodes pull from mirrors inside the corporate network (see Registries). |
| Desktop App | Add the certificate authority to the trust store of the operating system. On Windows, this is the certificate store; on macOS, the keychain; on Linux, the system certificate authorities (for example, with update-ca-certificates). Or start the Desktop App with NODE_EXTRA_CA_CERTS set to a PEM file with the certificate authority: this works on each operating system. See What the Desktop App trusts. |
| pl-cli | Set NODE_EXTRA_CA_CERTS to a PEM file with the certificate authority (see What pl-cli trusts). This covers the connection to the Backend and the requests to the identity provider for SSOsingle sign-on — Sign-in through the identity service of the company, with the same account as for other company systems. Glossary. |
The Backend connects to an LDAPLDAP — The directory of users of a company. The Backend can check logins and passwords in it. Glossary directory directly, not through the proxy. For a directory with a
certificate of a corporate certificate authority, see the setting trustedCA in
LDAP.
NODE_EXTRA_CA_CERTS=/etc/ssl/certs/corporate-ca.pem ./<file of the Desktop App>.AppImageIn Single Server mode, a tool that checks its license and runs without Docker can also trust a
PEM bundle. Set MI_CUSTOM_CA=<path of the PEM CA bundle> in the environment of the Backend: the
jobs get the environment of the Backend.
For the hosts that each part connects to, see Outbound connections.
Restricted network mode
When the firewall allows access only to fixed IP addresses, turn on the restricted network mode.
The Backend then uses bin-ga.pl-open.science and blocks-ga.pl-open.science instead of
bin.pl-open.science and blocks.pl-open.science. The -ga hosts answer on two fixed IP
addresses. The Backend gets the software packages and the assets from them. The Desktop App has its own
setting for the Blocks, “Use Global Access Registry”: see
Desktop App.
For the addresses and the other services on them, see
Restricted network mode.
The chart values and the module inputs do not cover this setting. Set the environment variable of the Backend pod:
env: variables: PL_USE_RESTRICTED_NETWORK_MODE: "true"backend_service = { env = { variables = { PL_USE_RESTRICTED_NETWORK_MODE = "true" } }}Start the Backend with --use-restricted-network-mode, or set the environment variable
PL_USE_RESTRICTED_NETWORK_MODE=true. After the change, restart the Backend.
A mirror that you set for the assets (see Registries) takes priority
over the -ga host. After the change, new downloads use the -ga hosts, and the projects and their
data do not change.
Clients
The Desktop App keeps its network settings on each computer, in its settings. Give users the values that the corporate network needs:
- Proxy settings: “System proxy” (default) uses the proxy of the operating system. “Custom proxy” takes a “Proxy URL”, and both take an optional user name and password, which the Desktop App keeps encrypted with the keychain of the operating system. “No proxy” connects directly. For the connection to the Backend, the Desktop App tries both the direct way and the proxy, and uses the one that works.
- Use Global Access Registry: the Desktop App gets the Blocks from
blocks-ga.pl-open.science, which answers on fixed IP addresses. The Desktop App turns this setting on by itself whenblocks.pl-open.scienceis not reachable at start.
For the certificate authorities that the Desktop App trusts, see What the Desktop App trusts. For the Block registryBlock registry — A service from which the Desktop App downloads Blocks. MiLaboratories runs the main one; a company can add its own. Glossary settings, see Block registries in the Desktop App.
pl-cli network settings
pl-cli takes its network settings from the environment of the computer where it runs. It does not use the settings of the Desktop App. It connects only to the address of the Backend: it does not connect to the primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary, to the registries or to other services.
- Proxy. pl-cli uses an HTTP proxy when the environment variable
https_proxyis set, orhttp_proxywhenhttps_proxyis not set. Write the names in lowercase: on Linux and macOS, pl-cli does not readHTTPS_PROXY. The proxy address starts withhttp://and can hold a user name and a password. The proxy must let pl-cli open a tunnel to the Backend with theCONNECTmethod. pl-cli does not try the direct way when the proxy fails. - No proxy.
no_proxylists the hosts that pl-cli reaches directly.
export https_proxy=http://proxy.example.com:3128export no_proxy=platforma.internal.example.comFor the certificate authorities that pl-cli trusts, see What pl-cli trusts.
Changes on a running installation
| Change | What happens | What to do |
|---|---|---|
| Set or change the proxy | The Backend starts again with the new variables (see Restart of the Backend) | Apply the new values (Kubernetes) or restart the Backend (Single Server mode) |
| Add a certificate authority to the bundle | New job pods get the new bundle at once. The Backend keeps the old one | Restart the Backend |
| Turn on the restricted network mode | New downloads of the Backend use the -ga hosts. Projects and data do not change |
Allow the two IP addresses in the firewall first, then restart the Backend |
Problems
After the proxy is set, the Backend cannot reach the storage, or its cloud identity fails.
Cause: NO_PROXY does not hold the addresses inside the cluster, the metadata address or the
address of the storage. Fix: add them, then restart the Backend.
Downloads of software or assets stop and do not continue. Cause: the proxy closes connections that wait without data. Fix: allow long connections without data in the proxy. See Proxy and CA bundle.
A tool in a job fails with a certificate error. Cause: the bundle does not hold the corporate certificate authority. Fix: add the certificate authority to the bundle, then run the Block again: new job pods get the new bundle.