Skip to main content

Google SecOps

Connect your Google Security Operations (Google SecOps, formerly Chronicle) instance to Huntbase. One connection lets you:

  • Search it. Write UDM search in a query tab, or sweep it for indicators with STIX patterns. Scout and hunts can search it too.
  • Bring in its alerts. Alerts from your SecOps rules and Google's curated detections become insights in Huntbase, in Needs you by default.
  • Deploy watchers to it. Huntbase converts a Sigma watcher into a YARA-L rule and creates it in SecOps. The rule's detections come back to Huntbase.
  • Send endpoint data to it. Huntbase can send the results of your endpoints' scheduled queries to SecOps.

Searching and alerts need only read access. Rule writing and sending data each need their own credential, so you grant them only if you use them.

Before you start​

You need:

  • the region, Google Cloud project and customer ID of your SecOps instance;
  • a Google Cloud service account with the right role, and a JSON key for it. The setup script below creates these for you.

You need to be able to manage IAM in the Google Cloud project linked to SecOps.

Find your instance details​

In Google SecOps, go to Settings › SIEM Settings › Profile.

Huntbase fieldWhere to find it
SecOps customer IDCustomer ID on the Profile page. It looks like b245fb57-a6fe-….
Google Cloud projectThe Google Cloud project linked to your SecOps instance. Enter its project ID (my-secops-project) or project number (123456789012).
RegionWhere your instance stores data: us, eu, or a Google Cloud region such as europe-west2 (London). It is the first part of your instance's API address, https://<region>-chronicle.googleapis.com.

If you're not sure of the project or region, ask whoever set up SecOps for your organization. Google links the project when it provisions the instance.

Set up access with the script​

One script does all the Google Cloud setup. Open Google Cloud Shell as someone who can manage IAM in the project linked to SecOps, and run:

curl -fsSLO https://docs.huntbase.io/scripts/google-secops-setup.sh
bash google-secops-setup.sh --project my-secops-project

It is safe to run again: each step checks what already exists. It:

  1. checks the Chronicle API is enabled in the project;

  2. creates or updates the custom role Huntbase SecOps rule writer (huntbaseSecOpsRuleWriter): the permissions of Chronicle API Editor (roles/chronicle.editor) plus chronicle.rules.delete, so Huntbase can remove the rules it created;

  3. creates two service accounts:

    AccountRoleUse it for
    huntbase-readerChronicle API Viewer (roles/chronicle.viewer)The connection's main key: searching, collecting alerts, checking the connection
    huntbase-writerHuntbase SecOps rule writer (custom)The Rule writing and Send data credentials
  4. creates a JSON key for each account, huntbase-reader-key.json and huntbase-writer-key.json, in the current folder;

  5. prints what to enter in Huntbase.

OptionWhat it does
--read-onlyCreates only the reader account. Add the writer later by running the script again without it.
--no-keysCreates the accounts and roles but no keys.
--prefix <name>Names the accounts <name>-reader and <name>-writer. Defaults to huntbase.
--dry-runPrints every change instead of making it. Use it to review the commands first.

Read the script before you run it if your team reviews changes to IAM.

Keep the keys safe

The JSON files are passwords. Upload them only into Huntbase, then delete them from Cloud Shell. Huntbase stores them encrypted and never shows them again.

If your organization blocks service-account keys​

Many organizations turn on the organization policy Disable service account key creation (iam.disableServiceAccountKeyCreation). The script detects it, skips the keys and prints the command that allows keys in the SecOps project only. An Organization Policy Administrator runs it:

gcloud resource-manager org-policies disable-enforce \
iam.disableServiceAccountKeyCreation --project my-secops-project

The change takes a few minutes to apply. Until it does, key creation fails with FAILED_PRECONDITION. Then run the script again. The policy stays on for the rest of your organization. Rotate the keys regularly and delete them if you remove the connection.

Set up access by hand instead

Create one service account per purpose:

