Installation and Setup
Follow these steps to install and configure the GCS reporting module in your CAPE Sandbox environment.
Prerequisites: Google Cloud Setup
Before installing the module, you need to prepare your Google Cloud environment.
Create a GCS Bucket: If you don’t already have one, create a new bucket in the Google Cloud Console.
Create a Service Account: * Go to IAM & Admin > Service Accounts in the Google Cloud Console. * Click Create Service Account and give it a name (e.g.,
cape-sandbox-uploader). * Grant it the Storage Object Creator or Storage Object Admin role. This permission is necessary to write files to the bucket.Download JSON Key: * This step is optional if you use
auth_by=vm* After creating the service account, go to its Keys tab. * Click Add Key > Create new key. * SelectJSONas the key type and click Create. A JSON file will be downloaded. * Securely move this JSON file to your CAPE server, for example, to/opt/CAPEv2/data/gcp-credentials.json.Warning
Do not place the credentials file in a publicly accessible directory.
Module Installation and Configuration
Install the Python Library: The module depends on the official Google Cloud Storage library. Install it within your CAPE virtual environment.
Note
Install dependency
poetry run pip install google-cloud-storage.Update Configuration: * Edit
/opt/CAPEv2/conf/reporting.conf. *[gcs]section, enableenabled=yes. * Setbucket_nameto the name of your GCS bucket. * Setauth_bytovmif using system account orjsonif using credential file. * Setcredentials_pathto the absolute path where you saved your service account JSON key file.Restart CAPE-processor: Restart the CAPE service:
systemctl restart cape-processorfor the changes to take effect.