|
| 1 | +export default { |
| 2 | + id: 'gcp-cis-1.3.0-2.13', |
| 3 | + title: |
| 4 | + 'GCP CIS 2.13 Ensure Cloud Asset Inventory Is Enabled', |
| 5 | + description: `GCP Cloud Asset Inventory is services that provides a historical view of GCP resources and |
| 6 | +IAM policies through a time-series database. The information recorded includes metadata |
| 7 | +on Google Cloud resources, metadata on policies set on Google Cloud projects or resources, |
| 8 | +and runtime information gathered within a Google Cloud resource.`, |
| 9 | + audit: `**From Console: |
| 10 | +
|
| 11 | + Ensure that the Cloud Asset API is enabled:** |
| 12 | +
|
| 13 | + 1. Go to API & Services/Library by visiting |
| 14 | + https://console.cloud.google.com/apis/library |
| 15 | + 2. Search for Cloud Asset API and select the result for Cloud Asset API |
| 16 | + 3. Ensure that API Enabled is displayed. |
| 17 | +
|
| 18 | + **From Command Line: |
| 19 | +
|
| 20 | + Ensure that the Cloud Asset API is enabled:** |
| 21 | +
|
| 22 | + 1. Query enabled services: |
| 23 | +
|
| 24 | + gcloud services list --enabled --filter=name:cloudasset.googleapis.com |
| 25 | +
|
| 26 | + If the API is listed, then it is enabled. If the response is Listed 0 items the API is not enabled.`, |
| 27 | + rationale: 'The GCP resources and IAM policies captured by GCP Cloud Asset Inventory enables security analysis, resource change tracking, and compliance auditing.', |
| 28 | + remediation: `**From Console: |
| 29 | +
|
| 30 | + Enable the Cloud Asset API:** |
| 31 | +
|
| 32 | + 1. Go to API & Services/Library by visiting |
| 33 | + https://console.cloud.google.com/apis/library |
| 34 | + 2. Search for Cloud Asset API and select the result for Cloud Asset API |
| 35 | + 3. Click the ENABLE button. |
| 36 | +
|
| 37 | + **From Command Line: |
| 38 | +
|
| 39 | + Enable the Cloud Asset API:** |
| 40 | +
|
| 41 | + 1. Enable the Cloud Asset API through the services interface: |
| 42 | +
|
| 43 | + gcloud services enable cloudasset.googleapis.com |
| 44 | +
|
| 45 | + **Default Value:** |
| 46 | + |
| 47 | + The Cloud Asset Inventory API is disabled by default in each project |
| 48 | +`, |
| 49 | + references: ['https://cloud.google.com/asset-inventory/docs'], |
| 50 | + gql: `{ |
| 51 | + querygcpProject { |
| 52 | + id |
| 53 | + __typename |
| 54 | + assets { |
| 55 | + id |
| 56 | + } |
| 57 | + } |
| 58 | + }`, |
| 59 | + resource: 'querygcpProject[*]', |
| 60 | + severity: 'unknown', |
| 61 | + check: ({ resource }: any) => { |
| 62 | + const { assets } = resource |
| 63 | + return !!assets |
| 64 | + }, |
| 65 | +} |
0 commit comments