PurposeIAM roleNeeded for
Read (required)Chronicle API Viewer (roles/chronicle.viewer)Searching, collecting alerts, reading rules, checking the connection
Rule writing (optional)Huntbase SecOps rule writer (custom role below)Deploying watchers as YARA-L rules
Send data (optional)Huntbase SecOps rule writer, or Chronicle API Editor (roles/chronicle.editor)Sending endpoint data to SecOps

Chronicle API Editor can't delete rules, so a rule-writing account with only that role leaves rules behind when you remove a watcher deployment. The custom role adds chronicle.rules.delete:

PROJECT=my-secops-project

# Custom role: Chronicle API Editor + chronicle.rules.delete
PERMS=$(gcloud iam roles describe roles/chronicle.editor \
--format='value(includedPermissions)' | tr ';' ',')
gcloud iam roles create huntbaseSecOpsRuleWriter --project "$PROJECT" \
--title "Huntbase SecOps rule writer" \
--permissions "$PERMS,chronicle.rules.delete" --stage GA

If gcloud says a permission isn't supported in custom roles, remove it from the list and try again. The script does this for you.

# Reader (required)
gcloud iam service-accounts create huntbase-reader \
--project "$PROJECT" --display-name "Huntbase (read)"
gcloud projects add-iam-policy-binding "$PROJECT" \
--member "serviceAccount:huntbase-reader@$PROJECT.iam.gserviceaccount.com" \
--role roles/chronicle.viewer --condition=None
gcloud iam service-accounts keys create huntbase-reader-key.json \
--iam-account "huntbase-reader@$PROJECT.iam.gserviceaccount.com"

# Writer (optional): rule writing and sending data
gcloud iam service-accounts create huntbase-writer \
--project "$PROJECT" --display-name "Huntbase (rule writing, send data)"
gcloud projects add-iam-policy-binding "$PROJECT" \
--member "serviceAccount:huntbase-writer@$PROJECT.iam.gserviceaccount.com" \
--role "projects/$PROJECT/roles/huntbaseSecOpsRuleWriter" --condition=None
gcloud iam service-accounts keys create huntbase-writer-key.json \
--iam-account "huntbase-writer@$PROJECT.iam.gserviceaccount.com"

In the Google Cloud console: IAM & Admin › Roles › Create role for the custom role, IAM & Admin › Service accounts › Create service account for each account, then Keys › Add key › Create new key › JSON.

Connect Google SecOps​

  1. Go to Connections and click New connection.
  2. On Product, search for Google SecOps (or "Chronicle") and choose the Owner. The product is listed as Google Security Operations.
  3. On Details, give the connection a Name and, optionally, a Description.
  4. On Connect, fill in the fields below.
  5. On Verify, review the summary and click Create & check. Huntbase signs in and reads one rule to check access.

Settings​

FieldRequiredNotes
RegionYesPick your region from the list, such as United States (multi-region), Europe (multi-region) or London, or type its code.
Google Cloud projectYesThe linked Google Cloud project's ID or number.
SecOps customer IDYesThe Customer ID from Settings › SIEM Settings › Profile.
API versionNoUnder Advanced. Leave it at v1alpha unless Huntbase support asks you to change it.

Credentials​

The Method is Service account key. For Service account key (JSON), upload the reader's key (huntbase-reader-key.json), or paste its contents. Huntbase checks that it is a service-account key before you save. It is a secret: it isn't shown again after you save it.

To add Rule writing or Send data, open the connection and add a credential for that purpose with the writer's key (huntbase-writer-key.json). Each one shows the IAM role it needs. Searches never use these credentials, and neither can become the connection's default.

For everything else on the setup page, see Connections.

Search Google SecOps​

Pick UDM search in a query tab and write the query as you would in SecOps. Huntbase sends it as written and bounds it with the time-range pill. A search returns at most 10,000 events.

metadata.event_type = "NETWORK_CONNECTION" AND target.ip = "198.51.100.66"
metadata.event_type = "PROCESS_LAUNCH" AND target.process.command_line = /-enc/ nocase

Grouped fields search every field of one kind at once: ip = "198.51.100.66", hostname = "wks-01", domain = "example.org", hash = "<sha256>" or user = "jsmith". Strings are double-quoted, /…/ is a regular expression and nocase ignores case.

