# NG SIEM - GCP CSPM Integration

<span style="color: rgb(0, 0, 0);">The Google Cloud integration collects and parses **Google Cloud** **Audit Logs**, **VPC Flow Logs**, **Firewall Rules Logs,** and **Cloud DNS** **Logs** that have been exported from **Cloud Logging** to a **Google Pub/Subtopic sink** and collects **Google Cloud** **metrics** and metadata from **Google Cloud Monitoring.**</span>

#### <span style="color: rgb(53, 152, 219);">**Logs**</span>

- <span style="color: rgb(0, 0, 0);">**<span style="color: rgb(52, 73, 94);">Firewall Logs</span>:** Record allowed and denied network traffic based on firewall rules.</span>
- <span style="color: rgb(0, 0, 0);">**<span style="color: rgb(52, 73, 94);">VPC Flow Logs</span>:** Capture IP traffic flowing to and from network interfaces in a VPC.</span>
- <span style="color: rgb(0, 0, 0);">**<span style="color: rgb(52, 73, 94);">DNS Logs</span>:** Track DNS queries and responses handled by Google Cloud DNS.</span>
- <span style="color: rgb(0, 0, 0);">**<span style="color: rgb(52, 73, 94);">Load Balancing Logs</span>:** Provide request-level logs of traffic handled by load balancers, including latency and backend info.</span>

#### <span style="color: rgb(53, 152, 219);">**Metrics**</span>  


- **GCP Billing Metrics**: Track resource usage and cost across GCP services.
- **GCP Compute Metrics**: Monitor performance of Compute Engine instances (CPU, memory, disk, etc.).
- **GCP Firestore Metrics**: Provide insights into Firestore usage like reads, writes, and storage.
- **GCP Load Balancing Metrics**: Measure load balancer traffic, request counts, latency, and backend health.
- **GCP Storage Metrics**: Report usage, operation counts, and latency for Cloud Storage buckets.
- **GCP GKE Metrics**: Monitor Kubernetes clusters including node health, pod usage, and resource consumption.
- **GCP Dataproc Metrics**: Track job status, cluster usage, and Hadoop/Spark performance in Dataproc.
- **GCP PubSub Metrics**: Show message throughput, subscription rates, and processing latency.
- **GCP Redis Metrics**: Display memory usage, operations per second, and cache hit/miss rates for Memorystore Redis.
- **GCP Cloud Run Metrics**: Measure request counts, container instance metrics, and response times.
- **GCP CloudSQL Metrics**: Provide visibility into database performance, including connections, query latency, and CPU usage.

---

#### <span style="color: rgb(53, 152, 219);">**Authentication**</span>

<span style="color: rgb(0, 0, 0);">To use the **Google Cloud Platform (GCP)** integration, the client must configure a **Service Account (SA)** that represents a non-human identity requiring access to **GCP** resources.  
</span>

#### <span style="color: rgb(0, 0, 0);"><span style="color: rgb(53, 152, 219);">**Service Account**</span></span>

First, you need to [create a Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts). A Service Account (SA) is a particular type of Google account intended to represent a non-human user who needs to access the GCP resources.

The AQUILA Agent uses the SA to access data on Google Cloud Platform using the Google APIs.

#### **<span style="color: rgb(53, 152, 219);">IAM Service Account Roles  
</span>**

##### **<span style="color: rgb(53, 152, 219);">For CSPM-GCP Integration</span>**

- <span style="color: rgb(0, 0, 0);">**Browser:** Access to browse GCP resources.</span>
- <span style="color: rgb(0, 0, 0);">**Cloud Asset Viewer:** Read only access to cloud assets metadata</span>

#### **<span style="color: rgb(53, 152, 219);">Logs Collection Configuration</span>**

The **Logs Collection Configuration** defines how log data is exported, transmitted, and processed within the system. It enables seamless integration between **Cloud Logging** and other Google Cloud services to ensure logs are efficiently collected, stored, and made available for analysis or monitoring.

**<span style="color: rgb(53, 152, 219);">Requirements</span>**

- **Pub/Sub Topic:** A **Pub/Sub topic** is a messaging channel that allows publishers to send messages asynchronously to multiple subscribers without them needing to know each other.
- **Subscription:** Subscriptions are named resources that receive messages on a particular topic. A subscriber client receives messages from a subscription and processes them.
- **Log Sink:** A log sink is a configuration that routes log entries from **Cloud Logging** to a chosen destination — such as **Cloud Storage**, **BigQuery**, or a **Pub/Sub topic** — for storage, analysis, or further processing.

