Cloud Asset Inventory should be enabled in every project
This check looks at whether the Cloud Asset API is enabled in your projects. The safe setting is that Cloud Asset Inventory is on, so you can list and search your resources and their access policies at any time.
Why it matters
You cannot protect resources you do not know about. Cloud Asset Inventory keeps a searchable view of resources and IAM policies and a history of how they changed. When something unexpected shows up, such as a public bucket or a forgotten service account, it helps you find out what exists and what changed.
Google describes the service in Cloud Asset Inventory overview. It depends on the Cloud Asset API being enabled in the project.
How to check it yourself
In the console open APIs and services, then Enabled APIs and services, and look for Cloud Asset API. This command only reads the list of enabled services:
gcloud services list --enabled --project=PROJECT_ID \
--filter="config.name:cloudasset.googleapis.com"One row in the output means the API is enabled. No output means it is not, and the check fails for that project. Try it on a test project first.
How to fix it
In the console, open the Cloud Asset API page in the API library and choose Enable. You need a role that may enable services, for example Service Usage Admin.
Scripted version. It changes your project, so ConfigCobra never runs it for you:
gcloud services enable cloudasset.googleapis.com --project=PROJECT_IDAfter that you can search assets, for example with gcloud asset search-all-resources --scope=projects/PROJECT_ID. See the gcloud services enable reference.
Because the API is enabled per project, new projects start without it. Add the step to your project creation routine, or enable it through the same automation that sets up your other baseline services, so that no project is left out.
What changes when you fix it
No running workload changes. Enabling an API adds a capability, it does not alter existing resources, and nothing needs a restart. The people affected are the platform and security teams who gain the search and history.
- Anyone with an asset viewer role can now see an overview of resources and policies, so grant those roles with care.
- Tools that read the inventory, including read-only assessment tools using a viewer-level service account, can use it.
- If your organization restricts which APIs may be enabled, an organization policy may block this and you will need an exception.
Decide which team owns the inventory and who gets viewer access, then enable it project by project or through your usual automation.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Google Cloud Platform Foundation v5.0.0 | 2.14 | Level 1 |
More checks in Logging and Monitoring
- Configure Cloud Audit Logging across all services and usersCIS 2.1
- Enable Workspace/Cloud Identity data sharing for admin audit loggingCIS 2.2
- Configure sinks to export copies of all log entriesCIS 2.3
- Apply Bucket Lock retention policies to log-export storage bucketsCIS 2.4
- Alert on project-ownership assignments/changes via log metric filterCIS 2.5
Go further
- Logging and Monitoring17 controls in this section
- CIS Google Cloud Platform Foundation v5.0.093 controls
- CIS Google Cloud Platform Foundation checklistEvery control in one list, as CSV
- RemediationSee what a fix changes in your tenant before you apply it, then use the generated script
- Monitoring & DriftScheduled scans, drift detection and email alerts when a control regresses
Check this on your Google Cloud
ConfigCobra runs this check with every other control of the CIS Google Cloud Platform Foundation Benchmark, read-only.