> ## Documentation Index
> Fetch the complete documentation index at: https://docs.contraforce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google SecOps Detection Module

> Connect Google SecOps to your workspace with a service account key, work its cases as incidents, manage rules, and search events. Every limitation is listed.

> [!NOTE]
>
> **Who is this for?** Workspace Owners and Security Engineers who manage a workspace that uses Google Security Operations (Google SecOps). This guide walks you through preparing Google Cloud and Google SecOps, configuring the module in ContraForce, and what the integration can and cannot do.

## Before You Begin

### What This Module Does

The Google SecOps Detection module connects a ContraForce workspace to a Google SecOps instance through the Chronicle API:

> [card] Incidents
>
> **Cases become incidents**
>
> * Checks Google SecOps for new cases about every 2 minutes
> * Creates a ContraForce incident for each case, with its alerts, entities and case wall
> * Closes and reopens the case in Google SecOps when you close or reopen the incident
> * Posts comments to the case and writes agent verdicts onto it

> [card] Rules and search
>
> **Detection content and events**
>
> * Lists, edits and retrohunts YARA-L detection rules on the **Google SecOps Rules** tab
> * Manages the alert grouping rules that decide how alerts become cases
> * Shows the events behind a case on the incident **Logs** tab
> * Lets Security Delivery Agents run UDM searches during an investigation

### What Syncs and What Stays in ContraForce

| Action | Where it applies |
| - | - |
| **Close** an incident in ContraForce | ContraForce, and the case is closed in Google SecOps |
| **Reopen** a closed incident in ContraForce | ContraForce, and the case is reopened in Google SecOps |
| A case is **closed** or **merged** in Google SecOps | The ContraForce incident closes |
| Set an open incident to **New** or **Active** | ContraForce only |
| Assign an **owner** | ContraForce only |
| Add a **comment** | ContraForce, and the comment is posted to the case |
| An agent finishes an investigation | ContraForce, and the verdict is written to the case as case properties |

Google SecOps has no "in progress" state, so **New** and **Active** are kept in ContraForce and the case stays open in Google SecOps. A ContraForce analyst is not a Google SecOps user, so the incident owner is kept in ContraForce and the case's assignee in Google SecOps doesn't change.

### Prerequisites

**1. SOAR migration Stage 1**

Your Google SecOps instance has completed Stage 1 of the SOAR migration to Google Cloud. Google serves cases through the Chronicle API only after Stage 1. In Google SecOps, go to **Settings > Administration > SOAR License Management**. Stage 1 is complete when **Google.com** appears next to the system version.

**2. Chronicle API enabled**

The Chronicle API is enabled in the Google Cloud project your Google SecOps instance is bound to.

**3. Google Cloud access**

Permission in that project to create service accounts, create service account keys and grant IAM roles.

**4. Google SecOps administrator access**

Access to **Group Mapping** in the Google SecOps settings.

**5. ContraForce workspace**

A ContraForce workspace with the Google SecOps detection module added, and your account assigned the workspace **Owner** role.

### What to Collect

| Value | Where to find it |
| - | - |
| **Project ID** | The ID of the Google Cloud project your Google SecOps instance is bound to, for example `acme-secops-prod`. It is 6 to 30 lowercase letters, digits and hyphens. |
| **Region** | The region of your Google SecOps instance. In the Google Cloud console, go to **Security > Detections and Controls > Google Security Operations > Instance details**. |
| **Instance ID** | The customer ID of your Google SecOps instance, a GUID. In Google SecOps, go to **Settings > Administration > Profile > Organization details**. |
| **SOAR environment** (optional) | The name of one SOAR environment, only when this workspace should see that environment's cases and nothing else. Leave it empty to connect the whole instance. |

***

## Step 1: Enable the Chronicle API

1. In the Google Cloud console, select the project your Google SecOps instance is bound to
2. Go to **APIs & Services** and click **Enable APIs and Services**
3. Search for **Chronicle API** and click **Enable**

***

## Step 2: Create a Service Account and a JSON Key

1. In the Google Cloud console, go to **IAM & Admin > Service Accounts** in the same project
2. Click **Create service account** and name it, for example `contraforce`
3. Open the service account, select the **Keys** tab, and click **Add key > Create new key**
4. Select **JSON** and click **Create**. Google downloads the key file

