Service account roles for a Google cloud credential

Grant the service account of a Google cloud credential only the predefined roles that your deployment uses, instead of the Owner or Editor role on the project.

Cloudera recommends granting the service account only the predefined roles that your deployment uses, instead of the Owner or Editor role on the project. The Owner or Editor role works, but it grants far broader access than Cloudera Cloud Factory needs, and the credential uses a static service account key. Grant each role in the following tables on the resource that the Where to grant it column lists.

Domain Name System (DNS) uses a separate DNS credential, not the service account of the Google cloud credential.

Roles in the service project

Grant the following roles on the service project, which is the project in which the clusters run.

Table 1. Roles in the service project
RoleWhere to grant itWhen it is requiredPurpose
roles/compute.instanceAdmin.v1Service projectAlwaysLists regions, zones, machine types, disk types, and images, and creates, starts, stops, resets, and deletes the virtual machines (VMs) and disks of the clusters.
roles/compute.loadBalancerAdminService projectWhen you use Kubernetes Service objects of type LoadBalancerAllows the cloud-controller-manager to create the load balancers for those Services.
roles/compute.securityAdminService projectWhen you do not use a Shared VPC networkManages the firewall rules of the clusters. With a Shared VPC network, the firewall rules are on the host project.
roles/iam.serviceAccountUserService projectAlwaysAttaches a service account to the cluster VMs.
roles/serviceusage.serviceUsageViewerService projectAlwaysChecks that the required APIs are enabled in the project.

Roles that depend on your configuration

Grant the following roles only when your deployment uses the feature that the table lists.

Table 2. Roles that depend on your configuration
RoleWhere to grant itWhen it is requiredPurpose
roles/compute.networkAdminService projectWhen Cloudera Cloud Factory creates the VPC network, which means that VPC Import is turned offCreates and manages the VPC network and its subnetworks.
roles/file.viewerProject that contains the Filestore instanceWhen projects share a Filestore file systemLists the existing Filestore instances. Cloudera Cloud Factory does not create Filestore instances.
roles/container.viewerProject that contains the Google Kubernetes Engine (GKE) clusterWhen you import an existing GKE clusterLists and reads the GKE clusters.
roles/resourcemanager.projectCreatorFolderWhen Cloudera Cloud Factory creates new projects in a folderCreates the projects in which the clusters run.
roles/resourcemanager.folderViewerFolderWhen Cloudera Cloud Factory creates new projects in a folderReads the folder when Cloudera Cloud Factory validates the credential.
roles/serviceusage.serviceUsageAdminFolderWhen Cloudera Cloud Factory creates new projects in a folderEnables the required APIs on the new projects.

When Cloudera Cloud Factory creates projects in a folder, it also deletes the projects that it created. By default, Google Cloud grants the creator of a project the Owner role on the new project, which covers the deletion.

Role on the billing account

Table 3. Role on the billing account
RoleWhere to grant itWhen it is requiredPurpose
roles/billing.user (Billing Account User)Billing accountAlwaysLists the billing accounts and links projects to the billing account. Cloudera Cloud Factory checks the billing.resourceAssociations.create permission on the billing account.

Permissions for a custom role

If your security team requires a custom role, Cloudera Cloud Factory uses the following permissions to validate the credential and to load the regions, zones, machine types, disk types, images, and networks:

- compute.regions.get
- compute.regions.list
- compute.zones.list
- compute.machineTypes.get
- compute.machineTypes.list
- compute.diskTypes.list
- compute.images.get
- compute.images.getFromFamily
- compute.images.list
- compute.networks.get
- compute.networks.list
- compute.subnetworks.get
- compute.subnetworks.list
- resourcemanager.projects.get
- serviceusage.services.get

A custom role also needs the provisioning permissions that the predefined roles in the preceding tables grant, for example, the permissions to create VMs, disks, and firewall rules. After you create the custom role, verify that Cloudera Cloud Factory can load the machine types and create a cluster with it.