> [!NOTE]
> Premium and Enterprise (Deprecated) [service tiers](https://docs.cloud.google.com/security-command-center/docs/service-tiers.md.txt)

> [!CAUTION]
> The Security Command Center Enterprise service tier will shut down on May 21, 2027. If your organization uses the Enterprise service tier, then the organization will automatically move to the Premium service tier on or after May 21, 2027. Contact your account representative or a [Google Cloud sales specialist](https://cloud.google.com/contact) if you have questions.


> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

<br />

This document describes a threat finding type in Security Command Center. Threat findings are generated by
[threat detectors](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources.md.txt#threats) when they detect
a potential threat in your cloud resources. For a full list of available threat findings, see [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).

## Overview

A resource was saved outside of your organization or project initiated by an AI
agent.

[Event Threat Detection](https://docs.cloud.google.com/security-command-center/docs/concepts-event-threat-detection-overview.md.txt) is the source of
this finding.

## How to respond

To respond to this finding, do the following:

### Step 1: Review finding details

1. Open the `Exfiltration: AI Agent Initiated BigQuery Data Exfiltration to External Table` finding, as directed in [Reviewing findings](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats.md.txt#reviewing_findings).
2. On the **Summary** tab of the finding details panel, review the
   listed values in the following sections:

   - **What was detected** :
     - **Principal email**: the account used to exfiltrate the data.
     - **Exfiltration sources**: details about the tables from which data was exfiltrated.
     - **Exfiltration targets**: details about the tables where exfiltrated data was stored.
   - **Affected resource** :
     - **Resource full name**: the full resource name of the project, folder, or organization from which data was exfiltrated.
   - **Related links** :
     - **Cloud Logging URI**: link to Logging entries.
     - **MITRE ATT\&CK method**: link to the MITRE ATT\&CK documentation.
     - **Related findings**: links to any related findings.
3. Click the **Source Properties** tab and review the fields shown,
   especially:

   - `evidence`:
     - `sourceLogId`:
       - `projectId`: the Google Cloud project that contains the source BigQuery dataset.
   - `properties`
     - `dataExfiltrationAttempt`
       - `jobLink`: the link to the BigQuery job that exfiltrated data.
       - `query`: the SQL query run on the BigQuery dataset.
4. Optionally, click the **JSON** tab for the complete listing of the
   JSON properties of the finding.

### Step 2: Review permissions and settings

1. In the Google Cloud console, go to the **IAM** page.

   <br />

   [Go to IAM](https://console.cloud.google.com/iam-admin/iam)

   <br />

2. If necessary, select the project listed in the `projectId` field in the
   finding JSON.

3. On the page that appears, in the **Filter** box, enter the email address
   listed in **Principal email** and check what permissions are assigned to the account.

### Step 3: Check logs

1. On the **Summary tab** of the finding details panel, click the **Cloud Logging URI** link to open the **Logs Explorer**.
2. Find admin activity logs related to BigQuery jobs by using
   the following filters:

   - `protoPayload.methodName="Jobservice.insert"`
   - `protoPayload.methodName="google.cloud.bigquery.v2.JobService.InsertJob"`

### Step 4: Research attack and response methods

1. Review the MITRE ATT\&CK framework entry for this finding type: [Exfiltration to Cloud Storage](https://attack.mitre.org/techniques/T1567/002/).
2. Review related findings by clicking the link on the **Related findings** on the **Related findings** row in the **Summary** tab of the finding details. Related findings are the same finding type on the same instance and network.
3. To develop a response plan, combine your investigation results with MITRE research.

### Step 5: Implement your response


The following response plan might be appropriate for this finding, but might also impact operations.
Carefully evaluate the information you gather in your investigation to determine the best way to
resolve findings.

- Contact the owner of the project with exfiltrated data.
- Consider [revoking permissions](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access.md.txt#revoking-console) for `userEmail` until the investigation is completed.
- To stop further exfiltration, [add restrictive IAM policies](https://docs.cloud.google.com/bigquery/docs/dataset-access-controls) to the impacted BigQuery datasets (`exfiltration.sources` and `exfiltration.targets`).
- To scan impacted datasets for sensitive information, [use
  Sensitive Data Protection](https://docs.cloud.google.com/bigquery/docs/scan-with-dlp). You can also [send
  Sensitive Data Protection data to Security Command Center](https://docs.cloud.google.com/sensitive-data-protection/docs/sending-results-to-scc). Depending on the quantity of information, Sensitive Data Protection costs can be significant. Follow best practices for [keeping Sensitive Data Protection costs
  under control](https://docs.cloud.google.com/sensitive-data-protection/docs/best-practices-costs).
- To limit access to the BigQuery API, [use
  VPC Service Controls](https://docs.cloud.google.com/vpc-service-controls/docs/overview).
- To identify and fix overly permissive roles, use [IAM
  Recommender](https://docs.cloud.google.com/iam/docs/recommender-overview).

## Example finding JSON

The following is an example of the finding JSON, with default values omitted.

```json
{
  "finding": {
    "name": "organizations/ORGANIZATION_ID/sources/SOURCE_ID/locations/global/findings/FINDING_ID",
    "parent": "organizations/ORGANIZATION_ID/sources/SOURCE_ID/locations/global",
    "resourceName": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
    "state": "ACTIVE",
    "category": "Exfiltration: AI Agent Initiated BigQuery Data Exfiltration to External Table",
    "securityMarks": {
      "name": "organizations/ORGANIZATION_ID/sources/SOURCE_ID/locations/global/findings/FINDING_ID/securityMarks"
    },
    "eventTime": "TIMESTAMP",
    "createTime": "TIMESTAMP",
    "severity": "HIGH",
    "canonicalName": "projects/PROJECT_NUMBER/sources/SOURCE_ID/locations/global/findings/FINDING_ID",
    "findingClass": "THREAT",
    "access": {
      "callerIp": "IP_ADDRESS",
      "callerIpGeo": {
        "regionCode": "COUNTRY_CODE"
      },
      "userAgent": "USER_AGENT",
      "serviceName": "bigquery.googleapis.com",
      "methodName": "google.cloud.bigquery.v2.JobService.InsertJob",
      "principalSubject": "principal://agents.global.org-ORGANIZATION_ID.system.id.goog/resources/aiplatform/projects/PROJECT_NUMBER/locations/LOCATION/reasoningEngines/REASONING_ENGINE_ID"
    },
    "mitreAttack": {
      "primaryTactic": "EXFILTRATION",
      "primaryTechniques": [
        "EXFILTRATION_OVER_WEB_SERVICE",
        "EXFILTRATION_TO_CLOUD_STORAGE"
      ]
    },
    "exfiltration": {
      "sources": [
        {
          "name": "//bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID"
        }
      ],
      "targets": [
        {
          "name": "//bigquery.googleapis.com/projects/TARGET_PROJECT_ID/datasets/TARGET_DATASET_ID/tables/TARGET_TABLE_ID"
        }
      ]
    },
    "parentDisplayName": "Event Threat Detection",
    "domains": [
      {
        "category": "AI"
      },
      {
        "category": "IDENTITY_AND_ACCESS"
      }
    ],
    "logEntries": [
      {
        "cloudLoggingEntry": {
          "insertId": "INSERT_ID",
          "logId": "cloudaudit.googleapis.com/data_access",
          "resourceContainer": "projects/PROJECT_ID",
          "timestamp": "TIMESTAMP"
        }
      }
    ]
  },
  "resource": {
    "name": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
    "displayName": "PROJECT_ID",
    "type": "google.cloud.resourcemanager.Project",
    "cloudProvider": "GOOGLE_CLOUD_PLATFORM",
    "service": "cloudresourcemanager.googleapis.com",
    "gcpMetadata": {
      "project": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
      "projectDisplayName": "PROJECT_ID",
      "parent": "//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID",
      "parentDisplayName": "ORGANIZATION_DISPLAY_NAME",
      "organization": "organizations/ORGANIZATION_ID"
    },
    "resourcePath": {
      "nodes": [
        {
          "nodeType": "GCP_PROJECT",
          "id": "projects/PROJECT_NUMBER",
          "displayName": "PROJECT_ID"
        },
        {
          "nodeType": "GCP_ORGANIZATION",
          "id": "organizations/ORGANIZATION_ID"
        }
      ]
    },
    "resourcePathString": "organizations/ORGANIZATION_ID/projects/PROJECT_NUMBER"
  },
  "sourceProperties": {
    "sourceId": {
      "projectNumber": "PROJECT_NUMBER",
      "customerOrganizationNumber": "ORGANIZATION_ID"
    },
    "detectionCategory": {
      "ruleName": "agent_engine_big_query_exfil",
      "subRuleName": "agent_engine_exfil_to_external_table"
    },
    "detectionPriority": "HIGH",
    "affectedResources": [
      {
        "gcpResourceName": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER"
      }
    ],
    "evidence": [
      {
        "sourceLogId": {
          "projectId": "PROJECT_ID",
          "resourceContainer": "projects/PROJECT_ID",
          "timestamp": {
            "seconds": "TIMESTAMP_SECONDS",
            "nanos": TIMESTAMP_NANOS
          },
          "insertId": "INSERT_ID",
          "logId": "cloudaudit.googleapis.com/data_access"
        }
      }
    ],
    "properties": {
      "dataExfiltrationAttempt": {
        "jobState": "SUCCEEDED",
        "jobLink": "https://console.cloud.google.com/bigquery?j=bq:BIGQUERY_JOB_LOCATION:BIGQUERY_JOB_ID&project=PROJECT_ID&page=queryresults",
        "job": {
          "projectId": "PROJECT_ID",
          "jobId": "BIGQUERY_JOB_ID",
          "location": "BIGQUERY_JOB_LOCATION"
        },
        "query": "QUERY",
        "sourceTables": [
          {
            "resourceUri": "https://console.cloud.google.com/bigquery?p=PROJECT_ID&d=DATASET_ID&t=TABLE_ID&page=table",
            "projectId": "PROJECT_ID",
            "datasetId": "DATASET_ID",
            "tableId": "TABLE_ID"
          }
        ],
        "destinationTables": [
          {
            "resourceUri": "https://console.cloud.google.com/bigquery?p=TARGET_PROJECT_ID&d=TARGET_DATASET_ID&t=TARGET_TABLE_ID&page=table",
            "projectId": "TARGET_PROJECT_ID",
            "datasetId": "TARGET_DATASET_ID",
            "tableId": "TARGET_TABLE_ID"
          }
        ]
      }
    },
    "findingId": "FINDING_ID",
    "contextUris": {
      "mitreUri": {
        "displayName": "MITRE Link",
        "url": "https://attack.mitre.org/techniques/T1567/002/"
      },
      "cloudLoggingQueryUri": [
        {
          "displayName": "Cloud Logging Query Link",
          "url": "https://console.cloud.google.com/logs/query;query=timestamp%3D%22TIMESTAMP%22%0AinsertId%3D%22INSERT_ID%22?project=PROJECT_ID"
        }
      ]
    },
    "domains": [
      {
        "category": "AI"
      },
      {
        "category": "IDENTITY_AND_ACCESS"
      }
    ]
  }
}
```

## What's next

- Learn [how to work with threat
  findings in Security Command Center](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats).
- Refer to the [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).
- Learn how to [review a
  finding](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats#reviewing_findings) through the Google Cloud console.
- Learn about the [services that
  generate threat findings](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources#threats).