You need the **Service Account Key Admin** role (`roles/iam.serviceAccountKeyAdmin`) to create the key. A new key can take a minute or more before Google accepts it.

> [!WARNING]
>
> The key file grants access to your Google SecOps instance. Store it securely and delete your local copy once it is saved in ContraForce. ContraForce stores the key securely and never shows it again.

### If Your Organization Blocks Key Creation

Google Cloud organizations can block service account keys with the `iam.disableServiceAccountKeyCreation` or `iam.managed.disableServiceAccountKeyCreation` organization policy. Google enforces it by default for organizations created on or after May 3, 2024. If **Create new key** fails, ask your organization policy administrator to allow key creation for this project only. Google describes the steps in [Allow service account key creation](https://cloud.google.com/iam/docs/keys-create-delete#allow-creation).

The module needs a service account key. It doesn't support keyless sign-in such as Workload Identity Federation.

***

## Step 3: Grant the Service Account a Role

Grant the role on the project your Google SecOps instance is bound to. You have two options.

**Option 1: Predefined role.** Grant **Chronicle API Editor** (`roles/chronicle.editor`). It covers everything the module does except alert grouping rules. To manage alert grouping rules from ContraForce too, also grant a custom role with the three `chronicle.alertGroupingRules` permissions below.

**Option 2: Least privilege.** Create a custom role with the required permissions, and add the optional ones for the features you want.

### Required Permissions

These let ContraForce read cases, post comments, and close and reopen cases.

| Permission | Why ContraForce needs it |
| - | - |
| `chronicle.instances.get` | Tell a wrong instance ID apart from an instance that doesn't serve cases yet, when the connection test fails |
| `chronicle.cases.get` | List and read cases |
| `chronicle.caseAlerts.get` | Read a case's alerts |
| `chronicle.involvedEntities.get` | Read the entities in each alert |
| `chronicle.caseWallRecords.get` | Show the case wall on the incident **Comments** tab |
| `chronicle.caseComments.get` | Show the case's comments |
| `chronicle.caseComments.update` | Post comments to the case |
| `chronicle.caseCloseDefinitions.get` | Read the root causes your instance defines, which Google requires to close a case |
| `chronicle.cases.close` | Close the case when the incident is closed |
| `chronicle.cases.reopen` | Reopen the case when the incident is reopened |

### Optional Permissions

| Feature | Permissions |
| - | - |
| Agent verdicts written to the case | `chronicle.contextProperties.get`, `chronicle.contextProperties.update` |
| View detection rules | `chronicle.rules.list`, `chronicle.rules.get`, `chronicle.rules.listRevisions`, `chronicle.ruleDeployments.get`, `chronicle.ruleDeployments.list`, `chronicle.retrohunts.list` |
| Change detection rules and run retrohunts | `chronicle.rules.verifyRuleText`, `chronicle.rules.create`, `chronicle.rules.update`, `chronicle.rules.delete`, `chronicle.ruleDeployments.update`, `chronicle.retrohunts.create` |
| Alert grouping rules | `chronicle.alertGroupingRules.get`, `chronicle.alertGroupingRules.update`, `chronicle.alertGroupingRules.delete` |
| Related events and agent UDM search | `chronicle.events.udmSearch` |

Without an optional permission, everything else keeps working, and the feature shows a message naming the permission it needs.

***

## Step 4: Add the Service Account to SOAR Group Mapping

A service account needs a Group Mapping in Google SecOps as well as its IAM role. Without the mapping, Google refuses every case request, whatever role the service account has.

1. In Google SecOps, go to **Settings > Access Management > Group Mapping**. On a SOAR-only platform, go to **Settings > Advanced > Group Mappings**
2. Click **Add**
3. In **IdP / User group**, enter the service account's full email address, for example `contraforce@acme-secops-prod.iam.gserviceaccount.com`
4. Select a **permission group** and a **SOC role**
5. Select the **environments** the workspace should read. For a workspace connected to the whole instance, select every environment
6. Save the mapping

***

## Step 5: Configure the Module in ContraForce

1. In the ContraForce portal, go to **Workspaces** > your workspace > **Modules**
2. Find the **Google SecOps** card and click its settings (gear) icon, **Configure Google SecOps**
3. Fill in these fields:

| Field | Value |
| - | - |
| **Project ID** | The project ID from [What to Collect](#what-to-collect) |
| **Region** | The region of your instance |
| **Instance ID** | The instance's customer ID |
| **SOAR environment** | Leave empty for the whole instance, or enter one environment's name exactly as Google SecOps shows it |
| **Service account key** | Click **Choose key file** and select the JSON key from Step 2, or paste the file's content |

1. Click **Test connection**. The button changes to **Connection verified**, and ContraForce shows which service account Google accepted
2. Click **Configure and save**. ContraForce tests the connection again and saves only if it passes

**Configure and save** stays disabled until the test passes for the values in the form. If the test fails, see [Troubleshooting](#troubleshooting).

> [!NOTE]
>
> **The environment name is matched exactly, including upper and lower case.** A workspace connected to one environment sees only that environment's cases. Cases from other environments are never shown, and a case moved to another environment stops updating in ContraForce.

***

## Step 6: Verify End to End

**1. Wait for the first check**

ContraForce checks Google SecOps about every 2 minutes. On the first check it brings in the cases created in the last 24 hours, and new cases appear within a few minutes after that.

**2. Open an incident**

Open a Google SecOps incident. Its number starts with **GSO-**. The **Summary** tab shows the case's alerts, the **Entities** tab its entities, and the **Comments** tab its comments and case wall.

**3. Check the events**

On the **Logs** tab, the **Related events** section shows the events in Google SecOps that involve the case's entities.

**4. Check the rules**

Open **Detection Rules** for the workspace and select the **Google SecOps Rules** tab. Your instance's rules should be listed.

***

## How Cases Map to Incidents

### Priority

| Google SecOps priority | ContraForce severity |
| - | - |
| Critical | High |
| High | High |
| Medium | Medium |
| Low | Low |
| Info | Informational |
| Not set | Medium |

### Status and Classification

| Google SecOps | ContraForce |
| - | - |
| Open case | **New**, or **Active** if an analyst set it in ContraForce |
| Closed case | **Closed** |
| Merged case | **Closed**, with "This case was merged into another case in Google SecOps." in the description |

When you close an incident, ContraForce closes the case with the close reason that matches the classification, the first root cause your instance defines for that reason, and your closing comment. When a case is closed in Google SecOps, the incident takes the matching classification.

| ContraForce classification | Google SecOps close reason |
| - | - |
| True Positive | Malicious |
| False Positive | Not malicious |
| Benign Positive | Maintenance |
| Undetermined, or none | Inconclusive |

Reopening an incident reopens the case with the comment "Reopened in ContraForce by" and your name. The case's stage and tags are shown in the incident description.

***

## Comments and Agent Verdicts

Comments you add in ContraForce are posted to the case in Google SecOps. Google shows them under the workspace's service account, and ContraForce adds a last line, "Posted from ContraForce by" and your name. ContraForce hides that line when it shows the comment and names you as the author.

The **Comments** tab also shows the case wall, such as merges, tag and SLA changes and playbook activity, as read-only entries.

When a Security Delivery Agent finishes an investigation, ContraForce writes its verdict to the case as case properties: `contraforce-verdict`, `contraforce-verdict-reason`, `contraforce-malicious-score`, `contraforce-summary`, `contraforce-agent`, `contraforce-run-id` and `contraforce-verdict-time`. A later investigation updates the same properties. If Google refuses the write, the investigation still completes and its result says the verdict was not written.

***

## Manage Detection Rules

The **Google SecOps Rules** tab on the workspace **Detection Rules** page lists your instance's YARA-L rules with their type, severity, last save and status. Open a rule to see its text, how often it runs, its revisions and its retrohunts.

Users with the workspace **Owner** or **Content Admin** role can:

* **Create** and **edit** rules in the YARA-L 2.0 editor, and **Check** a rule before saving. A rule is saved only if it compiles
* **Enable** or **disable** a rule, and turn **alerting** on or off
* **Archive** a disabled rule, or **restore** an archived one
* **Delete** a rule that has no detections or retrohunts
* **Run a retrohunt** over past days and follow its progress

Changes are made directly in Google SecOps.

## Manage Alert Grouping Rules

The **Alert grouping rules** card on the Google SecOps module page shows how your instance groups alerts into cases. Each rule applies to all alerts or to chosen alert types, products or data sources, and groups by shared entities, by the source grouping identifier, or not at all.

Users with the workspace **Owner** role can add, edit and delete rules. Grouping rules apply to the whole instance, so a change regroups cases for every environment.

## Related Events and UDM Search

The **Related events** section of the incident **Logs** tab searches Google SecOps for events that involve the case's hosts, IP addresses, users, file hashes, domains and URLs. It searches from the first alert's start to the last alert's end, with 15 minutes added on each side. The events are fetched from Google SecOps each time you open the tab and are not stored in ContraForce.

Security Delivery Agents can run their own UDM searches during an investigation. They write queries in YARA-L 2.0 syntax over Unified Data Model fields, not KQL.

***

## Limitations

### Setup

* **Service account key required**: the module signs in with a JSON service account key. Organizations that block key creation need an exception for the project, and keyless sign-in such as Workload Identity Federation is not supported
* **SOAR migration**: cases are available only after SOAR migration Stage 1, and the service account needs a SOAR Group Mapping as well as its IAM role
* **Changing the configuration**: the key is never shown again, so changing any field, such as the environment, means choosing the key file again
* **Environment name**: matched exactly, including upper and lower case

### Cases and Incidents

* **Polling delay**: cases arrive by polling about every 2 minutes, so a new case can take a few minutes to appear
* **Earlier cases**: the first check brings in cases created in the last 24 hours. Older cases are not imported. Changing the project, region, instance or environment starts over the same way
* **Very busy instances**: one check reads up to about 2,000 new cases. If more are created between two checks, the oldest of them are skipped
* **Closures made in Google SecOps**: ContraForce reads up to 50 open cases again on each check to find closures and merges, so with many open cases a closure can take several checks to show. Only the 1,000 most recent open cases are followed; a closure of an older open case is not picked up
* **Critical priority** is shown as **High**
* **Merged cases** are shown as **Closed**
* **Alerts per case**: Google SecOps holds at most 90 alerts in a case and moves further alerts into another case, which comes into ContraForce as its own incident
* **Entities**: up to 2,000 entities are shown for a case, flagged entities first
* **Fields you can change**: ContraForce changes only a case's status. Its stage, priority, tags and assignee are changed in Google SecOps
* **No "in progress" in Google SecOps**: **New** and **Active** are kept in ContraForce, and the case stays open in Google SecOps
* **Owner**: kept in ContraForce. The case's assignee in Google SecOps, a Google SecOps user or SOC role, doesn't change
* **Closing a case**: ContraForce sends the first root cause your instance defines for the close reason. If your instance defines none for that reason, the close is refused until you add one in Google SecOps
* **Link to Google SecOps**: an incident has no link that opens the case in Google SecOps. Alerts show the alert, rule and source system links Google provides
* **Related incidents**: the entity search for related incidents is not available for Google SecOps incidents
* **Entity insights**: sign-in logs, audit logs, device timelines and the other entity insights are not available for Google SecOps entities
* **Incident email notifications**: ContraForce doesn't send email notifications for new Google SecOps incidents. Gamebook activity notifications are sent as for any module

### Comments

* **Add and read only**: comments can be added and read, not edited or deleted, from ContraForce
* **Author**: comments are posted under the workspace's service account, with your name in the comment text
* **Deleted comments**: comments deleted in Google SecOps are not shown
* **How many**: the **Comments** tab shows up to 200 comments and 200 case wall entries for a case

### Agent Verdicts

* **Best effort**: if the verdict can't be written, the investigation still completes and its result says so
* **Case properties**: nothing is written to a case that already holds more than 1,000 case properties

### Detection Rules and Alert Grouping Rules

* **Whole instance only**: detection rules and alert grouping rules belong to the whole instance. A workspace connected to one environment shows them but can't change them
* **Revisions**: revisions can be read, not compared side by side
* **Run frequency**: shown, not changed, from ContraForce
* **Delete**: a rule with detections or retrohunts can't be deleted; archive it instead
* **Rule count**: up to 2,000 rules are listed. Search Google SecOps for the rest
* **Retrohunts**: cover whole days in UTC, the last day stopping at the current time, and only past events
* **Grouping rules**: rule order, the grouping time window and the number of alerts per case can't be set, because the Chronicle API doesn't offer them

### Search

* **Whole instance only**: event search reads the whole instance, so a workspace connected to one environment can't search, on the **Logs** tab or by an agent
* **Log Search page**: the portal's **Log Search** page doesn't query Google SecOps
* **Related events**: the search covers up to 20 of the case's entities, shows up to 200 events and spans at most 30 days. When more events match, the section says so and shows the first ones
* **Agent searches**: return up to 100 events and span at most 30 days
* **Search allowance**: each workspace can run 10 searches in a row, then one more each minute
* **Google's limits**: Google returns at most 10,000 events per search, and events past your instance's retention aren't found

### Response Actions

* **Endpoint actions**: Gamebook actions that act on a device, such as isolating a device, releasing it, running an antivirus scan or quarantining a file, can't run on a Google SecOps incident. The run is refused with a message that endpoint Gamebook permissions are not consented
* **Other actions**: user, email and IP blocking actions run through the workspace's Microsoft Entra ID, Microsoft 365 and Azure network connections, and Defender indicator actions through Defender for Endpoint, when those are set up. Google SecOps itself runs no response actions for ContraForce

### Rate Limits

* **Shared quota**: Google applies its quota to the Google Cloud project. When Google answers that the project is over its quota, ContraForce pauses every call for that project, for every workspace that uses it, for up to 15 minutes

***

## Rotate the Service Account Key

1. In the Google Cloud console, create a new JSON key for the service account, as in [Step 2](#step-2-create-a-service-account-and-a-json-key)
2. In ContraForce, open **Configure Google SecOps**, click **Choose key file** and select the new key
3. Click **Test connection**, then **Configure and save**
4. In the Google Cloud console, delete the old key

The old key keeps working in ContraForce until the new one is saved.

***

## Troubleshooting

| Issue | Likely cause | Fix |
| - | - | - |
| Test connection: Google refused the service account key | The service account or the key was deleted or disabled, or the key is new | Check the service account and key in the Google Cloud console, wait a minute after creating a key, or create a new JSON key |
| Test connection: Google SecOps refused the service account (401) | The service account is not in SOAR Group Mapping | Add the service account's email under Group Mapping, as in [Step 4](#step-4-add-the-service-account-to-soar-group-mapping) |
| Test connection: did not let the service account read cases (403) | The service account has no role that can read cases | Grant the role from [Step 3](#step-3-grant-the-service-account-a-role) on the project |
| Test connection: no instance with that instance ID | The project ID, region or instance ID is wrong | Check all three. The instance ID is the customer ID of your Google SecOps instance |
| Test connection: the instance was found, but it does not serve cases yet | SOAR migration Stage 1 is not complete | Complete Stage 1. **SOAR License Management** shows **Google.com** when it is |
| Test connection: found no cases for that instance (404) | The project ID, region or instance ID is wrong, or Stage 1 is not complete, and the service account can't read the instance to tell which | Check the three values and Stage 1, or grant `chronicle.instances.get` for a clearer message |
| Test connection: Google is rate limiting requests for this project | The project is over its Chronicle API quota | Try again in a few minutes |
| No incidents appear after 15 minutes | No cases were created since the module was configured, or the environment name doesn't match | Confirm a case was created recently, and check the **SOAR environment** value letter by letter |
| Closing an incident fails: no root cause for the close reason | Your instance defines no root cause for that close reason | Add a root cause for it in Google SecOps, then close the incident again |
| A comment, close, verdict, rule or search fails with a permission message | The service account lacks an optional permission | Grant the permission the message names, from [Step 3](#step-3-grant-the-service-account-a-role) |
| "This workspace is connected to one Google SecOps environment" | Rules and search need a workspace connected to the whole instance | Make the change, or search, from a workspace connected to the whole instance |
| "The workspace's saved service account key could not be used" | The saved key no longer works | Save the key again in **Configure Google SecOps** |
| "This workspace has run its share of Google SecOps searches for now" | The workspace used its search allowance | Try again in a minute |

***

## Related Documentation

> [card] [Incident Management](https://docs.contraforce.com/guides/getting-started/incident-management.md)
>
> Triage and resolve incidents in ContraForce

> [card] [Roles and Permissions](https://docs.contraforce.com/guides/general-support/roles-and-permissions-reference.md)
>
> Detailed role reference for ContraForce users

***

> [!NOTE]
>
> Questions about connecting Google SecOps to ContraForce? Contact us at [support@contraforce.com](mailto:support@contraforce.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.