# GCP Buckets

{% hint style="info" %}
Before you can start protecting your data in GCP Buckets you'll need to [link in your GCP account(s)](https://help.cloudstoragesec.com/console-overview/access-management/linked-accounts/linking-a-gcp-account).
{% endhint %}

## How It Works <a href="#schedule-status" id="schedule-status"></a>

When linking an account in the CSS console, we deploy resources in a new CSS Project created in GCP through our Terraform module. Those resources will have access to the customer project(s) denoted in the deployments parameters (projects\_to\_protect).

Once the projects are linked, GCP buckets will be made available to be scan through the CSS Console in the Protection > GCP Buckets page. You can select buckets to scan or run scans on a schedule basis.

We offer two types of scanning for GCP: Event-Based Scanning and Retro scanning.

{% tabs %}
{% tab title="Event-Based Scanning" %}

<figure><img src="https://905555942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlGcQw8I2CHyi1loKBlfi%2Fuploads%2F8BqYtLNZ8xw71DwERBKD%2FCSS-Architecture-gcp-event-annotated(2).png?alt=media&#x26;token=9de10511-d532-40dd-9558-36aec9c0ab03" alt=""><figcaption></figcaption></figure>

1. Users or apps place files into Google Cloud Storage.
2. The Pub/Sub service has a Topic set up to notify whenever new objects are created in designated Buckets.
3. The Cloud Run Job's subscription to the Topic activates whenever a new file is created.
4. The Cloud Run Job accesses the designated Bucket and loads that new object in memory to scan.
5. Files in the protected Bucket are tagged with their scan result.
6. (Optional) The Cloud Run Job will move infected files to a Quarantine Cloud Storage that resides in CSS' Project.
7. Results are returned to the Console service for processing.
   {% endtab %}

{% tab title="Retro Scanning" %}

<figure><img src="https://905555942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlGcQw8I2CHyi1loKBlfi%2Fuploads%2F34QQEjbQL24rGC7H931G%2FCSS-Architecture-GCP-retro(1).png?alt=media&#x26;token=9b9f2630-b6c0-4db3-9b3a-e13112bf00e5" alt=""><figcaption></figcaption></figure>

1. Users or apps place files into Google Cloud Storage.
2. The Console Service initiates a scan request to the Cloud Run service that resides in CSS' Project that is provisioned via Terraform.
3. The Cloud Run Job accesses the customer's Cloud Storage and loads a list of its objects in memory, procedurally scanning each item.
4. (Optional) The Cloud Run Job will move infected files to a Quarantine Cloud Storage that resides in CSS' Project.
5. Results are returned to the Console service for processing.
   {% endtab %}
   {% endtabs %}

## Protecting Buckets <a href="#schedule-status" id="schedule-status"></a>

<figure><img src="https://905555942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlGcQw8I2CHyi1loKBlfi%2Fuploads%2FcMSgyHVV5irsEdqGvfCL%2Fimage.png?alt=media&#x26;token=f5d49a78-fa45-44c3-a7f7-4576e387985b" alt=""><figcaption></figcaption></figure>

"Protection" can mean multiple things: real-time scanning (event-based), schedule scanning (pre-defined schedule based) and on-demand (pick one or more buckets and scan immediately whenever you want).

## Shield Status <a href="#shield-status" id="shield-status"></a>

The shield color shown on this page will reflect how a bucket is being protected with event-based scanning. A red shield means a bucket is not protected and a green shield means a bucket is protected.

## Schedule Status <a href="#schedule-status" id="schedule-status"></a>

The schedule icons shown below will reflect whether an object is associated with a schedule and whether that schedule is active or not.

