Connect Google Cloud Organization or Project
To offer the full capabilities of the DoiT platform, we request permissions to access the Google API and obtain information for monitoring or alerts, and help you act on recommendations if applicable.
Required permissions
To connect with the DoiT console:
-
Your DoiT account must have the Manage Settings permission.
-
Most of the DoiT features require permissions at the organization level. To connect a Google Cloud Organization, you must have been granted the Organization Role Administrator (
roles/iam.organizationRoleAdmin
) IAM role on the organization. You need this role to create and attach custom roles to service accounts under the organization. -
Currently, a small set of core functionality permissions can be granted at the project level. To connect a Google Cloud project, you must have been granted the Role Administrator (
roles/iam.RoleAdmin
) IAM role on the project. You need this role to create and attach custom roles to service accounts under the project.
Service account authentication
Google Cloud supports using service accounts as identities for workloads. Starting June 2023, the preferred way to authenticate the service account for DoiT console workloads changes to service account impersonation, which mitigates the security risks associated with service account keys.
Service account impersonation involves two principals:
-
The privilege-bearing service account that has the required permissions to access the target resource.
-
The caller that needs to access the target resource but lacks permissions.
Configure identities for DoiT workloads
When connecting the DoiT console, you mainly need to perform two tasks to configure the identities for DoiT workloads:
-
Create a service account with the permissions to access the relevant resources of your organization or project.
-
Grant the DoiT-owned service account
[email protected]
(the caller) permissions to impersonate the privilege-bearing service account.
Below are the detailed configuration steps.
Connect an organization
To connect a Google Cloud organization:
-
Sign in to the DoiT console, select the gear icon () from the top navigation bar, and then select Google Cloud.
-
Select Connect a new organization.
-
Select the features you want to enable for the organization. You can expand features to review the required permissions.
-
Select Generate gcloud commands. The generated gcloud commands you need to run will be displayed in the DoiT console.
-
Launch a Google Cloud Shell session (see Launch Cloud Shell).
-
Select a Google Cloud project that meets the following conditions:
-
The project belongs to your organization.
-
The project is connected to a Google Cloud Billing account (see Verify the billing status of your projects).
-
You intend to keep the project for the long term and restrict its access only to trusted people.
-
-
Run the commands provided in the DoiT console sequentially:
-
Create a new service account in the current project.
-
If you want a custom name for the service account, replace
doit-cmp
with the desired name in the Create service account command and all the relevant subsequent commands. -
To change the name of a service account after its creation, remove the service account and create a new one with the updated name.
-
-
Enable service usage API and resource manager API in the current project.
-
Get your Google IAM organization ID and then create a custom role with the permissions required by your chosen features.
-
Add a policy binding with the custom role for the new service account under the organization. Permissions are granted at the organization level. See Security and data access policy for more information.
-
Grant the DoiT caller service account the Service Account Token Creator role
roles/iam.serviceAccountTokenCreator
to allow it to impersonate the former.NoteIf you use GCP organization policy to restrict identities by domain, make sure to whitelist the DoiT caller service account
[email protected]
using its Organization Resource IDC03rw2ty2
before proceeding.
-
-
Sign in to the Google Cloud console, go to the Roles page and verify that you have created a
doit_cmp_role
linked to the DoiT Service Account in your organization.
Connect a project
Only limited features work with permissions at the project level. To enable other features, connect an organization instead.
To connect an project:
-
Sign in to the DoiT console, select the gear icon () from the top navigation bar, and then select Google Cloud.
-
Select Connect a new project.
-
Select the features you want to enable for your project. You can expand features to review the required permissions.
-
Select Generate gcloud commands. The generated gcloud commands you need to run will be displayed in the DoiT console.
-
Launch a Google Cloud Shell session (see Launch Cloud Shell) and select the project you want to connect.
-
Run the commands provided in the DoiT console sequentially:
-
Get your Google IAM Project ID and create a new service account in the project.
-
If you want a custom name for the service account, replace
doit-cmp
with the desired name in the Create service account command and all the relevant subsequent commands. -
To change the name of a service account after its creation, remove the service account and create a new one with the updated name.
-
-
Enable service usage API and resource manager API in the project.
-
Create a custom role with the permissions required by your chosen features.
-
Add a policy binding with the custom role for the new service account. Permissions are granted at the project level. See Security and data access policy for more information.
-
Grant the DoiT caller service account the Service Account Token Creator role
roles/iam.serviceAccountTokenCreator
to allow it to impersonate the former.NoteIf you use GCP organization policy to restrict identities by domain, make sure to whitelist the DoiT caller service account
[email protected]
using its Organization Resource IDC03rw2ty2
before proceeding.
-
-
Sign in to the Google Cloud console, go to the Roles page and verify that you have created a
doit_cmp_role
linked to the DoiT Service Account in your project.
Update role
To add or remove features on an organization or project:
-
Select the gear icon () from the top navigation bar, and then select Google Cloud.
-
Select the three-dot menu next to the organization or project you want to update, and then select Edit.
-
Modify the selection of features as needed.
-
Select Update role.
You'll be asked to run
gcloud
commands to update your service account's role.
Add multiple organizations or projects
If you have multiple Google Cloud organizations or projects, connect each separately to regulate which organization or project has access to specific features.
Note that BigQuery Lens doesn't support multiple service accounts at the moment. See Set up BigQuery Lens.
Remove service accounts
In case you need to remove a service account under a connected organization from the DoiT console and then create a new one, be aware that:
-
Removing a service account from the DoiT console also removes the related datasets and sinks created by BigQuery Lens.
-
Once the BigQuery Lens permissions are granted to the new service account, we'll re-create the sink and trigger historical jobs backfill, which may lead to increased costs during your service account setup.