GCP FAQs
- Is there a set of Mods that need to be installed before importing GCP projects?
- Why are Project CMDB controls in Error after importing a GCP organization?
- Where can I restrict which regions Guardrails is monitoring?
- How do I rotate the GCP Project credentials integrated with Guardrails?
Is there a set of Mods that need to be installed before importing GCP projects?
Yes! The @turbot/GCP and @turbot/gcp-iam mods must be installed prior to
importing a GCP project. Service specific mods, such as
@turbot/gcp-computeengine, must also be installed to populate relevant
policies and controls. Check out our
recommended baseline mods for any new
environment.
Why are Project CMDB controls in Error after importing a GCP organization?
Almost always because the Cloud Resource Manager API is disabled in those projects. Guardrails charges each project's API calls to the project itself, so the API must be enabled in every project Guardrails manages, not only in the project that hosts the service account. The wizard's organization discovery does not catch this because it runs with organization-level credentials; the failure shows up afterwards in each project's GCP > Project > CMDB control with Cloud Resource Manager API has not been used in project <number> before or it is disabled. This applies in Project Only mode as well as All Resources mode.
Enable cloudresourcemanager.googleapis.com in the affected projects, or install the gcp-resourcemanager mod and set GCP > Cloud Resource Manager > API Enabled to Enforce: Enabled at the organization (the service account then needs roles/serviceusage.serviceUsageAdmin). Wait a few minutes and rerun the controls. If every control under the organization is in Error and the message mentions organizationcredentials, the API is disabled in the service account's own project instead. See Required GCP APIs for the full list of APIs and where each must be enabled.
Where can I restrict which regions Guardrails is monitoring?
Guardrails will monitor all GCP regions by default. Using the
GCP > Turbot > Regions policy, organizations can restrict which regions Guardrails
monitors. The expected format is an array of regions names. This policy is the
default value for all service Regions policies, such as
GCP > Compute Engine > Instance > Regions. It is important to note that any
resource in a region not listed will not be recorded in the Guardrails CMDB.
How do I rotate the GCP Project credentials integrated with Guardrails?
When you need to update your credentials that link Guardrails to your GCP Project, the following steps can be followed via the Turbot Guardrails console. For programmatic updates, you can use the Turbot Guardrails GraphQL API or the Guardrails Terraform provider.
There are two policies used to integrate a GCP Project with Turbot Guardrails:
GCP > Client Email:
- Navigate to the Policies tab and search for "Client Email" or browse to
GCP > Client Email. - In the
GCP > Client Emailpolicy page, click theSettingssubtab. - Click on the pencil icon next to the
GCP > Client Emailpolicy you intend to update.
GCP > Private Key:
- Navigate to the Policies tab and search for "Private Key" or browse to
GCP > Private Key. - In the
GCP > Private Keypolicy page, click theSettingssubtab. - Click on the pencil icon next to the
GCP > Private Keypolicy you intend to update. - Note: you will need to format the Key in a multi-line format. Example of the Key format can be found here.
Credential Verification:
After updating the credentials, Guardrails will automatically trigger the GCP > Project > CMDB control to verify
access to the Project. Successful credential updates should have the GCP > Project > CMDB control go into or stay in
an ok state.
Manual Verification: To manually verify if the credentials are functional:
- Visit the
Controlstab and navigate to theGCP > Project > CMDBpage. - Access the
Controlssubtab to view all Project CMDB controls. - Select the applicable GCP Project, choose
Actions, then click onRun controlto prompt Turbot Guardrails for a CMDB update.
If an error arises, consult the log for permission issues. If the status is OK, the credential update was successful. After you confirm the new credential is working as expected, you can remove the prior Service Account Key.