Permissions at run time
Know which rights the Backend, the jobs and the nodes have when Platforma runs, so that each team of the company gives only its part.
This page lists the rights that the parts of Platforma have when it runs: the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary, 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 and the nodes. For the rights to install and for the system 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, see Permissions.
Rights of the Backend
The Backend gets its cloud rights through 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 bound to its service account, so there are no keys to keep and to rotate:
- AWS: an IAM role through IAM roles for service accounts (IRSA), which trusts the OIDC provider of the cluster for the service account of the Backend. Platforma supports IRSA only.
- Google Cloud: a Google service account through Workload Identity: the KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary service
account has
roles/iam.workloadIdentityUseron it. A direct Workload Identity principal is not enough, because a signed link names a service account.
Storage without a cloud identity (for example, storage with an S3 interface in the data center) uses access keys in a Secret with the same rights: see Access keys. The jobs do not need these rights: the Backend moves the data.
The Backend needs cloud rights only when the primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary or a data librarydata 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 is a bucket: see Single Server mode.
Storage
The Backend reads and writes the primary storage bucket and reads the data library buckets. 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 give these rights to the cloud identity of the Backend; give the same rights to a role, an account or keys that you make in another way.
Primary storage
Without a prefix, use <bucket>/*.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PrimaryStorageBucket", "Effect": "Allow", "Action": ["s3:ListBucket", "s3:ListBucketMultipartUploads", "s3:GetBucketLocation"], "Resource": "arn:aws:s3:::<bucket>" }, { "Sid": "PrimaryStorageObjects", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:DeleteObject", "s3:AbortMultipartUpload", "s3:ListMultipartUploadParts" ], "Resource": "arn:aws:s3:::<bucket>/<prefix>*" } ]}- A bucket encrypted with a customer managed KMS key also needs
kms:Decryptandkms:GenerateDataKeyon that key. - The links that the Backend signs for 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 do not need another action.
roles/storage.objectUseron the bucket.roles/iam.serviceAccountTokenCreatoron the Backend account itself, for the signed links of the Desktop App (iam.serviceAccounts.signBlob). A custom role with only this permission is narrower.
SA=<backend account>@<project>.iam.gserviceaccount.comgcloud storage buckets add-iam-policy-binding gs://<bucket> \ --member="serviceAccount:$SA" --role=roles/storage.objectUsergcloud iam service-accounts add-iam-policy-binding "$SA" \ --member="serviceAccount:$SA" --role=roles/iam.serviceAccountTokenCreatorData libraries
A data library that the Backend reads with its own identity needs read rights only. Give them for each library. The access modes for each user (federated user access and Google account of the user) do not need library rights for the Backend.
Without a library prefix, drop the condition.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "DataLibraryBucket", "Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": "arn:aws:s3:::<library bucket>", "Condition": {"StringLike": {"s3:prefix": ["<library prefix>*"]}} }, { "Sid": "DataLibraryBucketLocation", "Effect": "Allow", "Action": ["s3:GetBucketLocation"], "Resource": "arn:aws:s3:::<library bucket>" }, { "Sid": "DataLibraryObjects", "Effect": "Allow", "Action": ["s3:GetObject"], "Resource": "arn:aws:s3:::<library bucket>/<library prefix>*" } ]}A library bucket in another AWS account also needs a bucket policy of its owner:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PlatformaBackendRead", "Effect": "Allow", "Principal": {"AWS": "arn:aws:iam::<account>:role/<backend role>"}, "Action": ["s3:ListBucket", "s3:GetBucketLocation"], "Resource": "arn:aws:s3:::<library bucket>" }, { "Sid": "PlatformaBackendReadObjects", "Effect": "Allow", "Principal": {"AWS": "arn:aws:iam::<account>:role/<backend role>"}, "Action": ["s3:GetObject"], "Resource": "arn:aws:s3:::<library bucket>/<library prefix>*" } ]}roles/storage.objectViewer on the library bucket. For a library with a prefix, an IAM condition
limits the reads to the prefix; the bucket must have uniform bucket-level access.
SA=<backend account>@<project>.iam.gserviceaccount.comgcloud storage buckets add-iam-policy-binding gs://<library bucket> \ --member="serviceAccount:$SA" --role=roles/storage.objectViewer \ --condition='title=platforma-data-library-prefix,expression=resource.type != "storage.googleapis.com/Object" || resource.name.startsWith("projects/_/buckets/<library bucket>/objects/<library prefix>")'Without a library prefix, drop --condition.
For the other access modes of data libraries, see Data library access modes.
Rights in Kubernetes
The chart gives the Backend a Role in its namespace; the CronJob that removes finished AppWrappers uses the same service account:
| Resource (API group) | Rights |
|---|---|
appwrappers (workload.codeflare.dev), jobs (batch) |
create, delete, get, list, watch, patch |
workloads (kueue.x-k8s.io), pods, pods/log, events |
get, list, watch |
localqueues (kueue.x-k8s.io), configmaps |
get, list |
secrets |
get |
Optional: read on its two ClusterQueues, for the queue statistics in the Desktop App (see the tab “Helm chart” in Rights to install). The Backend does not make volumes, Secrets, namespaces or objects outside its namespace: the chart makes them at install time.
Rights of the jobs and the nodes
In a cluster, the jobs do not need cloud or Kubernetes rights: the Backend moves their data, so a tool in a job cannot reach the storage with a right of its own. On AWS, the service account of the jobs has an IAM role with no policies. You can add policies to it when a job must reach another AWS service. On Google Cloud, it does not have a Google identity.
The nodes need only the right to pull images:
- AWS:
AmazonEC2ContainerRegistryPullOnly,AmazonEKSWorkerNodePolicyandAmazonEKS_CNI_Policy. With the caches ofregistry_mirrors, alsoecr:BatchImportUpstreamImage,ecr:CreateRepositoryandecr:TagResourceon the cached repositories. - Google Cloud:
roles/artifactregistry.readeron each cache ofregistry_mirrors, androles/container.defaultNodeServiceAccounton the project for the node logs and metrics.
The pods cannot use the identity of the node: the instance metadata service allows one network hop (AWS), and the GKE metadata server is on (Google Cloud). The controllers that the modules install on AWS each have their own IAM role; see Terraform modules.