<p class="callout info"><span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW124724174 BCX0">It’s</span><span class="NormalTextRun SCXW124724174 BCX0"> </span><span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW124724174 BCX0">recommend</span><span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW124724174 BCX0">ed</span> <span class="NormalTextRun SCXW124724174 BCX0">to have </span><span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW124724174 BCX0">a </span><span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW124724174 BCX0">separate</span><span class="NormalTextRun SCXW124724174 BCX0"> Pub/</span><span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW124724174 BCX0">Sub topics</span><span class="NormalTextRun SCXW124724174 BCX0"> for each of the log types so that they can be parsed and stored in a specific data stream.</span></span><span class="EOP SCXW124724174 BCX0" data-ccp-props="{"134233117":false,"134233118":false,"335551550":1,"335551620":1,"335559685":0,"335559738":0,"335559739":0}"> </span></p>

---

#### **<span style="color: rgb(53, 152, 219);">Example Setup Using Google Cloud Console</span>**

1. Navigate to **"Logging" &gt; "Log Router" &gt; "Create Sink"**.
2. Provide a **Sink name** and description.
3. For **Sink destination**, select **"Cloud Pub/Sub topic"**. Choose an existing topic or create a new one.
4. If a new topic is created, you must also **create a subscription** for it.
5. Under **"Choose logs to include in sink"**, use a filter like: logName:"cloudaudit.googleapis.com"

#### **<span style="color: rgb(53, 152, 219);">Enable API Service</span>**  


The client can enable their API through the **APIs &amp; Services** section. To access it, click the **☰ (navigation menu)** icon to open the **sidebar**, then hover over **APIs &amp; Services** and select **Enabled APIs &amp; Services**. Alternatively, the client can locate it using the **search bar** at the top of the page. Next, click **Library**, search for the required API services, and enable them.

- **Cloud Asset API:** Provides metadata inventory and history of GCP resources and IAM policies for security analysis, audit, and compliance.
- **Cloud SQL Admin API:** Enables programmatic management of Cloud SQL instances, including creation, configuration, and backups.
- **Memorystore for Redis API:** Allows automated management of Redis instances on Memorystore, including provisioning, scaling, and configuration.

---

#### **<span style="color: rgb(53, 152, 219);">Service Account Key</span>**

1. Go to **IAM &amp; Admin &gt; Service Accounts** in the GCP Console.
2. Click the service account you created.
3. Under the **"Keys"** section, click **"Add Key" &gt; "Create new key"**.
4. Choose **JSON** as the key type.
5. **Download and securely store** the generated private key (it cannot be retrieved again from GCP if lost).

<p class="callout danger">**Please provide the following information to CyTech:**</p>

- <span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US">**<span class="NormalTextRun SCXW124724174 BCX0">Project </span>**<span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW124724174 BCX0">**ID** -</span> </span><span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW124724174 BCX0">The Project ID is the Google Cloud project ID where your resources exist. </span></span>
- <span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW124724174 BCX0">**Credentials File** - </span></span><span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW124724174 BCX0">Save the JSON file with the private key in a secure location of the file system, and make sure that the Log Collector Agent has at least read-only privileges to this file.</span><span class="NormalTextRun SCXW124724174 BCX0"> </span></span><span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW124724174 BCX0">Specify the file path in the Log Collector Agent integration UI in the "Credentials File" field. For example: /home/ubuntu/</span><span class="NormalTextRun SpellingErrorV2Themed SCXW124724174 BCX0">credentials.json</span><span class="NormalTextRun SCXW124724174 BCX0">.</span></span>
- <span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US">**<span class="NormalTextRun SCXW124724174 BCX0">Pub/</span><span class="NormalTextRun SCXW124724174 BCX0">Sub Topic</span>**<span class="NormalTextRun SCXW124724174 BCX0"> </span><span class="NormalTextRun SCXW124724174 BCX0">- </span></span><span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW124724174 BCX0">Name of the topic where the logs are written to.</span></span>
- <span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US">**<span class="NormalTextRun SCXW124724174 BCX0">Subscription</span>**<span class="NormalTextRun SCXW124724174 BCX0"> - </span></span><span class="TextRun SCXW124724174 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW124724174 BCX0">Use the short subscription name here, not the full-blown path with the project ID. You can find it as "Subscription ID" on the Google Cloud Console.</span></span><span class="EOP SCXW124724174 BCX0" data-ccp-props="{"134233117":false,"134233118":false,"335551550":0,"335551620":0,"335559738":240,"335559739":240}"> </span>

*<span class="TextRun SCXW71272603 BCX0" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW71272603 BCX0">If you need further </span><span class="NormalTextRun SCXW71272603 BCX0">assistance</span><span class="NormalTextRun SCXW71272603 BCX0">, kindly contact </span></span>**<span class="TextRun SCXW71272603 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW71272603 BCX0">support@cytechint.com</span></span>**<span class="TextRun SCXW71272603 BCX0" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW71272603 BCX0"> for prompt </span><span class="NormalTextRun SCXW71272603 BCX0">assistance</span><span class="NormalTextRun SCXW71272603 BCX0"> and guidance.</span></span><span class="EOP SCXW71272603 BCX0" data-ccp-props="{}"></span>*