The Google SecOps product comes with starter queries in Library › Queries, for example failed sign-ins and encoded command lines.

Each event comes back as one row, with UDM fields as columns such as principal.hostname and target.ip. Results join the rest of your hunt: entities, the graph and Scout all see them.

Scout can write UDM search for you when you ask in Auto, and hunts, watcher look-backs and intel sweeps search SecOps when the connection is in scope.

See Query languages.

STIX patterns​

STIX patterns work on SecOps too. Huntbase translates the pattern into UDM search, so an indicator sweep across all your sources includes SecOps. Searching never creates rules in your instance.

[ipv4-addr:value = '198.51.100.66'] OR [domain-name:value = 'update-check.bad-actor.example']

Bring in SecOps alerts​

Huntbase collects alerts from your SecOps instance every few minutes. That includes alerts from your own rules and from Google's curated detections, not only rules Huntbase deployed. Each alert becomes an insight with its severity, rule, ATT&CK techniques and the hosts, users and addresses involved, and links back to the alert in SecOps.

The connection's Alert ingest setting controls this:

SettingWhat happens
On, handled in Needs you (default)Each alert opens in Needs you for your team to triage.
On, Record onlyHuntbase records each alert as an insight, but asks no one to review it. Use this when your team triages in SecOps.
OffHuntbase doesn't collect alerts.

Alert collection uses the read credential. Data from SecOps stays in your organization in Huntbase.

Deploy watchers as YARA-L rules​

A Sigma watcher can run inside SecOps as a YARA-L rule. On the watcher's Deploy tab, select Push to Google SecOps on your SecOps connection's line. Huntbase converts the watcher to YARA-L over UDM fields, creates the rule in SecOps and turns it on. A new push starts in Shadow. See Push rules into your SIEM or log store.

  • The connection needs a Rule writing credential.
  • The rule is named hb_<watcher>_<id>, and its description starts with a Huntbase marker. Leave the marker in place: Huntbase uses it to recognise its rules.
  • SecOps runs the rule on its own schedule. Huntbase picks the closest SecOps run frequency to the watcher's schedule: live, hourly or daily.
  • Shadow turns the rule on with alerting off. On turns alerting on. Off turns the rule off and keeps it.
  • When you edit the watcher, Huntbase updates the rule. If someone edits or deletes it in SecOps, the deployment shows the drift and Re-push puts the Huntbase version back.
  • The rule's detections come back through alert collection and are linked to the watcher.

Send endpoint data to SecOps​

Huntbase can send the results of your endpoints' scheduled queries to SecOps, as it does for Axiom. Turn it on per connection: on the connection page, under How will you use it?, choose Send scheduled results to it or Both.

  • The connection needs a Send data credential.
  • Huntbase sends results as osquery logs (log type OSQUERY_EDR), so SecOps' own parser turns them into UDM events.
  • Results from shared fleets are never sent.

In SecOps, find them with a UDM search such as metadata.log_type = "OSQUERY_EDR".

Troubleshooting​

What you seeLikely causeFix
403 or "permission denied"The service account is missing the role for what Huntbase tried to do.Grant roles/chronicle.viewer to the reader, or the Huntbase SecOps rule writer role to the writer. Running the setup script again fixes both. Role changes can take a few minutes.
404 or "not found"The region, project or customer ID doesn't match your instance.Check each one against Settings › SIEM Settings › Profile. The region must match the instance, for example eu rather than us.
The script says keys are blocked by policyYour organization blocks service-account keys.Ask for a project-level exception. See If your organization blocks service-account keys.
The key is rejected on the formThe file isn't a service-account key, for example a user credential or an OAuth client file.Create a JSON key for a service account.
A query fails with a syntax errorUDM search syntax differs from other languages.Test the query in SecOps search first, then paste it in.
No alerts arriveAlert ingest is off, or nothing alerted in SecOps.Check the setting, and check that the rules in SecOps have alerting turned on.
A watcher deployment says it needs a credentialThe connection has no Rule writing credential.Add the writer's key as a Rule writing credential.

Next steps​