* Protected by Active Schedule - ![Green clock](https://help.cloudstoragesec.com/~gitbook/image?url=https%3A%2F%2F905555942-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FlGcQw8I2CHyi1loKBlfi%252Fuploads%252FcWjXBZghM895Qpeu9Zr7%252Fgreen-clock.png%3Falt%3Dmedia\&width=300\&dpr=4\&quality=100\&sign=3b3c0c07\&sv=2)
* Part of an **Inactive** Schedule - ![Red clock](https://help.cloudstoragesec.com/~gitbook/image?url=https%3A%2F%2F905555942-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FlGcQw8I2CHyi1loKBlfi%252Fuploads%252FD1I4zDFdWHhwv79Ma0Zi%252Fyellow-clock.png%3Falt%3Dmedia\&width=300\&dpr=4\&quality=100\&sign=f385a9b2\&sv=2)
* Not a Part of any Schedule - ![Red clock](https://help.cloudstoragesec.com/~gitbook/image?url=https%3A%2F%2F905555942-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FlGcQw8I2CHyi1loKBlfi%252Fuploads%252FLAvOVzethjMYhwSe7V27%252Fred-clock.png%3Falt%3Dmedia\&width=300\&dpr=4\&quality=100\&sign=ecd8378e\&sv=2)

## Enable event-based protection on a Bucket <a href="#enable-event-based-protection-on-a-blob" id="enable-event-based-protection-on-a-blob"></a>

Similar to protecting Amazon S3 buckets, you can click the red shield associated with each Bucket to enable event-based protection on a bucket and scan any new files being uploaded to the Bucket automatically.

You can also select multiple buckets at the same time, go to the Actions menu, and select Turn On Event AV to enable event-based protection on multiple buckets at the same time.

## Retro-based scanning on a bucket

### On-demand Scanning <a href="#on-demand-scanning" id="on-demand-scanning"></a>

You can scan pre-existing files in a bucket at anytime by selecting which bucket you'd like to scan and then selecting Scan Existing - AV in the Actions menu.

* Navigate to Protection > GCP > Buckets page
* Select the check mark next to the bucket name of your volume
* Click Actions > Scan Existing - AV
* Select your date range, prefixes (optional) and whether you'd like to scan files that have been already scanned.
* Acknowledge that scanning files will result in a charge and scan selected.

<figure><img src="https://905555942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlGcQw8I2CHyi1loKBlfi%2Fuploads%2FdHCd1L2XhiDBp2SoTlBc%2Fimage.png?alt=media&#x26;token=69b63147-1bbd-464e-839a-54c7713785d5" alt=""><figcaption></figcaption></figure>

### Scheduled Scanning <a href="#scheduled-scanning" id="scheduled-scanning"></a>

You can add buckets to a schedule by selecting the buckets you want to scan on a scheduled basis and selecting Create AV Schedule in the Actions menu.

* Navigate to Protection > GCP > Buckets page
* Select the check mark next to the bucket name of your volume
* Click Actions > Create AV Schedule
* Select the Schedule tab and enter in your schedule name, scan period, schedule description (optional), files to scan, and prefixes to crawl (optional).
* Acknowledge that scanning files will result in a charge and save the schedule.

<figure><img src="https://905555942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlGcQw8I2CHyi1loKBlfi%2Fuploads%2Fhpnrp6AMeEhVNoux12qg%2Fimage.png?alt=media&#x26;token=90a612de-b8f3-418d-9272-e34dc81f4d92" alt=""><figcaption><p>Create AV Schedule</p></figcaption></figure>

* Click on Schedules, find the schedule you created. Click the button with 3 dots on it and click Activate.&#x20;

<figure><img src="https://905555942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlGcQw8I2CHyi1loKBlfi%2Fuploads%2F09uXNZ0lTjBkofAohowj%2Fimage.png?alt=media&#x26;token=0380e121-fd1e-44a1-994b-7f727938f5c3" alt=""><figcaption></figcaption></figure>

### GCP On-demand and Scheduled Scan Job Status <a href="#azure-on-demand-and-scheduled-scan-job-status" id="azure-on-demand-and-scheduled-scan-job-status"></a>

If you go to Monitoring > Jobs you'll be able to see the status of on-demand and scheduled retro scans for GCP Buckets.

<figure><img src="https://905555942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlGcQw8I2CHyi1loKBlfi%2Fuploads%2FUyUhoQYqLotfTdLStt27%2Fimage.png?alt=media&#x26;token=6bd0b601-4914-4e0d-8408-eb8e20dc7ab2" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.cloudstoragesec.com/console-overview/protection/gcp/gcp-buckets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
